Cyatophilum 3Commas DCA Bot BacktesterAn indicator to backtest and automate 3Commas DCA Bots.
═════════════════════════════════════════════════════════════════════════
█ HOW IT WORKS
The indicator allows you to replicate your bot settings and get backtest results from the Strategy Tester and also a backtest panel with additional information on the safety orders.
You can also create alerts for each of the strategy events.
█ HOW TO USE
Choose a symbol that corresponds to your bot pair and exchange.
Pick a chart time frame as small as possible, usually 1 minute. The timeframe should always be smaller or equal to the deal start conditions timeframes.
Always use regular candle type.
Configure your deal start condition . You can combine several technical indicators to trigger an entry using a AND logical gate.
Configure your profit target
Use the Take Profit feature to set a target in percentage of price. You can also make it trail.
There is also a Stop Loss feature that is turned off by default.
Configure your safety orders
Replicate the safety orders from your bot into the indicator inputs.
Check your backtest parameters
Make sure that the initial capital and order size make sense. Since it is a pyramiding strategy with safety orders, the sum of all deals should not be bigger than the initial capital.
In this example: Initial capital is 0.02 BTC, which around 600$. I used 1000$ to be safe.
If you use % equity as order size, please note that it will create compounding.
Check the fees, by default they are set to 0.1%.
I also recommend to set a slippage that corresponds to your exchange's spread.
█ FEATURES
• Strategy direction
Configure wether to go long or short.
• Deal Start Conditions
The current conditions available are:
- Up to 4 MTF Trading View ratings conditions (Buy/Sell, Strong Buy/Sell)
- Up to 4 MTF RSI with configurable start conditions (Less/Greater than, Crossing Up/Down)
- Up to 2 MTF Ultimate Oscillator with configurable start conditions (Less/Greater than, Crossing Up/Down)
- MTF BB%-20-1 (length-deviation) with configurable start conditions (Less/Greater than, Crossing Up/Down)
- MTF BB%-20-2 (length-deviation) with configurable start conditions (Less/Greater than, Crossing Up/Down)
- Up to 2 MTF TA presets with the following options (Bollinger Bands, MFI, CCI, MACD, PSAR, SMA crosses, Heikin Ashi)
• Stop Loss and Take Profit
Configure your stop loss and take profit for long and short trades.
You can also make a trailing take profit.
• DCA (Safety orders)
Create up to 100 safety orders with configurable options for step and volume scaling, take profit from total volume, base and safety order size.
• Backtest Settings
Choose a backtest period, longs or shorts, wether to use limit orders or not.
Graphics
A Configuration panel with all the indicator settings, useful for sharing/saving a strategy.
A Backtest Results panel with additional information from the strategy tester.
█ ALERTS
The indicator is using the alert() calls: it only uses 1 alert slot to send order messages for each event (Long/Short entry, stop loss, take profit, safety order). This means free TV plans can create 1 complete strategy.
To set your alert messages, open the indicator settings and scroll to the bottom of the "inputs" tab.
Create your alert after you set the messages in the indicator settings, and make sure "Any alert() function call" is set in the alert option.
█ BACKTEST RESULTS
The backtest settings used in this snapshot are the following:
Initial Capital: 1000€
Order size: 0.003 BTC
Commission: 0.1 % per order
Slippage : 1 tick
Please read the author instructions below for access.
Orders
multiple orders - strategy - educationalHi,
Here is a 'template', using array's, for multiple orders and different SL/TP levels per trade (This is an example with max 5 open trades)
The 'switch' makes sure that the first available position will be used,
for example, when 'L1' is closed in the past, and a buy condition is triggered, position 'L1' will be filled,
should it be that 'L1', 'L2', 'L3' are already filled, then position 'L4' will be filled, ...
An extra table is added with data of the trades
Be aware, the 'Buy and Hold' resembles the profit when 100% of the available equity has been bought at the time of the very first trade and sold now. On the other hand, the positions work with a % of equity, 20% per trade (5 x 20 = 100%)
You can see that every trade exits on its own terms, without interference of other trades
Important, this technique only works if in the strategy() function:
- close_entries_rule -> set at 'ANY'
- pyramiding is set at max amount of trades or higher (in this case 5 or higher)
Cheers!