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 the results of a directional day trade can be approximated by a toss of an unfair coin - 0.47 shorts, 0.53 longs. Thus a directional day trader has a close to zero expected value of the return. It can be said that the ensemble of directional day traders 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 the return.  The figure below demonstrates how the proverbial "cut your losses early and let your winners run" can be tested in a quantitative fashion.



ALGORITHM

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

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

      StopLoss = x*StandardDeviation

For a bell-shaped distribution, Standard Deviation (SD) characterizes the expected deviation from the mean (for example, in the normal distribution a chance of going beyond 2*SD is about 5%). By choosing the StopLoss parameter in terms of SD we want to avoid either being stopped early, i. e. to avoid accumulating a large number of small losses, or being stopped late, i. e. to avoid a loss that is an order of magnitude larger than the expected profit. Using the historical probability distribution of SPX (see Part I), one can calculate SD=1.25% for the daily return 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, where the last column shows the difference between the return of the algorithm and the total return of SPY:





One can envision that the algorithm should also be fine for trading from the short side.  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.

Stop Loss was optimized using SD as a unit of the daily price movement. Consequently, the statistical expectation of the mean return was shifted into positive territory.

The SD-optimized "cut your losses early and let your winners run" approach is a natural solution for any trading algorithm where price behaves like a random process without memory.

DISCLAIMER

The results presented here are gained from the theoretical study that was conducted out of my personal curiosity and may not be used as financial advice. It should be noted, that there could be a significant difference, especially at the open, in the published values of the SPX index and the tape values of Emini futures or SPY ETF.

P.S.
Part III will be about rare events when the market doesn't behave in an efficient manner. You have probably noticed that 2008, 2009, and 2011 stand apart in the performance tables. These years were characterized by sudden price movements dubbed as black swan events.


No comments:

Post a Comment