Labels

Friday, October 19, 2018

Thursday, October 18, 2018

Emini naked call


Exec Time Spread Side Qty Pos Effect Symbol Exp Strike Type Price Net Price Order Type
10/18/2018 10:37 SINGLE SELL -1 TO OPEN /ESZ18 1/50 OCT 18 (Wk3) /EW3V18 2835 CALL 2.3 2.3 LMT

a minuscule position in SLV puts

bought a minuscule position in SLV puts.  

Exec Time Spread Side Qty Pos Effect Symbol Exp Strike Type Price Net Price Order Type
10/18/2018 10:31 SINGLE BUY 3 TO OPEN SLV 18-Jan-19 12 PUT 0.05 0.05 LMT
10/18/2018 10:25 SINGLE BUY 1 TO OPEN SLV 17-Jan-20 10 PUT 0.06 0.06 LMT

Thursday, October 11, 2018

+$200, flat bond futures puts

Exec Time Spread Side Qty Pos Effect Symbol Exp Strike Type Price Net Price Order Type
10/11/2018 14:27 SINGLE BUY 1 TO CLOSE /ZBZ18 1/1000 DEC 18 /OZBZ18 133 PUT 0''12 0''12 LMT

+$400, Long Crack Spread

The trade was posted live @tfo_medved

10/16/2018
Flat , P/L   +$400


Exec Time Spread Side Qty Pos Effect Symbol Exp Strike Type Price Net Price Order Type
10/16/2018 10:25 FUTURE SELL -1 TO CLOSE /RBZ18 18-Dec FUTURE 1.9582 1.9582 MKT
10/16/2018 10:25 SINGLE BUY 1 TO CLOSE /CLZ18 1/1000 DEC 18 /LOZ18 70.5 CALL 2.73 2.73 LMT


10/12/2018 
/CLZ18  future was replaced by ATM put.  
Current P/L:  realized    +$420; pending  -$990.


Exec Time Spread Side Qty Pos Effect Symbol Exp Strike Type Price Net Price Order Type
10/12/2018 10:51 FUTURE BUY 1 TO CLOSE /CLZ18 18-Dec FUTURE 71.11 71.11 MKT
10/12/2018 10:26 SINGLE SELL -1 TO OPEN /CLZ18 1/1000 DEC 18 /LOZ18 70.5 CALL 2.53 2.53 LMT
                  
When a pair trade goes wrong.

10/11/2018

Exec Time Spread Side Qty Pos Effect Symbol Exp Strike Type Price Net Price Order Type Spread
10.5538
10/11/2018 12:26 FUTURE SELL -1 TO OPEN /CLZ18 18-Dec FUTURE 71.51 71.51 MKT
10/11/2018 12:26 FUTURE BUY 1 TO OPEN /RBZ18 18-Dec FUTURE 1.9539 1.9539 LMT


Wednesday, October 10, 2018

+$200, flat gas-oil pair

Exec Time Spread Side Qty Pos Effect Symbol Exp Strike Type Price Net Price Order Type Spread
11.8572
10/10/2018 15:08 FUTURE BUY 1 TO CLOSE /CLZ18 18-Dec FUTURE 72.84 72.84 MKT
10/10/2018 15:08 FUTURE SELL -1 TO CLOSE /RBZ18 18-Dec FUTURE 2.0166 2.0166 LMT

The trade entry was posted live on https://twitter.com/tfo_medved.

Long Simple Crack Spread


 How to calculate and trade Simple Crack Spread using RBOB and WTI Futures. 

Exec Time Spread Side Qty Pos Effect Symbol Exp Strike Type Price Net Price Order Type Spread
11.6296
10/10/2018 11:16 FUTURE SELL -1 TO OPEN /CLZ18 18-Dec FUTURE 73.16 73.16 MKT
10/10/2018 11:16 FUTURE BUY 1 TO OPEN /RBZ18 18-Dec FUTURE 2.0188 2.0188 LMT

Monday, October 8, 2018

Long Bonds

 /ZBZ18 futures: sold naked 133 Put -

