TradingView
zendog123
16 ธันวา 2021 เวลา 15 นาฬิกา 41 นาที

Zendog V3 backtest DCA bot 3commas 

SOL / TetherUSBinance

คำอธิบาย

MAJOR UPDATE:
- Update to Pinescript v5
- MAJOR refactor for the logic of how orders are placed. BO order is placed when the condition is first encountered and we are not in a deal.
The extra SO orders (if based on price movement) are all placed on the next candle after BO order, instead of each being placed one after another.
Take profit (if percentage) and Stop loss are placed on the first candle after BO order because if BO and TP are on the same candle TV does not execute properly.
These changes should improve strategy accuracy when multiple prices are hit by the same candle.
- NEW FEATURE: Support to Stop deal using an external indicator (i.e. stop long deal when RSI > 80)
- NEW FEATURE: Support to trigger Safety orders using an external indicator (i.e. trigger each additional SO when RSI < 10, regardless of price movement)
The price movement logic may be implemented in the indicator that plots start / end signals. The SO size is calculated using the configuration of steps.
- NEW FEATURE: Safety order command for 3commas bot. This is implemented using Add funds in the quote currency (for pair BTCUSDT the quote currency is USDT)
The SO size is calculated using the configuration of steps, for exact order size (and price) use the built-in Steps table.
- NEW FEATURE: Addition of extra columns to the steps table: Required price for TP, Required % change for TP, Required % change for BEP (Breakeven point)
- Update to steps table to remove prices when Safety orders are not based on % price change

- The code is opensource. I will not be able to sustain merges for the script, but feel free to use and develop your own version and ping me on discord to review them
and maybe include in the original script



เอกสารเผยแพร่

- update title to V3

เอกสารเผยแพร่

- update date range limit and made default value false (do not limit date range)
- fixed statistic bug when deal was stopped from external indicator
ความคิดเห็น
moduman20
check pm please
Banberry
My script for choosing the type of strategy:

// --- Automatic selection of the Strategy type ---
cfg_strategy_type = input.string(title='Strategy Type', defval='long', options=['long', 'short', 'SMA', 'EMA', 'RMA'], group='Strategy settings')
ma_length = input.int(title="MA length for Strategy Type", defval=900, minval=1, maxval=9999, group='Strategy settings')

d_ma = cfg_strategy_type == 'EMA' ? ta.sma(close, ma_length) : cfg_strategy_type == 'SMA' ? ta.ema(close, ma_length) : cfg_strategy_type == 'RMA' ? ta.rma(close, ma_length) : na
IS_LONG = strategy.position_size == 0 ? cfg_strategy_type == "long" ? true : cfg_strategy_type == "short" ? false : d_ma > d_ma[1] : strategy.position_size > 0

plot(d_ma, title = "EMA direction", color = IS_LONG ? color.green:color.red)
// ----------------------------------------------------------
Oliboy74
@Banberry, hi mate. how can you connect another script signal/alert to this backtester?
egranville
Dear Zendog,
This script is next level!! I'm trying it out for the first time.

I'm seeing some unusual behavior and wanted to check if I'm doing something wrong. I'm just testing the script using the RSI at 26 to enter long and exit at 1.5% TP. Seeing that some trades would stay open a long time I started by adding 10 SOs. After seeing the period only uses 6 at a maximum (from the stats) I proceed to limit the SOs to 6 just to see what that does to the profit %. I expected it to go up but it goes down instead. I also expected the max amount of SOs used to remain 6 but it will jump to 5. I'm testing it on BINANCE: LUNA/BUSD.
UPDATE: Just tried it on BINANCE: BTC/USDT and getting expected results there...hmmm...

Could a sudden price spike or dip cause this?

If I can supply you with any more info, just let me know
cilingirerkan
Can you add limit order. Because it sometimes misses the price in sudden movements.
rboepple
Hi @zendog123,
This Backtester is awesome. Brillant and thanks so much for putting the effort in and putting such great content out.

One comment I saw is that the results on profit on the Strategy tester are fastly different to the one displayed by your backtester.

Any idea why that is and which one can you trust more?

Thanks again mate. Such a great tool.

Ralf
YALCIN_A
hello, when we make an order x amount of purchases, what kind of way should I follow so that I can buy 2x the purchase again in the next decreases. For each purchase, I need to purchase x2 of the previous order amount. x,2x,4x
Crypto-Joker
Nice one! Is there a way to use longs AND shorts? On this version I have to choose for one direction for the hole backtest.
zukka1979
Hello congratulations on your zen dog. I have to ask you a favor. I don't understand this real trading situation. The situation is as follows.
I copy the parameters from 3commas DCA to your zendog and I launch the real 3commas bot. The trades that 3comma executes are different from the trades that your zendog makes. How does this happen?
tpaolo
All deals closed.
370 finished deals.
Winning deals: 68 (7.09 USd on avg)
Losing deals: 128 (-7.08 USD on avg)
Timeout deals: 302 (-0.37 USD on agv)
Required capital: 340 USD
Profit: 810.57 USD (238.4%) 0,37/day.

The total amount of winning deals is less than the total amount of losing and timeout deals, so I wonder how could this setup be in profit.
In additon, why losing deals are not included in finished deals total?
เพิ่มเติม