Update - Build 490
This build is intended to reduce the script compile time and thereby prevent timeout errors when applied to the chart. To accomplish this goal the script code was heavily refactored and some lessor used features were removed. Specifically, the following features are removed from this build:
– Flip Flop Trading Mode
– Minimize Trade duration
– Volume Indicator
– Macro Indicator
– Report Debt Reset
As much as possible I tried to keep core functionality relevant to trend trading. Ideally, you can still use this tool to experiment with different trend following configurations. The backtest can be setup to use Pyramids, DCA and variable leverage ratios to provide you with an overall picture of what to expect from your selected input parameters. I decided to keep the Sharpe Ratio and Rate of Return reports since those features are an important metric to fund managers and portfolio investors.
This script contains approximately 1800 lines of Pine 4 code which consists mostly of math calculations with very little plotting. Even with the feature purge and streamlining of the code the script still requires 1.5 minutes (1 minute and 30 seconds) to initially load on the chart. TradingView does an excellent job of caching compiled Pine scripts so you will typically only incur the full compile the first time it is applied to the chart. Please wait for the hovering dots to disappear before clicking on the setting dialog icon.
On the BTC/USD backtest showing here I used 1 Bitcoin, a minimum profit of 500 dollars, a stop of 500 dollars, a limit offset of 50 dollars, the fractal indicator and a 5 pyramid max value. DCA is off. Also Mark Pyramid Levels (blue triangles) are enabled along with a 720 ROR Sample Period (red labels). The buying power reflects a leverage ratio of 2:1 (Performance Bond Leverage).