Exec Time Spread Side Qty Pos Effect Symbol Exp Strike Type Price Net Price Order Type
10/8/2018 10:09 SINGLE SELL -1 TO OPEN /ZBZ18 1/1000 DEC 18 /OZBZ18 133 PUT 0''26 0''26 LMT

Sunday, September 30, 2018

algorithmic day trading : -15.5 /ES points

8/31/2018 -9
9/4/2018 -11.5
9/5/2018 -4.75
9/6/2018 -3
9/7/2018 -5.25
9/10/2018 2.5
9/11/2018 0
9/12/2018 -8.25
9/13/2018 0
9/14/2018 -1.75
9/17/2018 6
9/18/2018 2.75
9/19/2018 0
9/20/2018 9.75
9/21/2018 8.75
9/24/2018 -4.25
9/25/2018 1.75
9/26/2018 0
9/27/2018 0
9/28/2018 0.75
Total: -15.5

The previous period was posted here.
Starting March 2018 the algorithm made 80 /ES points per contract.

Algorithmic Day Trading How To.

Tuesday, September 25, 2018

+$250 flat soy puts

Exec Time Spread Side Qty Pos Effect Symbol Exp Strike Type Price Net Price Order Type
9/25/2018 9:48 SINGLE BUY 1 TO CLOSE /ZSX8 1/50 NOV 18 /OZSX8 800 PUT 3 3 LMT

The entry was posted live here and @tfo_medved.

Monday, September 24, 2018

+$330, flat WTI RBOB pair

Exec Time Spread Side Qty Pos Effect Symbol Exp Strike Type Price Net Price Order Type Crack
13.5426
9/24/2018 12:55 FUTURE BUY 1 TO CLOSE /CLX8 18-Nov FUTURE 72.15 72.15 MKT
9/24/2018 12:55 FUTURE SELL -1 TO CLOSE /RBX8 18-Nov FUTURE 2.0401 2.0403 LMT

The entry was posted live here and @tfo_medved.

Long X8 Simple Crack Spread

Exec Time Spread Side Qty Pos Effect Symbol Exp Strike Type Price Net Price Order Type Crack
13.19
9/24/2018 9:18 FUTURE SELL -1 TO OPEN /CLX8 18-Nov FUTURE 72.28 72.28 MKT
9/24/2018 9:18 FUTURE BUY 1 TO OPEN /RBX8 18-Nov FUTURE 2.035 2.035 LMT

Friday, September 21, 2018

Thursday, September 20, 2018

$160, flat gas oil pair

Exec Time Spread Side Qty Pos Effect Symbol Exp Strike Type Price Net Price Order Type Crack
13.895
9/20/2018 22:53 FUTURE BUY 1 TO CLOSE /CLX8 18-Nov FUTURE 70.21 70.21 MKT
9/20/2018 22:53 FUTURE SELL -1 TO CLOSE /RBX8 18-Nov FUTURE 2.0025 2.0025 LMT

The entry was posted here.

Wednesday, September 19, 2018

Simple Crack Spread : long gas short oil

 How to calculate and trade Simple Crack Spread using RBOB and WTI Futures. 


Exec Time Spread Side Qty Pos Effect Symbol Exp Strike Type Price Net Price Order Type Crack_Spread
13.714
9/19/2018 11:08 FUTURE SELL -1 TO OPEN /CLX8 18-Nov FUTURE 70.58 70.58 MKT
9/19/2018 11:08 FUTURE BUY 1 TO OPEN /RBX8 18-Nov FUTURE 2.007 2.007 LMT

Wednesday, September 5, 2018

silver continued

Because of the recent dive, there was only $5 of extrinsic value left in Dec_2018 15 Put. The position was rolled far out in exchange for $85.

Exec Time Spread Side Qty Pos Effect Symbol Exp Strike Type Price Net Price Order Type
9/5/2018 10:22 STOCK BUY 100 TO OPEN SLV ETF 13.33 13.33 LMT
9/5/2018 10:22 SINGLE SELL -1 TO OPEN SLV 17-Jan-20 15 CALL 0.85 0.85 LMT
9/5/2018 10:21 SINGLE BUY 1 TO CLOSE SLV 31-Dec-18 15 PUT 1.71 1.71 LMT

Thursday, August 30, 2018

