TheTradingParrot

TTP Gavin's DCA Backtest PRO

TheTradingParrot ที่อัปเดต:   
Purpose:
The DCA Backtest script was designed to backtest the performance of any indicator using DCA bots.

"Open Deal ASAP" Deal Start Condition:
This script offers "open deal ASAP" deal start condition which will continuously open new deals. IT will wait for the current deal to close before opening a new one.

"Script" Deal Start Condition:
If you select the "Script" deal start condition we provide Bollinger Bands as an example. You can tweak the BB parameters from the indicator settings menu.

"Indicator" Deal Start Condition:
The third option is "Indicator". For this option to work out you must have an indicator that plots a "unique value" that can be recognised as a BUY signal.
We recommend that your indicator plots 1 when it should buy and 0 when there's no signal.
Once you have in the same chart your indicator and your DCA backtest it's time to hook them up. For that follow these steps:
1) select "Indicator" as deal start condition
2) select your indicator from the list as "deal start source"
3) If you are following our recommendation then use 1 as "deal start value" so it can tell the DCA backtest when to open a deal. Make sure that your indicator only plots 0 or 1 so the DCA backtest can distinguish the BUY signal appropriately.


Limitations:
Each time you make changes and save your external indicator while you are backtesting, you will have to hook up the indicator again with the DCA backtest in the settings.
To avoid this, add as many parameters as you need to change in the external indicator so in that way you won't need to save changes to it and therefore will manage to avoid having to hook up the indicator with the DCA backtest.
เอกสารเผยแพร่:
- fixed a problem that wasn't allowing to select the source of the indicator to use
- all parameters are now grouped by area in the settings window
- results now show max days in deal including if there's a on going open deal
เอกสารเผยแพร่:
Adding a version to the script short title.
เอกสารเผยแพร่:
- Show DCA cloud option added. This option allows to hide the DCA cloud in the chart.
เอกสารเผยแพร่:
- Max safety orders can now be set to zero
- 3C simulator: 3 BB and 3 RSI indicators added, multi-timeframe
- Adding tooltips to make settings more easy to understand
- Improved layout of settings
- Support for external indicator to close a deal by sending a separated value than the deal start value
เอกสารเผยแพร่:
- Solved bug: max volume was not allowing above 1M volume
- Solved bug: dealstop condition was mistakenly applying in "3c simulation" mode
เอกสารเผยแพร่:
- Fixed issue with max days in deal when using buy close ext indicator conditions. It was over calculating the days in trade.
- Added QFL to 3C simulator
- Added CCI to 3C simulator
- Added MFI to 3C simulator
- Added ULT to 3C simulator
- Performance improvement. Indicators are now only calculated when they are active.
- Settings layout improvements
- Settings extra tooltips added to help with usability
เอกสารเผยแพร่:
- Fixes issue with covered deviation calculated wrong when max SO number was set to 0
- Fixes issue with DCA cloud chart still showing an SO when max SO number was set to 0
เอกสารเผยแพร่:
- fixing issues with high number of SOs
- removing NaN errors appearing in the results table when there are no deals
เอกสารเผยแพร่:
- new implementation of take profit.
- results table shows number of deals closed and drawdown
เอกสารเผยแพร่:
- TP fix
เอกสารเผยแพร่:
- Version 0.5 adds support for SHORT deal start conditions for the 3C simulator mode.
- All strats now support bearish entries: CCI, MFI, RSI, BB, QFL
- TP % can now be set as low as 0.01
- Solved some issues with calculations of drawdowns for max drawdown and for a current open deal drawdown.
- QFL strategy includes a toggle to require the lower base to be below the upper base to be able to trigger a signal
เอกสารเผยแพร่:
- Resolves issue of required funds not calculated properly. TV changed a method today which broke our script. Thanks to Gavin for finding a fix to this issue so quick! it took us a few minutes but it was crazy!
- Resolves an issue caused.by having too many SOs

The changes TV made might cause further issues. We reported the issue to TV and waiting for their feedback as well.
เอกสารเผยแพร่:
- added new stop loss percentage parameter to DCA settings
เอกสารเผยแพร่:
- Added TradingView Technical Indicator deal start conditions. 3 timeframes
- Ultimate oscillator bug fix: first two were not working properly
เอกสารเผยแพร่:
QFL deal start condition now allows multiple consecutive deals. Before, if there were 20 candles signalling BUY, only the first would trigger a buy, now all of them would.
เอกสารเผยแพร่:
There was a problem that even while using "open deal ASAP" the backtest wasn't opening an deal right after closing the previous deal. There was a single candle that the strategy was idle. This change seems to resolve it. I will keep an eye in case the fix had any side effect, in which case I might have to revert it and find an alternative solution.
เอกสารเผยแพร่:
Solves an issue when the DCA was buying at negative prices even when the SOs max deviation shouldn't hit negative prices.
I tested this solution on IFTRSI external indicator and managed to stop getting the error, if the same error occurs please report it on our discord server DCA-backtest channel.
เอกสารเผยแพร่:
1) We created a new deal start type: External signal + 3C simulator combined.

