Friday, August 17, 2018

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.





ALGORITHM

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.

The only parameter in this algorithm is the value of StopLoss. Let us choose this parameter as follows:

      StopLoss = x*StandardDeviation

In simple words, Standard Deviation characterizes the width of the probability distribution (for example, in normal distribution a chance of going beyond 2*StandardDeviation is about 5%). Using SPX historical (see Part I) one can calculate that 1.25%  is Standard Deviation for the probability distribution of SPX daily returns expressed in %,

The results of the algorithmic trading from the long side  (the cost of trading was set to 0.01%) were estimated for  x={1, 1/2, 1/4} and are shown below:



The table below shows more details for x =1/4:



The last column of the table above shows the difference between the return of the algorithm and the total return of SPY.
One can envision that the algorithm should be fine for trading from the short side as well.  The table below shows the result for x=1/4 and trading from the short side:


CONCLUSIONS

The results presented here indicate that directional betting in day trading is of no importance.

In fact, the best result is achieved when the proposed algorithm is used simultaneously both from the long and short sides.

Managing losses based on the width of the probability distribution is the key to expect profit when trades will be averaged over.

The optimized "cut your losses early and let your winners run" approach should be a generic part of any trading algorithm on the time frames with the symmetrical or quasi-symmetrical distribution of returns.

DISCLAIMER
The presented here results are a theoretical study which was conducted out of curiosity. The algorithm described here can't be used as a guide for real trading.

There could be significant differences, especially at the open, in the published values of the SPX index and the tape values of Emini futures or SPY ETF.  Consequently, the presented results are not directly applicable to  Emini/SPY.

P.S.
Hope this reading was helpful for your trading comprehension. Part III will be about swan-like events. Probably you have noticed that the years 2008 & 2009 stand apart in the performance tables.
Finally, after day job hours, I develop real trading algorithms.

No comments:

Post a Comment

$350 profit, flat platinum gold #2

Earlier today platinum gold #2 was posted . Quick money is always welcome. trades r posted live  @ tfo_medved Exec Time Spread Si...