-$600, Day Trading Algorithm

8/14/2018 4
8/15/2018 -15.75
8/16/2018 3.25
8/20/2018 -3.25
8/21/2018 -5.75
8/24/2018 4.75
8/27/2018 4.25
8/28/2018 0.5
8/30/2018 -3.5
Total: -11.5


Starting  March, Medved's proprietary algorithm made 95 /ES points. 

Friday, August 24, 2018

-$6,280 #soybean

according to the plan. The lesson here is - don't increase the size of a losing position.

Soybean Naked Put

New Entry

Exec Time Spread Side Qty Pos Effect Symbol Exp Strike Type Price Net Price Order Type
8/24/2018 9:38 SINGLE SELL -1 TO OPEN /ZSX8 1/50 NOV 18 /OZSX8 800 PUT 8.125 8.125 LMT
My old position will be closed later today ; the expected loss is ~ $6,000.

+$107 , Bonds macro trade

/ZBU8 153 naked call goes to heaven.
The entry was posted here.

Wednesday, August 22, 2018

Statistical Mechanics of Algorithmic Day Trading SP500, Part V: Leverage Using The Kelly Criterion

I will start this post by reminding that trading with leverage carries significant risk.    Day traders use leverage to win big, however, usually they lose big and end up in misery  To avoid this fate please read"Why Day Traders Lose Money".

This post is about the algorithmic use of leverage in day trading. The goal is to optimize growth of the trading capital.  The related problem is  tossing a favorable coin (binominal game). The known solution to favorable binomial games is The Kelly criterion.   Kelly's solution involves a mathematical idealization that the capital can be dived infinitely, i.e. an infinitesimally small bet is possible which is not the case in real trading. In this post, an example of how Kelly can be used to control trading SP500 Emini futures is provided.

Part  II  of Statistical Mechanics of Algorithmic Day Trading describes a generic algorithm for trading SP500 which ensures a positive expectation of  return. Averaged over years 2007 to 2017 this algorithm has win ratio w = 0.38 and payout p= 2.7.  Kelly is given by k = w-(1-w)/p = 0.15. Thus, for the optimal grows of the trading capital, the bot has to risk f, 0.15, fraction of the capital. Recall that the bot uses 1/4 of daily Standard Deviation of SP500 as the stop loss. Accordingly, to start trading one Emini contract it is necessary to have $280= 1/4*1.25%*SP500*50 as the minimal bet and $280/k=$1800  as the initial trading capital at the beginning of 2007.  The actual capital used to start the simulation was  $5000 which is about  3x of the precalculated starting capital. The two goals were achieved by this increase:  1) to decrease the volatility of the trading capital; 2) to allow up to 66% loss of the capital while maintaining f < k. Now the algorithm is really simple:

if  (f < k/6)  number of contracts =  number of contracts* 2;
if (f >  k/2)  number of contracts =  number of contracts / 2;

 The result of the trading from the long side ($5,000 to $5,000,000 in about two years) is shown below.


DISCLAIMER
The presented here results are a theoretical study which was conducted out of curiosity. The algorithms described here are for entertainment only.

Sunday, August 19, 2018

Mathematics behind of "Why Day Traders Lose Money"

Mathematical statistics explains three major reasons behind the frustrating reality that nearly all day traders lose money.

1. Instead of "cut your losses early and let your winners run" a trader usually is inclined to "take the profit early and let the losers run". This type of behavior is dictated by emotions while statistical analysis showed that taking profit early leads to a negative expectation. "Let the losers run and averaging losers" in day trading is a recipe of "how to lose your deposit quick".

2. The second reason has to deal with the mathematical fact that for a trader who has a limited capital having a strategy with a positive expectation is a necessary condition to win but it is not a sufficient one. Proper position sizing is required to be a profitable trader.

