Let’s consider an impulse robot that trades non-standard candles. In the project, it’s called CustomCandlesImpulseTrader.
The essence of this robot is that it enters a position when it sees N consecutive candles in one direction within a certain number of seconds. It’s relevant to test and trade with candle types like RangeVolatilityAdaptive and RonkoVolatilityAdaptive, so the candle size is adaptive rather than time-based.
This way, you can test and trade impulses tied to the volatility of instruments, and also to the time during which the impulse occurred. On the chart, it may look something like this:
1. Example in the project.
The CustomCandlesImpulseTrader robot is located within the OsEngine project. Open it and go here:
2. Parameters of the candles.
Tests of this robot need to be conducted on tick data to utilize custom candle types.
For tests enabled the following candles:
These are adaptive volatility candles made specifically for algo traders, which adjust their height depending on volatility and close after they have moved a certain part of the average intraday volatility.
This robot will also work perfectly with adaptive Renko candles.
3. Robot parameters.
1. Regime – operating mode.
Off – Disabled.
On – Enabled and will enter both long and short.
OnlyLong – Enabled and will only go long.
OnlyShort – Enabled and will only go short.
OnlyClosePosition – will only close a position without entering.
2. Volume type – volume selection mode.
Contracts – number of contracts of the instrument.
Contract currency – currency of the contract.
Deposit percent – percentage of the deposit.
3. Volume – volume value. What exactly depends on the previous point. In the case of Contracts, the volume of the instrument is specified here. In the case of Contract currency, the number of rubles or dollars to enter is specified here. In the case of Deposit percent, the % of the total deposit to enter the contract is indicated here.
4. Asset in portfolio – here you need to indicate the currency name that will be used for volume calculation if you selected the "Deposit percent" volume type. In the tester, leave “Prime.” In crypto, this is usually “USDT.” In ALOR, it’s “RUB.”
5. Slippage % – slippage for order prices.
6. Candles count to entry – the number of candles in one direction after which a signal to enter appears.
7. Seconds time on candles to entry – filter. The time in seconds during which the required number of candles in one direction formed.
8. Candles count to exit – the number of candles after which we exit.
4. Logic for entering and exiting positions.
LONG
The required (Candles count to entry) number of consecutive growing candles has accumulated over a certain (Seconds time on candles to entry) number of seconds.
SHORT
The required (Candles count to entry) number of consecutive falling candles has accumulated over a certain (Seconds time on candles to entry) number of seconds.
Exit occurs at the completion of a certain number of candles.
5. What about profit?
1. Trading with this setup does not yield the best results. Surprisingly, there are no profits on Sber!
2. But everything that is not TOP and easily movable through Telegram channels is perfect here! There is some potential in the second echelon.
3. Without properly integrating volatility (possibly through an index for the platform to select papers that accelerate with the entire market, say each morning), nothing will come of it…
Good luck with algorithms!