This should be quite useful as 3C actually DOES support mixing their built-in indicators with an API signal, which is exactly what this mode represents.

The DCA bot will only open the trade if there's a BUG signal and all the 3C simulator conditions enabled are valid at the same time.

An example of a cool use could be to only take BUYs from the external signal when TV is BUY on the daily and hourly and RSI daily is below 80.

If you enable this mode you have to connect a backtestable compatible signal (for example one that only prints ones and twos, for buys and sells) and you MUST enable at least one of the 3C simulator deal start conditions. If you don't enable any, the simulator won't open any deal. Remember this behaves as an AND operator, all enabled conditions + the BUY signal itself must be true to open a deal.

The intention is to mimic how exactly how 3C behaves when using this approach.

2) Now the results table renders in green when there's a deal open in profit. If the deal is open and it's at a loss it still renders it in red.
เอกสารเผยแพร่:
open trades appear in green when there's an open deal in profit
เอกสารเผยแพร่:
I think it's time to give some love to the stop loss:
- Now the backtests calculates the SL% relative to the base order just like 3C does. Before we were using relative to the average position price.
- If you use SL we plot the SL level in grey. Before it was not possible to know where is the SL located in the chart.
เอกสารเผยแพร่:
layout and label improvements
เอกสารเผยแพร่:
- fixing issues calculating profits affecting short bots
เอกสารเผยแพร่:
- Support for Pine Script 5
- More accurate deal start conditions for MFI, CCI and BB
เอกสารเผยแพร่:
- added Bollinger bands % indicator
เอกสารเผยแพร่:
- Improved performance, reduce unnecessary use of security function
- Added support for RSI14, MACD, PSAR
เอกสารเผยแพร่:
New deal start conditions supported:
- SMA
- Heikin Ashi
เอกสารเผยแพร่:
- added support for cooldown (using candle bars count)
เอกสารเผยแพร่:
Added total deal count to show even if deal is open.

Two issues resolved:
1) Total days in results table shows duration from Start Date until Current Time. If End Date is set on a historic date it doesn't reflect in Total days.
2) When current deal is in profit but not closed = show green background in table.
เอกสารเผยแพร่:
Solves issue causing wrong "days in deal" calculation when the selected date was in the future.
เอกสารเผยแพร่:
- Support for max and min price: it will skip a deal if the price is not above the specified min or below the max). The value zero disables min/max.
- Support for timeout. After the specified timeout in bars the deal will close. Use zero to disable this option.
- Fixed issue where summary was shown in red in the results even though it did close all deals in profit.
เอกสารเผยแพร่:
- Volume filter accuracy improved: has been re engineered to match better the one used by 3commas
- Timeout bug: solve issue with the timeout settings that was counting from each individual DSC event rather than from the time the deal actually opens.
เอกสารเผยแพร่:
What's been done:
fee's added as a DCA setting (DCA calculation bug, should be synced with commission)
added Plot deal stop condition

