HullBuster Backtest V3 User Manual
Welcome to Hullbuster on Tradingview. This version of Hullbuster is written in Tradingview’s proprietary Pine language utilizing the version 3 syntax. Although Pine provides the ability to create an all remote trading system it does come with various built in limitations. One of which is the number of variables the script author is permitted in the design of the Pine strategy. Hullbuster is a port from a Ninja Trader strategy which is approximately 30,000 lines of C# code. Though much effort was made in the streamlining of the port, the sheer size of the strategy forces the functionality of the Pine version to exist in separate scripts. In order to achieve the most profitable configuration, a specific procedure should be followed. This procedure will be applied to each symbol for which you want to receive Hullbuster alerts.
Hullbuster consists of three scripts: Scope, Backtest and Signal. The scope is used to determine the magnitude and intensity of historical peaks and valleys. Information obtained from the scope script will be input to the backtest script. The backtest is a key component in the Hullbuster system and most of the time devoted to the trading configuration will be spent working with the backtest tool. The signal script accepts the entirety of the backtest configuration. This script and its associated inputs will be called by the Tradingview servers to determine when to fire alerts.
The Hullbuster strategy utilizes three different bar intervals: the week, day and 4 hour (chart period). Due to another Pine language limitation, the number of security function calls are restricted. This limitation manifests itself in the existence of two separate Hullbuster backtest tools. The backtest SI product is designed to perform better at small intervals (SI). The standard Hullbuster is intended for 4 hour or 1 hour bar intervals. However, the choice of which to use is ultimately determined by the backtest results and the trader’s objectives. Both Hullbuster’s are designed to perform at any bar interval between 4 hours and ten minutes. That is to say that intervals above 4 hours or below ten minutes are not supported.
The Hullbuster strategy employs several key concepts which we believe are unique in the technical analysis and algorithmic trading domain. One of which is the importance of knowing which side of the “mountain” the script is on. In the long direction the left side is tradeable and the right side is to be avoided. This fosters better cooperation between long and short bidirectional trading. When trading the Hullbuster BMW program, which is a long strategy, long periods of inactivity on declining prices can be seen on the backtest. This is by design as the likelihood of hitting stops is increased. Additionally, long trading on declining prices can interfere with short trades. In countries which adhere to the NFA rules a sell short which trades against a long will cause a reversal as simultaneous bidirectional positions are not allowed (illegal). Another distinctive feature of Hullbuster is the minimum profit which the program will accept. The minimum profit value which the user specifies in the input dialog is not s hard number. The Hullbuster script closes each profitable position based on a conditional exit. Generally speaking, if the trade looks like it could continue in the black it will hold the position beyond the minimum profit price. Conversely, if the trend reverses before the exit condition is met the trade will exit at the specified stop price which of course is a loss. There are many more useful and potentially profitable features which we hope uniquely identify the Hullbuster trading system. All of which will be described in further detail later in this document.
Hullbuster employs 10 indicators on three time frames (week, day, 4 hour). Combined the system establishes probability axioms which evaluate entry and exit conditions. Each backtest script provides the user a selection of setups which can be combined to tailor the behavior of the trading system. The axioms function as filters to the setups in that they allow only certain signals to trigger a buy or sell order based on how the user configured each axiom. The axiom fields are detailed later in this document. Remember that the backtest evaluates historical prices from Tradingview. As such buy or sells in the script simply call the Tradingview broker simulator so that the script's performance report can be generated. No actual orders are produced on any symbol ever. This behavior differs greatly from other platforms in which a transition to live trading occurs at the end of the backtest. Tradingview does not support this feature. The Pine language strategy is a backtest only and the Pine study is a dedicated signal generator. Hullbuster provides both the backtest and signal scripts. Trading direction is also separated into two or more scripts. Hullbuster BMW is a long only script. The acronym stands for Below the Middle Weakness. This implies that Hullbuster BMW is fundamentally a dip buying strategy which excels at range trading and dip sporting trends.
Backtest Configuration Procedure
Determining the settings for the most profitable configuration is where the user will spend most of the time in the Hullbuster experience. The settings are simply the inputs to the script as displayed on the Tradingview input dialog. These fields essentially comprise a list of numerical values which adapt the system to the general price fluctuations of the target symbol. These values are such that a minor change can significantly alter the profitability of the script. That being the case a certain amount of effort should be dedicated to this procedure if you wish to achieve the best trading result. How much time? A single pass configuration can be accomplished within a few hours. However, multiple passes and fine tuning may require days. It really depends on the "tradeablility" of the symbol by Hullbuster and the goals of the user. Broadly speaking, it should be mentioned that there a few prerequisites before you begin. You should know what symbol you want to trade as each configuration is really only applicable to that symbol. Also you should know what interval you wish to trade. Larger time frames yield more profit but trade less often. Finally, since Hullbuster internally uses three time frames (week, day, 4 hour) the symbol must have sufficient historical data. Crypto currencies fresh out of ICO will not work. Similarly, newly listed stocks should be avoided. What follows below are the steps to complete a first pass configuration. This is merely a guideline as there are many ways to get a symbol up and running. As you become familiar with the backtest tool you will likely come up with shortcuts of your own. Once the backtest is complete create a named template on the Tradingview chart to remember your hard won configuration.
Press the strategy settings icon to bring up the input dialog box. Click on the Properties tab and input the "Initial Capital", "Base Currency" and "Order Size". It is important to understand that HullBuster will not function correctly with any kind of currency conversion so the "Base Currency" must match the price scale of the chart (far right side scale). Of course what ever currency is selected will be that value in the performance report. Therefore, selecting JPY will result in a performance report that is computed in Japanese Yen which will be noted with the Yen symbol along side the profit value. If there is no matching base currency from the drop down field then simply choose "Default". Crypto currency prices which are denominated in BTC or any currency which does not have a whole number on the left side of the decimal point will need have the order size increased so as to produce whole number calculations. For example: Stellar Lumens (XLM/BTC) should have a "Default" base currency and a 10,000,000 (ten million) order size with "Contracts" selected to the right of the field. For the FOREX market you should think in terms of lots. An order size of 1000 represents a micro lot (0.01 of a full lot).
Click on the Inputs tab to bring up all of the settings which are specific to the HullBuster strategy. You will be working with these fields to complete the configuration. Without a doubt this is an exhaustive process which will truthfully require several hours to complete. However, your efforts will be rewarded by a better backtest result and ultimately a more profitable trading system. Please be sure to set enough time aside for this task. If you are unable to complete the process in a single session you can save your progress as a chart template and complete it incrementally. Tradingview is a relatively new company with a very bright future and we believe (hope) that someday an API will be developed which will allows us to automate this entire process at the touch of a button. In the mean time, we will have to rough it out for a while. You can also request settings from HullBuster.com for popular instrument types.
Set the instrument type. This is a critical step. HullBuster scales it's algorithms based on the number of bars available per session. For example: stocks trade 7 hours a days while currencies trade 24 hours a day. Select the instrument from the drop down edit control. There are currently three choices (Stock, Crypto and Forex).
Set the start date of the backtest to include all of the chart data provided by Tradingview. Alternatively, you can set the date to avoid an old stock split or initial period of bad tick data. To conserve inputs only the start year can be designated. The backtest will begin on the first day of that calendar year or the beginning of the data set whichever is more recent.
Set the minimum profit and stop limit. Both values are expressed as the base currency of the symbol. In other words chart prices. For example: a stop for a crypto currency symbol, denominated in BTC, will have many zeros on the right side of the decimal point. While BTC itself, denominated in dollars, will likely have a relatively large whole number as the stop price. It is important to remember that HullBuster uses a conditional exit for in the money trades but the stop is a hard number. Therefore, the best trading result will be achieved when the profit target is less than the stop limit. A ratio of 2:1 where the stop is double the profit is a general guideline to use. During the configuration process you will be establishing the length of time to stay in the trade which will more than likely exit in the money trades at prices which exceed the minimum profit. However, this is only a guideline. Feel free to experiment with the minimum profit and stop limit after you have achieved the initial configuration. Of all of the configuration parameters the minimum profit and stop are probably the most important value to "get right'. Spend time studying the chart to determine the average daily swing and base your minimum profit around that. If your configuration is not profitable after this procedure then it is likely that the minimum profit and stop are not aligned with the circumstantial price movements of the symbol you are trading.
Set the "Nonlinear Exit Delta" and "Nonlinear Exit ROC" fields to 1000.
Set the "Overbought Threshold" and "Shallow Dip After Rise" fields to 1000.
Input the values obtained from the HullBuster scope. These fields have identical names between all three scripts; scope, backtest and signal. If you have not performed the scope analysis please take the time to do so now. The scope is used to identify patterns which detect peaks and valleys. HullBuster will use the values from the scope analysis to recognize volatility during the backtest and into the future (forward test).
Replace all of the default values in section 3 to the value of 1000. Specifically, set the following fields to 1000:
Event Entry Delta Bias
Event Entry ROC Bias
Axiom 01 Delta Bias
Axiom 01 ROC Bias
Axiom 02 Delta Bias
Axiom 02 ROC Bias
Decay Delta Bias
Decay ROC Bias
Axiom Scalar 01 Bias
Axiom Scalar 02 Bias
Replace all of the default values in section 4 to the value of 1000. Specifically, set the following fields to 1000:
Override Delta Bias
Override ROC Bias
Trend Axiom Delta
Trend Axiom ROC
Weak Axiom Delta
Weak Axiom ROC
Weak Decay Delta
Weak Decay ROC
Range Decay Delta
Range Decay ROC
Sheer Decay Delta
Sheer Decay ROC
Adjust the "Profit Bias" and "Range Exit Bias" fields. Set the "Range Exit" field to 1000 and start with the "Profit Bias" field. Experiment with numbers between 0.5 and 8.0. Note the number with the best overall result seen on the performance report. Leave the "Profit Bias" field set at the best value obtained. Then adjust the "Range Exit Bias" using the same method as the "Profit Bias" field. When finished do a little fine tuning to balance out both fields. It is usually unnecessary to adjust the "Decay Exit Bias" field as the default value is correct for most symbols.
Turn off "Pursue Trend" and "Intraday Ranges". Uncheck all the other boxes in this section. These fields are found below the "Shallow Dip Scalar" field in the first section of the input dialog. Ensure that all of the setups are turned on (checked). The setups are named Detect Pattern 01 - 10 and are found in the fifth section of the input dialog box.
Make final adjustments to the "Minimum Profit" and "Stop Offset" field. These two fields are critical to the success of the backtest. Remember that the stop offset value should be larger than the minimum profit since HullBuster uses a conditional exit for in the money trades.
Turn On all of the separators (checked). The HullBuster input dialog box contains four check box delimiters which identify each section. Ensure that each section is checked. This will disable the trade management system which will permit each setup to be freely configured. The requirement to check all delimiters is a failsafe device. It is very dangerous to disable the trade management system under live trading conditions so as a precaution multiple checks are enacted.
Configure each setup one at a time. Uncheck every setup except the first one. The setups are named Detect Pattern 01 - 12. The values associated with each setup are named Strategy. Each setup may have multiple configuration values. For example: Detect pattern 01 has one configuration parameter named Strategy01 Scalar Bias. On the other hand, Detect Pattern 02 has three parameters named Strategy02 Scalar Bias, Strategy02 Delta Bias and Strategy02 ROC Bias. Our job in this step is determine the values that enable the setup to detect the best entry condition. If you are making a range trading system then you will want to catch the lowest valley price. Trend following systems may want to enter a trade solely on rising prices. To do this we will need to examine both the performance report and the chart. This step will certainly require some finesse since you will need to strike a balance between profitability, win percentage and total trades. Don't push the win percentage to a high value at the expense of total trades because you need trades to make money. Ultimately, the axioms determine when a setup becomes a trade so we just want to improve the accuracy of each individual setup. Remember the number of each strategy field corresponds to the setup of the same number. Each strategy field has a particular nomenclature pertinent to its design. Field types can be a combination of scalar, vector, delta and ROC. In many cases the default value will be good enough but the best performance will come from experimentation. Start with the delta and then the ROC. Do the scalars and vectors last. Try swapping values between fields if you hit an impasse. Every field accepts a real number between 0.1 and 100. Although, most values will be in the range of 0.5 and 8.0. Smaller time frames will require larger values perhaps as high as 100 for the 10 minute interval. A detailed list of fields and acceptable values can be found at the end of this document.
Turn on all of the setups (checked). Every setup should be configured to the newly discovered values from step 15. Don't be concerned with the performance report since we have yet to configure the axioms which make a tremendous difference in profitability.
Turn Off all of the separators (unchecked). We checked all of the separators in step 14 and now we need to turn them off again. This will reenable the trade management system. Other than configuring the trade setups, there should never be a reason to disable this system.
Bring up the Tradingview performance report and write down the values for profit/loss, total trades and win percent. These numbers are your baseline values for the remainder of configuration. The report should show very few trades and may have negative profit. At this point the HullBuster strategy is in an overcorrected state. The remainder of the configuration procedure will focus on aligning the strategy's probability algorithms with natural price fluctuations of the symbol.
Configure the axiom values in section 3. There are six different axioms in the third section of the input dialog. Four pairs of delta / ROC and two separate scalars. All of the fields should still be set to 1000 from step 9. Configure all of the delta pairs first and save the scalars for last. Set the ROC to 0.1 and experiment with a range of values for the delta. Then increase the ROC value. Use the performance report in combination with the chart to measure the success of each setting. Pay more attention to the chart in this step. It's the optimal entry condition that you are really trying to setup. These axioms are really the bread and butter of the configuration. They will determine when it's a good bet to intercept falling prices and when it's best to avoid them. After you have configured the first pair write down the value and reset the field to 1000. Then move to the next delta / ROC pair and do the same. Remember to keep all axiom field values set to 1000 except the one you are working on. The "Axiom Scalar 01" is next after the delta pairs. Then the "Axiom Scalar 02" field.
Configure the axiom values in section 4. There are six different axioms in the fourth section of the input dialog. Five delta / ROC pairs. All of the fields should still be set to 1000 from step 10. Perform this step exactly the same way as in step 19. Typically, the fields in the fourth section of the dialog are always set to 1000 since the axioms in the previous section do most of the work. However, these axioms may be beneficial when applied to a low volume symbol which experiences long periods of gradually falling prices (crypto). Configure each pair one at a time and remember to reset the field to 1000 after you have noted (written down) the value.
Set all of axiom fields to the newly discovered values. Now do a little fine tuning and try to balance out the axioms. Some fields will need to be increased while others reduced once they are all activated and working together. The axioms must be adapted to the inherent price fluctuations of the underlying symbol. In this way live trades in the future can more closely match the performance of historical trades in the backtest. Generally speaking, each axiom set should improve the profitability of the performance report. If removing the 1000 cutoff value reduces the profit then the field should remain at 1000. That is to say, do not apply fields that reduce the performance of the trading system. Leave them in a cutoff state.
Examine the report. Your performance report should be at a profit at this point. If it is not then something is certainly wrong. It could be one or more of the following problems:
1. A step was missed.
2. The minimum profit and stop are too tight or too wide.
3. The minimum profit value exceeds the stop value.
4. The symbol exhibits mostly falling prices and HullBuster BMW is a long strategy.
5. The historical data is too short or has gaps.
6. The scope values are incorrect (prerequisite to the backtest).
7. The chart interval may need to be changed.
8. It's mostly a ranging instrument and "Pursue Trend" is on leading to chopped out trades.
9. Tradingview' s servers are down or malfunctioning data feeds.
In this step we will return to the "Profit Bias" field in the top section of the input dialog. Make adjustments to the "Profit Bias" and "Range Exit Bias" fields to obtain the maximum profit without sacrificing win percentage. Generally speaking, if you reduced the "Profit Bias" value in Step 11 then you should increase the value now.
Configure the "Nonlinear Exit Delta" and "Nonlinear Exit ROC" fields. Both fields should still be set to 1000 from step 7. Begin by setting the "Nonlinear Exit ROC" field to 1.0 (one point zero) and set "Nonlinear Exit Delta" to 0.1 (zero point one). Experiment with incremental delta values up to 1.0 (one point zero). If no performance increase is found return both fields to the 1000 cutoff value.
The next step involves the "Reentry Minimum Span" and 'Reentry Window". These fields are located in the top section of the input dialog below the stop offset. These two fields are designed to prevent entering a trade immediately after hitting the stop. The Reentry Minimum Span establishes a threshold value that must be exceeded before a new trade can be initiated. The value for this field is specified as a chart price similar to the minimum profit and stop limit. The Reentry Window designates a time frame for which to apply the Minimum Span. An easy way to look at this is that minimum span is the distance from the last stopped out trade and the Reentry Window is the amount of time to keep looking at that stopped trade. The Reentry Window is specified as number of bars in the current chart interval. Use trial and error to determine the appropriate value of each field. A good way to do this is by finding places on the chart where consecutive losses on rapidly falling prices have occurred. Try removing some of the losses by adjusting both fields.
Adjust the "Stop Loss Duration" field. The value of this field represents the number of bars to acknowledge the most recent stopped out trade. The utility of this field is similar to the "Reentry Bar Window" but is intended to cover a longer period. You should specify a relatively long period spanning perhaps a trading session week or more. For stocks 40 to 80 bars is typical. For Forex 120 and Crypto 160 are typical field values. The value you use may be smaller or larger. The logic for this field is designed with anti-chart fitting technology so that values specified remain pertinent to forward testing.
Using the current result of the performance report as a base value gradually remove non-performing setups. Start with the best performing setup and build up from there. Watch the performance report. If a setup detracts from the profitability and win percentage then uncheck it. At this point it's better to measure the success of a setup in terms of win percentage rather than profitability. This is because simulated profits may be the result of luck in how the historical prices have played out. But a higher win percentage exhibiting quality entry points could be indicative of a superior pattern recognition system. This would suggests that the entry formations intercepted during the backtest may be repeated in live trading and that is the whole purpose of backtesting. If a setup has no effect on the performance you may leave it on since you configured it well in Step 15 and its pattern could surface in isolation in the future. It's unusual for all setups to be active in a configuration. There are usually some that are invariably ineffective on the current symbol. So that's ok.
Establish another performance baseline. Bring up the Tradingview performance report and write down the values for profit/loss, total trades and win percent. These numbers exhibit the performance of your newly configured setups, axioms and reentry span. Your configuration is nearly complete. The current performance report shows the bulk of the backtest profit. The remainder of the configuration procedure consists of minor adjustments which may still have a profound effect on the overall backtest performance.
Turn on "Pursue Trend" and see if it improves the performance. Leave it off if it does.
Turn on "Chase Overvalued Trades" and see if it improves the performance. Leave it off if it does.
Turn on "Retrograde Exit" and see if it improves the performance. Leave it off if it does.
Turn on "Small Profit Exit" and see if it improves the performance. Leave it off if it does.
Turn on "Caution Mode" and see if it improves the performance. Leave it off if it does.
Turn on "Small Interval Decay" and see if it improves the performance. Leave it off if it does.
Turn on "Intraday Ranges" and see if it improves the performance. Leave it off if it does.
Turn on "Peg Oscillator" and see if it improves the performance. Leave it off if it does.
Turn on "Overbought Filter" and see if it improves the performance. Leave it off if it does.
Turn on "Exuberance Filter" and see if it improves the performance. Leave it off if it does.
Turn on "Overzealous Filter" and see if it improves the performance. Leave it off if it does.
Turn on "Disable Event Timer" and see if it improves the performance. Leave it off if it does.
Turn on "Disable Level 1 Safeguards" and see if it improves the performance. Normally, this feature should remain unchecked since it is am important component of the trade safety system. However, smaller interval trading may be severely impeded by this level of protection so it may be necessary to disable (checked) this safeguard. If it is only making a minor difference it may be better in the long run to leave it unchecked.
Turn on "Disable Level 2 Safeguards" and see if it improves the performance. Normally, this feature should remain unchecked since it is am important component of the trade safety system. However, smaller interval trading may be severely impeded by this level of protection so it may be necessary to disable (checked) this safeguard. If it is only making a minor difference it may be better in the long run to leave it unchecked.
Move to the "Overbought Threshold" field. It should still be set to 1000. Put in the number 10 and gradually increase the value in increments of 10. At each increment see if the performance has improved. If it has stop at the last value which showed the best performance. This value typically does not exceed 100 but could go as high as 300 or so. If no change in performance is seen simply leave the field set at 1000.
Set the "Shallow Dip After Rise" field to 10. It should still be set to 1000. Also set the "Shallow Dip Scalar" field to 0.1 (zero point one). The performance should immediately drop. Gradually raise the value of the scalar field until the performance is improved then increase the "Shallow Dip After Rise" field in increments of 10. At each increment see if the performance has improved. If it has stop at the last value which showed the best performance. These fields have been left for last because they basically circumvent much of the other operations of the strategy. In most cases the "Shallow Dip After Rise" field will be set to 1000. However, it may provide some benefit in corner case symbols (read Crypto).
Perform fine tuning. Go back to the setups and make minor adjustments to the strategy fields. Double check setups that have been excluded. See if they can be made to contribute to the system. Revisit the axiom fields. See if minor adjustments to the "Decay Delta" or "Axiom Scalar 01" improve the gain or win percentage. Retry fields that were previously set to 1000 but avoid setting field values too low simply to gain a trade or two. Be careful not to degrade the system performance in the fine tuning stage. Check the chart frequently to verify that the quality of the entry condition has not been reduced.
Visually scan the chart in detail and look for dead spots or periods of consecutive losses. Make adjustments to the system that alleviate issues found on the chart. Dead spots are usually caused by missing setups or large decay values. Try "Disable Event Timer", "Disable Level 1 Safeguards", "Disable Level 2 Safeguards" and see if the dead spot receives trades. Consecutive losses on rapidly falling prices can be addressed with the "Reentry Minimum Span", "Reentry Bar Window", and "Stop Loss Duration" fields.
That's it you're done! Your final configuration is a masterpiece of algorithmic structure. All of the configuration input values can now be transferred to the HullBusterSignalSI script. This script is written as a Tradingview study which exposes 3 different trading alerts (Open, Close and Stop). The alerts can be enabled by applying HullBusterSignalSI to the same chart interval and symbol for which the backtest was performed. The HullBusterSignalSI script contains identical logic to the backtest and is designed to reduce indicator repainting. Therefore, signals received should closely match trades produced by the backtest script. For more information about the HullBusterSignalSI please go here. Good luck and happy trading!