TradingView
treigen
2022年4月27日下午2點51分

DCA Bot for ProfitView 

BTC Perpetual Futures ContractDeribit

描述

The base for this strategy is the "Backtesting 3commas DCA Bot v2" script by rouxam. I have made some additions, edits, and fixes, as well as tailored it for usage with ProfitView.
The strategy works in such a way that you select one or multiple rules together, in order to determine when a trade should be initiated.
The selectable rules are:
  • RSI-7: Initiate trading when the 7 period RSI goes below a specified threshold.
  • Technicals: This is essentially the TradingView screener strength. A multitude of technical indicators combined that range from Strong Sell - Sell - Buy - Strong Buy.
  • QFL: Find a support/resistance line on a specified timeframe, and initiate trading only when the price is below a certain point from this line.


Once the deal start rule is met, trading will initiate, and a series of additional orders will be placed and spaced out according to the order settings set in the indicator. These orders includes Take Profit, Stoploss, Trailing Take Profit, and specified additional entry orders to DCA your way into a position.

The indicator is set up so that by hooking this up to ProfitView, all of the signals should automatically be replicated to your assigned exchange, along with discord/telegram notifications for when the deals start and end, and the resulting pnl.

If you want to use it for spot markets, while technically possible, you will need to significantly edit the PV Alert syntax that i have supplied below.
Run this on your testnet of choice, it is likely that there are undiscovered issues at this point.
The strategy currently only works with 'Longs' at the time of publishing, but may be subject to change.



==ProfitView Setup==
!!Important!!
The assigned PV Alert name must contain the keyword 'Long', fex "DCA Long"
Uncheck the Once per Bar advanced filter option on the PV Alert you use for this.
Copy/Paste the text into the PV Alert: pastebin.com/X8BSqS8W

發布通知

In order to start automating the strategy after inserting your PV details, create an alert and select "alert() function calls only".

Fixed issue with a timeframe warning being shown when a rule was set to 1D or above

發布通知

Fix another issue where stop loss were being incorrectly added to the results counter when stop loss functionality was turned off

發布通知

Added possibility to do two different conditions, each can be tailored to specific market conditions, fex QFL 3m and TA 4H for bullish trend entries, or QFL 4H and RSI-7 30m for bearish trend entries.
The both will check if either of these conditions are met when starting a deal.

發布通知

Added leverage notice for when used capital exceeds 100% of available capital

發布通知

Fixed an issue with the QFL offset percentage only working with condition1

發布通知

Fixed a bug where the normal TP order adjustment alert would trigger at the same time as the initial entry order

發布通知

Remove an unnecessary comma in the alert mesage if the set symbol is not blank, while the set exchange is left blank

發布通知

Added a new selectable rule for starting a deal -> SNV
SNV in this case stands for "Stochastic and Volatility": If the stochastic on the selected timeframe is above a threshold, and the current volatility has a high percentile compared to earlier readings, begin a deal.

Added a selectable mintick, allowing the the rounding of order price values to a custom number, fex if the exchange has orders with a price difference of 0.5.
Fixed a bug with Deal Start Condition 2 where it might enter a deal even if no condition was selected.
The information box will now display an error if the timeframe selected on any Deal Start Condition 2 is below current chart timeframe.

發布通知

Updated to always use historical data on the selected timeframes

發布通知

Fixed using wrong treshold for RSI on deal2

發布通知

Added Moving Average as a selectable rule. Entries can be filtered to begin a deal if the price is either above or below the MA on the selected timeframe.
評論
kkhaial
And another tip for your proftview syntax which helped me out a lot :)
kkhaial
Hello friend, i was wondering if you are planning on adding more filters like an ema filter etc ? Here is a Cheer to show my appreciation
treigen
@kkhaial, thanks. i suppose i can as long as the rule is simple, the script has gotten rather big and slow unfortunately. what requirements did you have in mind for this filter?
kkhaial
@treigen, The rule is pretty simple if price is above the EMA's to go long, not sure how hard it will be to add multiple EMA's and if you think that it will not help or pointless that is also fine :)
treigen
@kkhaial, you can now use a moving average as a rule
gleefulJaguar47150
Great bot. Is it possible to get an external indicator setting so you can select a different open indicator on the chart as a deal start condition?
gleefulJaguar47150
Nice. The only one really missing is the Ultimate Oscillator
DenPody
What is maximum drowdown on 1m timeframe and maximum time for trade close? Thank you
treigen
@DenPody, there are no limits in the script for these parameters. If you want to add it, feel free to use the available code here.
DenPody
@treigen, Yes, i mean what was the maxiumum drowdown according to previous trades. I just cant look further than 10k bars, so can see maximum like 3 previous trades, so i thought maybe you can help me with that as you have premium subscription :)). Like just scroll list of trades in strategy tester on random coin 1min timeframe. Please matee. Thinking if i can use laverage or nah.
更多