In this article, we will talk about the modification of reversal candles (also known as Revers). This modification was developed specifically for algorithmic traders so they could test this method of candle gathering over any depth of history.
Basic Revers candles are a unique tool for technical analysis that allows you to identify zones of non-retracement moves during trading and only close when a significant move occurs followed by a retracement. That is, they allow you to see panic buying or selling, where there was not even a hint that someone could push the market in the opposite direction of the move.
Reversal Volatility Adaptive candles adjust to the volatility of the previous N days, adapting the candle size to the current realities of the asset, and provide equivalent strength signals across the entire history. Whether it was 10 years ago or 5 years ago.
1. The meaning of Reversal Volatility Adaptive candles.
Reversal candles adapted for volatility were specifically developed to allow algorithmic traders to test their ideas seamlessly on deep historical data while applying the basic concept of Revers candles.
2. Calculation of Reversal Volatility Adaptive candles.
In the settings of these candles, there are several variables. Let’s take a look at them:
1. Choose candle type – ReversVolatilityAdaptive.
2. Value type – type of minimum candle size. Options include percentages and absolute values.
3. Min movement – minimum candle size in the units specified in the previous parameter. Until the end of the first day, the user-specified value is used. Afterward, it is calculated automatically.
4. Rollback – retracement from the high or low after which the candle will be considered closed. Absolute values. Until the end of the first day, the user-specified value is used. Afterward, it is calculated automatically.
5. Adaptive days look back – over how many previous days the averaged intraday volatility will be taken for further calculations.
6. Vertical segments of volatility – the number of segments we will originally divide the averaged intraday volatility. This significantly affects the number of candles within the next day. The larger this value, the more candles there will be.
7. Min move volatility mult – multiplier for the base size of the candle from the volatility segment.
8. Back move volatility mult – multiplier for the candle retracement from the volatility segment.
The adaptation process in pictures.
Stage 1. Calculate the averaged volatility for the previous N (Adaptive days look back) days:
At the end of this stage, we have the averaged movement for the past N days. In absolute or percentage terms.
Stage 2. Break down the volatility into the segments specified in the Vertical segments of volatility parameter:
At the end of this stage, we divided the averaged volatility into parts. In this case, into 100. It would be helpful to break it down into the number of candles immediately, but unfortunately, it does not work that way and there is a significant element of uncertainty. Therefore, we break it down into a conditional number of candles that we want to see.
Stage 3. Calculate the new base size of the candle and the new retracement for closing the candle:
At this stage, we calculated new values for the parameters. We can build the candles further.
You can view the adaptation of the candles in the source files here:
3. How can you trade using Reversal Volatility Adaptive candles?
The uniqueness of the candles lies in the fact that they do not close as long as the move continues in the direction it started from the initiation. Therefore, various algorithms can be applied to determine non-retracement moves and trends based on this criterion.
Confirmation of trend strength. Large non-retracement candles. The first non-retracement breakthrough of a level at very high volumes...
4. How to launch Reversal Volatility Adaptive candles in Os Engine.
Open the main menu in Os Engine and go to “Bot Station Light.”
Connect to the “АЛОР” connector or any other:
Next, create a trading robot, in this case, it will be Bollinger Revers:
Now, go to the data stream connection menu for the robot:
Select any instrument from the list; in our case, it will be “Sber”:
1. Choose candle type – ReversVolatilityAdaptive.
2. Value type – type of minimum candle size. Options include percentages and absolute values.
3. Min movement – minimum candle size in the units specified in the previous parameter. Until the end of the first day, the user-specified value is used. Afterward, it is calculated automatically.
4. Rollback – retracement from the high or low after which the candle will be considered closed. Absolute values. Until the end of the first day, the user-specified value is used. Afterward, it is calculated automatically.
5. Adaptive days look back – over how many previous days the averaged intraday volatility will be taken for further calculations.
6. Vertical segments of volatility – the number of segments we will predominantly divide the averaged intraday volatility into. This greatly affects how many candles will be present in the next day. The larger this value, the more candles there will be.
7. Min move volatility mult – multiplier for the base size of the candle from the volatility segment.
8. Back move volatility mult – multiplier for the candle retracement from the volatility segment.
After the settings, we see a chart with candles:
IMPORTANT!!!
Don’t forget that the chart will only be able to adjust adequately to the market and the number of candles you specify after accumulating at least one full day of trade history. The adaptation itself will occur during the first trade at the opening of the second day.
5. Where is the source code of the candle assembly in OsEngine located?
The source code of the candles in OsEngine is publicly available on the GitHub platform.
After downloading OsEngine to your PC, you can find the source files inside the project here:
Good luck with your algorithms!