A trading system based on Standard Deviation
Last updated
Last updated
(ES Chicago mini snp500) Wikipedia/ Standard_deviation
These prices do not show typical distribution. But we are not interested in mathematical justification, we are interested in possible profit we can get. If we have a look at this picture showing typical distribution of random values, we can see that only 0.2 % of values are beyond these three deviations.
Probably we can see good points for entering a position. The zero is the place where our position can be closed, as it is where random values happen to be found more often. It means that probability that the next random value will be beyond these three deviations is only 0,2 %. I showed profit standard deviation of futures mini snp 500 based on offline data.
How can we forecast deviation? It’s not easier than to predict market trends. If deviation has increased significantly and reached 80% in relative values, most likely it will decrease soon. Deviation may have its trends as well. Deviation, exactly like market itself, may be analyzed with the help of technical analysis or SMA, EMA, JMA indicators. Deviation may have resistance, support and so on. I built SMA based on bar closing prices and then I built three standard deviation lines.
Let us get back to normal distribution. When a random value is beyond these three deviations, there is high probability that the next random value will be within three deviations and most likely will tend to zero in the distribution chart. In other words, when price is beyond three deviations, there is high probability, that it will start moving to its SMA. And if price is within three deviations it will most likely stay there. So I built a trading strategy. When it touches three standard deviation lines, a limit order is fulfilled, and I put take-profit SMA.
Pay attention, that the strategy gives positive results on various timeframes. Here are the results based on 5 and 10 minute timeframes including the broker commission.
So when you select a timeframe for calculating standard deviation, do it considering your trading idea. The robot will take decisions faster if we take a small timeframe to calculate deviation. If we use the number of deviations and SMA to optimize the strategy, we can get better results, but the idea itself gets lost, as my idea cannot be considered and the result will be based only on offline data. Here is a 5 minute chart example:
These parameter values result in placing orders on bar extreme values and they won’t ever be executed. Deviation can be significant when the market is in crisis. Most likely we need to take into consideration SMA in such strategies and we should not forget about stop-losses. This trading strategy is just an example helping you to study TSLab. Good luck! StDev_channel_5min.tscript
Download the file. Click Lab in TSLab main menu, then choose Script manager. Click the Load from file button.