Example of a trading strategy without parameters

Script examples. Example of a trading strategy without parameters

An example of a trading strategy.

This strategy is described in an article written by Yury Chebotarev and Sergey Yashin. This trading strategy is based on an idea that price makes a certain number of steps in a certain timeframe. If price has changed significantly, it means that this instrument is trending. If a bar is long, we buy, if a bar is short, we close our position. So we use downtrend bars to enter a short position. Realizing the strategy with a parameter could look very simple if we should only analyze bar size and then apply a very simple condition like bar size is being bigger or smaller than a constant.

The authors offer an interesting approach and the strategy is remarkable for its approach to parameter values. If an average value of the bar (H+L)/2 is lower than a certain value of Delta (L+∆), this bar has low market volatility and doesn’t deserve any trying to gain profit. If an average value of the bar (H+L)/2 is higher than Delta (L+∆), this bar has high market volatility, and we could try to enter a position to gain a short term profit.

If (H+L)/2 > L+∆, this is a signal to open a long position. This condition is also a condition for being in long positions for all bars. If (H+L)/2 ≤ L+∆, this is a signal not to open a long positions. The next picture shows when we should enter a short positions.

Let’s define a secondary factor for long positions: k=(close - open)/(high - low). And for short positions k=(open-close)/(high-low). The k factor varies from 0 to 1. If K=0, we can say that volatility is low. If k=1 the instrument is trending.According to this idea, if k=0, then ∆ should be big so that market entry condition couldn’t be executed. If k=1, then ∆ should tend to zero. Hence here is the formula ∆ = (high-low)*(1-k). So delta values are unique for each bar and shouldn’t be optimized. The authors think that parameter that should to be optimized are the biggest drawback of this trading startegy. As a rule the strategy gives good results for a certain period of time after it has been optimized, and then we need to search for new parameter values again. So it’s for sure better for a trader to build trading strategies where no parameter values are used or they do not influence a trading idea much and there is no need to optimize historical data. Most likely the authors did not take into consideration the Time parameter, the period of time when we watch the price changing, I mean the timeframe the bars are built on.

This is just an example of trading strategy for TSLab learners.

Good luck!

Strategy without parameters.tscript Download the file. Click Lab in TSLab main menu, then choose Script manager. Click the Load from file button.

Last updated