TradingView
rouxam
21. Apr. 2021 23:04

Backtesting 3commas DCA Bot v2 

Bitcoin / TetherUSBinance

Beschreibung

Updating previously published simulated 3commas DCA logic with a sexier insert and more meaningful default parameters.

Versionshinweise

Added possibility to use the RSI [configurable as per 3c presets] as buy signal

Versionshinweise

Large Revamp:
- Added Label with warning and summary
- Added Stop Loss support
- Improved time inputs
- General bug fixes

Versionshinweise

Quick amend on previous commit:
- add comments in script
- add warnings for limitations on backtesting with stop loss (in general, do not use a stop loss if you use DCA on the Spot market)

Versionshinweise

Quick amend previous commit:
- Improved currency formatting

Versionshinweise

more realistic amount of BTC (divided amount of BTC by 1000 because who owns 2000 BTC ?!)

Versionshinweise

Fixed stop loss, reordered input as per 3c bot setup, fix max deviation calculation, add list of bot parameters on label printout

Versionshinweise

- Fix quantities calculation
- Default to RSI-7 < 30 for buy signal

Versionshinweise

amend previous commit

Versionshinweise

- fix RSI start condition (Below; not crossover)
- set RSI default timeframe to 15
- small rework on the warning/results labels

Versionshinweise

- Fixed Stop Loss triggers. Thank you @RealSaim for testing and reporting !

Versionshinweise

- more meaningful default inputs
- Slightly more sexy snapshot

Versionshinweise

New feature:
- Add a counter of total deals

Versionshinweise

New Feature:
- Add nb of deals closed on hitting Stop Loss

Versionshinweise

added support for Take Profit Type "% From Total Volume" or "% From Base Order "

Versionshinweise

After getting the request from many of you, here it is:
- YOU CAN NOW BACK-TEST SHORT BOTS !

Versionshinweise

new update includes:
- refactored closing deal code
- add comparison of DCA bot performance to simple Buy and Hold.

Versionshinweise

Fix Trailing TP logic for short bot

Versionshinweise

New features !!
- Using TA Presets (Buy/Strong Buy/Sell/Strong Sell)
- Allow using different timeframes for RSI
- Allow using a percentage of equity rather than fixed amount of currency
- Numbered warnings

Versionshinweise

New feature !!
- Backtesting timeframe updated automatically on the label

This is because the number of bars available is a fixed amount so if you select a 1m timeframe, you can backtest over only a few days, but if you select a 15m timeframe you can backtest over several months.

limits:
free account = 5000 bars
pro/pro+ account = 10000 bars
premium account = 20000 bars

Versionshinweise

Fix bug on deal closure
Renamed "TA Preset" to "TV Preset"

Versionshinweise

fixed typo

Versionshinweise

Fancy update people !! A few weeks ago, TradingView released a new object called a "Table" and this is really a big upgrade on the usability of this backtester.
Kommentare
moduman20
hello Max please can you check your pm. there is an issue on backtesting fisrst order open as SO not BO, and some other issue , having set trade asap there some periods without trades then again new trade begin with SO. other issue i have noticed having all profit set in percentage and comulative pro fit get to 10k but bo close with 80 cent profit.
thanks for your support.
brianallen282
@moduman20, I'm noticing some issues as well. The SO's are not being filled at the correct deviation percentage. Have you found another backtesting strategy that works with bot settings?
avibeker1
Hi @rouxam ,
First of all, thank you for the effort you put into this project!
Question, How can I update the list of trades to the current date? right now it's until May 19.

Thanks!
rouxam
@avibeker1, that’s funny. Can you PM me a screenshot of your setup ?
rouxam
@rouxam, resolved. the market simply crashed further than Max Deviation from your setup.
TheHiddenTruth
Awesome work!
Just 1 question as a 3COMMAS newbie trying to get my head around all this.
The summary green "label" on the chart (copied below), does not match the overview analysis on the 15m chart (or any other time frame) . Sanity checks out fine, but there is a big difference in the profit loss analysis. The the green box net result-$743 and the overview shows +$266. Do you know what i am doing wrong to have the disparity ?

Backtesting 3commas DCA Bot v2 (1.3, % from total volume, 0, 0, Fixed, 98, 147, 7, 0.7, 1.2, 0.9, RSI-7, 30, Strong, , Long)
rouxam
@TheHiddenTruth do you have any open deal ? ;) TV overview does not seem to account for these?
MMBOT80
Greeeeeat job! Wonderful fast feedback! Very appreciate! I have just some advice if you can :
1. In final box adding the longest trade (could be useful to evaluate how many times the bot wait for closing a trade)
2. In the same box adding average SO used
3. and the time in % that the bot is "active", excluding while is waiting for a next order (you can check Trading Parrot video posted some messages above)
4. An idea is to run 2 separate bot, one long and one short, on same coin, so both can cover full trend. For this I need a trend indicator.. Any advice?
5. Leverage good idea
6. Replying to your question, Market cipher has a TV public code (proprietary indicator almost perfect replica)

Everyone here want to make money.. Everyone is playing hours to find best profit parameters.. Can we found a way to share our backtest results /real profits with the others?

Thank for your passionates help!
rouxam
@kdpub80, some great ideas, i still have them in mind. coming soon !
ProFunder
Another stat that would be a good one is the number of safety orders. It gives a nice insight into how a coin behaves :)
Mehr