Backtesting 3commas DCA Bot v2

Updating previously published simulated 3commas DCA logic with a sexier insert and more meaningful default parameters.
הערות שחרור: Added possibility to use the RSI as buy signal
הערות שחרור: Large Revamp:
- Added Label with warning and summary
- Added Stop Loss support
- Improved time inputs
- General bug fixes
הערות שחרור: 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)
הערות שחרור: Quick amend previous commit:
- Improved currency formatting
הערות שחרור: more realistic amount of BTC (divided amount of BTC by 1000 because who owns 2000 BTC ?!)
הערות שחרור: Fixed stop loss, reordered input as per 3c bot setup, fix max deviation calculation, add list of bot parameters on label printout
הערות שחרור: - Fix quantities calculation
- Default to RSI-7 < 30 for buy signal
הערות שחרור: amend previous commit
הערות שחרור: - fix RSI start condition (Below; not crossover)
- set RSI default timeframe to 15
- small rework on the warning/results labels
הערות שחרור: - Fixed Stop Loss triggers. Thank you @RealSaim for testing and reporting !
הערות שחרור: - more meaningful default inputs
- Slightly more sexy snapshot
הערות שחרור: New feature:
- Add a counter of total deals
הערות שחרור: New Feature:
- Add nb of deals closed on hitting Stop Loss
הערות שחרור: added support for Take Profit Type "% From Total Volume" or "% From Base Order "
הערות שחרור: After getting the request from many of you, here it is:
הערות שחרור: new update includes:
- refactored closing deal code
- add comparison of DCA bot performance to simple Buy and Hold.
הערות שחרור: Fix Trailing TP logic for short bot
הערות שחרור: 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
הערות שחרור: 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.

free account = 5000 bars
pro/pro+ account = 10000 bars
premium account = 20000 bars
הערות שחרור: Fix bug on deal closure
Renamed "TA Preset" to "TV Preset"
הערות שחרור: fixed typo
הערות שחרור: 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.
סקריפט קוד פתוח

ברוח TradingView אמיתית, מחבר סקריפט זה פרסם אותו עם קוד פתוח, כך שסוחרים יוכלו להבין ולאמת זאת. הידד למחבר! אתה יכול להשתמש בו בחינם, אך שימוש חוזר בקוד זה בפרסום הנו בכפוף ל כללי הבית . אתה יכול להגדירו כמועדף ולהשתמש בו בגרף.

רוצה להשתמש בסקריפ זה בגרף?


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.

+8 השב
rouxam avibeker1
@avibeker1, that’s funny. Can you PM me a screenshot of your setup ?
+1 השב
rouxam rouxam
@rouxam, resolved. the market simply crashed further than Max Deviation from your setup.
Another stat that would be a good one is the number of safety orders. It gives a nice insight into how a coin behaves :)
+5 השב
rouxam ProFunder
@ProFunder, could you be more precise ? maximum number of SO triggered ? so that you can lower the nb of SO to (over)fit the backtest?
+1 השב
@rouxam, thanks for the quick reply. From the manual that you linked on the previous iteration for this it seemed to be describing the stop loss % after the last SO. But I guess I read that wrong as after your reply I tested as a percentage that takes the last SO into account and it worked. Thanks for the clarification.
@rouxam, Yes, the most useful indicator would be the average number of SO's per trade. The lower the number the higher the velocity of trades (profits). Thanks... keep up the good work!
@rouxam, The maximum number of SO's experienced during the backtest would also be a good one.
catweazle77 ProFunder
@ProFunder, second that! Average number of SOs used per deal, max. number of SOs used in any deal would both be very interesting.
Maybe also how often max number of SOs were being used.

But even so, this is a great tool, thank you very much for providing this!
+1 השב
Thank you very much for your contribution!!!! I am testing the you have in mind incorporating the signals to trigger the deals?
+4 השב