Updated results table:
Title row: Updated name + color to top row and moved token to right, more compact
Left column: aligned text right, renamed names
Rearranged order of info to make more sense (to me at least...)
Max SO count fixed for edge case (display only)
condensed large values: if > 0 skip decimals, if < 0 use decimals
Moved deals completed to new row (from Status)
Combined related values into 1 row instead of 2
If short mode: shows Initial USD required to run (otherwise hidden)
If no deal yet: show "no deals yet" in status row instead of "all deals closed (0)"
if no deal yet: show "-" on relevant values instead of "0"
if no deal yet: background color grey instead of red
เอกสารเผยแพร่:
fix for broken min, max price limits and cooldown.
เอกสารเผยแพร่:
Added new RSI deal start condition parameters supported by 3C
เอกสารเผยแพร่:
Fixed issue with Heikin ashi candles deal start conditions
เอกสารเผยแพร่:
- improved BB and BB% accuracy
เอกสารเผยแพร่:
Fixed issue of label in the results table that was showing the profits in BASE currency when they were actually in QUOTE (it was saying 200 BTC profits, where it was meant to be 200 USDT). This wrong label only affected shorts.
Shorts and long profits are currently calculated in QUOTE currency.
เอกสารเผยแพร่:
This release improves the accuracy of all deal start conditions.
เอกสารเผยแพร่:
APR calculation added next to daily % profits
เอกสารเผยแพร่:
Aster has been working on some cool new features for Gavins backtester. Check them out!
  • added SMA 50 crossing 200
  • minor text changes in settings
  • disabled legacy table
  • moved visual settings to bottom
  • added new Bar Magnifier ON as default
  • updated Stop Loss to be instant (don't wait for bar close confirmation)
  • added Stop Loss Timeout
  • added table position selector
เอกสารเผยแพร่:
Added support for Trailing Take Profit %
Both for long and short strategies.
Use TTP = 0 to disable it
Avoid values above the TP% to keep results reasonable, ideally TTP% <= 10% TP
เอกสารเผยแพร่:
Updated text to be more clear about the required capital and bought contracts. When shorting it now says Contracts.
Added stop loss counter
Bar magnifier set to OFF by default
เอกสารเผยแพร่:
Added a warning and error system.
Added BO below mintick protection.
Added suggestion of BO volume if it's set too low.
Added warning if DSC timeframe is below charts.
Fixed Volume in BTC integer/float issue.
Fixed BTC pairs in Volume in BTC.
Changed Min/Max price to float instead of int.
เอกสารเผยแพร่:
Introducing ORC backtesting: backtest the protection that ST, STHA2H, STDXY, STT3 can offer to your bot setups.
Right below the section of DCA settings you will find the ORC settings.
You can select the ORC signal you want to use and whether you want to trade during an uptrend or downtrend.
Please notice we will only support orchestrator signals that toggle between states: buy/sell.

We have removed support for 3 separated ULT deal start conditions to stay below the maximum number of securities TradingView allows us to use.
เอกสารเผยแพร่:
Updated Volume in BTC
Updated Warnings & Error messages
Fixed SO counting for TTP%, SL Timeout & Timeout
Fixed SL Timeout bug
เอกสารเผยแพร่:
Fixed problem with wrong stats for shorts
Leverage now also changes value in profits in USDT
เอกสารเผยแพร่:
Fix: Timeout for external signal now works as expected
เอกสารเผยแพร่:
DCA backtest PRO version is here.
We will add all the PRO features to this version.
Introducing stats! see how the deal duration distributes in percentiles to understand when it's best to place your timeout settings.
เอกสารเผยแพร่:
Cooldown now counts from deal close
SL Counter edge case bug fixed
TTP% in Bot Settings-table now shows correct number
Average duration now counts currently open deal for both Bars in deal and Days in deal
Added chart timeframe in table
เอกสารเผยแพร่:
VIP members now get support for Orchestrator action "close deals at market price".
This means that now you can decide instead of simulating to only stop the bot to also simulate closing the deal.
เอกสารเผยแพร่:
Two new upcoming ORC signals added to Gavin's backtester.
Stay tuned for details on how to use them!
เอกสารเผยแพร่:
- Increased accuracy of drawdown in results table
- We renamed "max drop" to "max deal drawdown" to better represent the actual value shown
- VIP new feature: Run Up and Drawdown statistics (find it in VIP statistics, at the bottom of the settings form)

Run up and Drawdown can help you see how high or how low an asset can go during the backtest period so you can decide better the best placing of safety orders, stop losses and/or take profits.
Run first the strategy relaxing the SL and TP levels to allow the asset to move freely, then observer the stats and adjust them later accordingly based on their distribution across the percentiles.
เอกสารเผยแพร่:
Support for use of external signal as an ORC.

Instructions:
- add a signal that can be used as ORC. This must print one value for START and one for STOP bot.
- external source select the signal you want to use as an ORC
- select which value you want to use for START bot
- select which value you want to use for STOP bot (or close deals at market price for VIP version)

Example code of an external ORC signal

The ORC script below will only start the bot when RSI is above 50.
```
//@version=5
indicator("RSI ORC", overlay=false)
rsi = ta.rsi(close, 14)
plot(rsi > 50 ? 3 :4, "RSI ORC")
```
เอกสารเผยแพร่:
- Volume in BTC fix
- Updates the end date to be 2024

Join our membership to gain access to the private scripts.
www.thetradingparrot.com
สคริปต์เฉพาะผู้ได้รับเชิญเท่านั้น

การเข้าถึงสคริปต์นี้จำกัดเฉพาะผู้ใช้ที่ได้รับอนุญาตจากผู้เขียน และมักจะต้องชำระเงินก่อน คุณสามารถเพิ่มลงในรายการโปรดของคุณได้ แต่คุณจะสามารถใช้งานได้หลังจากขออนุญาตและขอรับจากผู้เขียนเท่านั้น ติดต่อ TheTradingParrot สำหรับข้อมูลเพิ่มเติม หรือทำตามคำแนะนำของผู้เขียนด้านล่าง

โปรดทราบว่านี่เป็นสคริปต์ส่วนตัวที่ได้รับเชิญเท่านั้นซึ่งไม่ได้รับการวิเคราะห์โดยผู้ดูแลสคริปต์ การปฏิบัติตามกฎระเบียบการใช้งานของเราไม่ได้กำหนดไว้ TradingView ไม่แนะนำให้ชำระเงินสำหรับการซื้อสคริปต์และไม่แนะนำให้ใช้งานสคริปต์นั้นๆ จนกว่าคุณจะไว้วางใจผู้เขียนสคริปต์ 100% และจนเข้าใจว่าสคริปต์ทำงานอย่างไร ในหกรณีอื่นๆ คุณสามารถหาทางเลือกโอเพนซอร์สที่ดีได้ฟรีในไลบรารีสาธารณะของเรา

คำจำกัดสิทธิ์ความรับผิดชอบ

ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมที่ เงื่อนไขการใช้บริการ

คำแนะนำของผู้เขียน

Become a VIP member of TTP to access this script: www.thetradingparrot.com/tiers

ต้องการที่จะใช้สคริปต์นี้บนชาร์ตใช่ไหม?

คำเตือน: กรุณาอ่าน ก่อนร้อขอการเข้าถึง