In this article, we will talk about TimeSpan candles in OsEngine.
These candles are very similar to Japanese candles, but there is no predetermined list of timeframes, and you can set any time interval for their formation.
1. History of the Emergence of TimeSpan Candles.
These are classic Japanese candles with customizable timeframes. Thus, it can be asserted that this type of candle was invented by Japanese rice traders in the 18th century.
2. Calculation of TimeSpan Candles.
In the settings of these candles, there are several variables. Let's take a look at them:
1. Type of candles.
2. Forced start from zero – forced start mode from the beginning of a certain time:
- Off – disabled
- Every day – the count of candles will start from the beginning of the day.
- Every hour – the count of candles will start from the beginning of the hour.
- Every minute – the count of candles will start from the beginning of the minute.
3. Hours – number of hours for the candle timeframe.
4. Minutes – number of minutes for the candle timeframe.
5. Seconds – number of seconds for the candle timeframe.
The overall concept of operation is simple:
1. The width of the candle over time is gathered from the data on Hours / Minutes / Seconds.
2. Then, the candle itself is formed within this time interval just like a Japanese candle. More details can be read here.
3. If the forced start of the candle is enabled, then once a day, hour, or minute, the candle is forcibly closed. This might be necessary to align the candle.
3. How to Trade with TimeSpan Candles?
Technically, it's still OHLCV. And, obviously, both candlestick patterns and indicator and breakout strategies are available on them. By using this type of candle, you can obtain unique entry points that differ from those seen by other trading robots.
4. How to Launch TimeSpan Candles in OsEngine.
Open the main menu in OsEngine and go to "Bot Station Light."
Connect to the "ALOR" 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:
Choose any instrument from the list. In our case, this will be "Sber":
1. Select the type of candles TimeSpanCandle.
2. Forced start from zero – forced start mode from the beginning of a certain time:
- Off – disabled
- Every day – the count of candles will start from the beginning of the day.
- Every hour – the count of candles will start from the beginning of the hour.
- Every minute – the count of candles will start from the beginning of the minute.
3. Hours – number of hours for the candle timeframe.
4. Minutes – number of minutes for the candle timeframe.
5. Seconds – number of seconds for the candle timeframe.
After the settings, we see a chart with "TimeSpan" candles that have a width of 41 seconds / 19 seconds (since the forced restart is enabled at the end of the minute):
5. Where is the Source Code for TimeSpan Candles in OsEngine?
The code for TimeSpan 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!