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.
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.
No comments:
Post a Comment