Let us describe the problem in simple terms.  As I posted earlier, day trading can be approximated by a toss of a biased coin. Now imagine that a trader has $1000 and knows a strategy equal to a coin biased as follows -  2/3  heads and 1/3 tails. If this trader every time goes all in on heads than, at some point, all wins and the initial $1000 will be lost.  There is a limit to the fraction of the capital this trader can bet on a single toss to avoid the ruin and there is the optimal bet which allows growing the capital with the fastest rate. The mathematical solution to this problem is known as the Kelly criterion.  For the coin used in the example above, the Kelly gives  2/3-1/3=1/3 as the optimal fraction of the capital to bet. This solution involves a mathematical idealization that the capital can be dived as many times as it requires and an infinitesimally small bet is possible. Unfortunately, unless a trader has enough money to start with say 100 emini contracts, the Kelly criterion can't be used directly by a small-scale day trader.  However, this criterion still can be used to prevent a day trading strategy from running into a ruin.
To summarize, the problem of the optimal bet in the leveraged trading on time frames with the quasi-normal distribution of the return (day or shorter time frames) is still, at least to me, an open question.
I will try to look into this problem.
Update:  Leveraged Trading Using The Kelly Criterion.


3. The third reason is the cost of trading which includes trading fees and a slippage. The quasi-normal distribution of the daily return results in close to zero expectation of trading. That is many wins and losses eventually just cancel each other while, as time passes by, the cost of trading steadily adds to the loss.  For this reason, many quant strategies that look good on paper do not deliver in real life. Here one has to :
  a) daytrade using only liquid trading instruments;
  b) choose a broker with a better fee structure;
  c) use the realistic cost of trading in calculating the expected return of a trading model.

Friday, August 17, 2018

Statistical Mechanics of Algorithmic Day Trading SP500, Part III: Take Profit & White Swans

INTRODUCTION


The probability distribution of SP500 daily return was calculated and posted in Part I. The calculations showed that the Efficient Market Hypothesis is a good approximation, i.e. most of the time the daily return of SPX index is a variable with close to zero expectation which equates day trading to gambling against a house. The house has the statistical advantage due to the trading fees. In Part II, it was shown that both for longs and shorts a positive expectation can be achieved using  "cut your losses early and let your winners run" approach. 

On algorithmic level this approach was formulated as follows:

1. Every trading day: if no position open SPX position at the close of the trading session;
2. Next day: if return < StopLoss than close the position.


When the only parameter in this algorithm (StopLoss) is optimized the algorithm is expected to outperform the total return of SP500 (see Part II). Here we modified the algorithm by introducing the TakeProfit variable.

Statistical Mechanics of Algorithmic Day Trading SP500, Part II : Generic Algorithm of Day Trading

“Number rules the universe.”
― 
Pythagoras

INTRODUCTION
In Part I, the probability distribution (density) of SP500 daily return was calculated. It was shown that a directional day trade is not much different from a toss of a fair coin - 0.47 shorts, 0.53 longs. At best a directional daytrader has a close to zero expected value of return. It can be said that the ensemble of the directional daytraders exists only to generate trading fees while their wins and losses eventually cancel each other.

To make day trading profitable one needs to shift the probability distribution to have a positive expected value of return.  The figure below demonstrates how the proverbial "cut your losses early and let your winners run" can be tested in a quantitative fashion. I believe that this is how instead of fear of uncertainty one acquires a conviction.



Statistical Mechanics of Algorithmic Day Trading SP500, Part I : Probability Distribution of The Daily Return

      “Number rules the universe.”― Pythagoras


SP500 market is characterized by both deep liquidity and high daily volumes. The popular instruments for trading SP500 index are SPY, SPX and Emini (/ES) futures.   At current prices of SP500 a daily move in Emini futures can easily exceed $1000 while, for example, ThinkOrSwim trading platform requires only ~ $6000 as the initial margin. Consequently, a SP500 daytrader is attracted by the idea to get rich fast like a moth to a flame; more than 90% of retail traders end up losing money. It is reasonable to ask thenWhy do people trade at all?- and is it possible to make money by day trading SP500. The answer to the first question is not an easy one as it involves many facets of our life. I believe that to a large degree it is related to being in a poor financial situation.

To answer the second question I used the statistics of one regular trading session of SP500 index. The probability distribution of the daily return of SP500 was presented in the first part of this publication. It was shown that day trading of SP500 is similar to a coin toss with even payout and with a small favor for betting from the long side. In the second part, a generic methodology of algorithmic day trading for a retail investor will be derived based on the calculated statistics.