In this article, we will discuss Delta Adaptive candles in OsEngine. These are candles that are built as aggressive (taker) sellers and buyers begin to dominate each other. In this modification, the candles can adapt their size based on trading activity from previous days. This allows for testing over any time intervals while keeping the size of the candles consistent, despite different activity levels on the instrument in various years.
1. Features of the Volume Adaptive Candle Modification.
By default, Delta candles provide insight without the need for any additional indicators regarding the price levels where aggressive (and even panic) buying or selling occurs. Delta candles show the difference (delta) between the volumes of purchases (aggressive buyers) and sales (aggressive sellers) over a specified period, offering distinctly different entry points compared to classical indicator strategies.
This candle modification, called Delta Adaptive, helps adjust the candle size to the activity of sellers and buyers over different years, months, and days. Specially designed for algorithmic traders to test their strategies on any depth of history effortlessly.
2. Calculation of Delta Adaptive Candles.
In the settings of these candles, there are several variables. Let's take a look at them:
1. Select candle type – DeltaAdaptive.
2. Change delta to close – the change of delta within the candle, after which the candle closes.
3. Candles count in day – the number of candles within a day that the algorithm should adjust Change delta to close over the past N days.
4. Adaptive days look back – how many previous days the intraday volumes will be averaged for the adaptation algorithm. In this case, it is a MAXIMUM OF TWO, as the adaptation algorithm can only accurately know the delta for those days each current morning.
General idea of operation:
1. For the first day of operation, the candle collector uses the settings for closing candles specified by the user in the Change delta to close parameter. As soon as the imbalance between sellers and buyers changes to the specified value in this parameter, the candle closes. This results in standard OHLCV over time, adjusted by delta deviations.
2. When the first trade of the new day arrives, the algorithm switches to the size adaptation module for delta changes to close candles.
3. The total number of candles over the past N days is taken and multiplied by the current delta for closing the candle specified in the settings.
4. Next, the total number of delta changes is divided by the number of candles set by the user in Candles count in day. The resulting value is the new size of the delta change for closing the candle, which is recorded in the Change delta to close parameter.
The adaptation algorithm is described in this method within the series:
3. How to Trade with Delta Adaptive Candles?
Delta candles can be useful in many trading strategies. Here are some of them:
1. Trend Identification.
A sequence of candles with positive or negative delta can be used to determine the direction of the trend. If higher buying volumes are observed in a rising market, it confirms the strength of the trend.
2. False Breakouts on Low Volumes with Delta Changes.
If the price breaks a key level, and there is a delta shift without significant volumes, this may indicate a false breakout and a soon return of the price.
4. How to Launch Delta Adaptive Candles in Os Engine.
Open the main menu in Os Engine and go to "Bot Station Light."
Connect to the "ALOR" connector or any other one:
Next, create a trading robot; in this case, it will be the 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. Select candle type – DeltaAdaptive.
2. Change delta to close – the change of delta within the candle, after which the candle closes.
3. Candles count in day – the number of candles within a day that the algorithm should adjust Change delta to close for the past N days.
4. Adaptive days look back – the number of previous days over which intraday volumes will be averaged for the adaptation algorithm. In this case, a MAXIMUM OF TWO, as the adaptation algorithm can only accurately know the delta for those days each current morning.
After the settings, we see a chart with "DeltaAdaptive" candles:
IMPORTANT!!!
Do not forget that the graph can only adequately adjust to the market and the number of candles you set after accumulating at least one day of trade history, and the adaptation will happen with the first trade at the opening of the second day.
5. Where to find the source code for the candle assembly in OsEngine.
The source code for OsEngine candles is publicly available on the GitHub platform.
After downloading OsEngine to your PC, you can find the source files within the project here:
Good luck with your algorithms!