Skip to main content

Mastering Gunbot: The Backtesting Introduction

Important Notice

Due to an unexpected medical emergency with our backtesting add-on provider, we are currently unable to activate new users for this service. We apologize for any inconvenience. Please note, existing users with an activated backtesting script are not affected.

Add-On for Enhanced Strategy planning

Simulated Gunbot strategies

The Backtesting add-on for Gunbot offers a simulated environment within a TradingView account, using the Gunbot Deluxe Tuners BE indicator. It's a paid add-on that was included as part of Gunbot in the past.

Key Benefits

  • Accelerated Learning: Visualize Gunbot settings and strategies in action, speeding up the learning process.
  • Risk-Free Optimization: Fine-tune Gunbot settings in a simulation on TradingView, minimizing capital risk.
  • Strategic Alerts: Utilize TradingView add-on to execute trades based on alerts from tested strategies.
  • Comprehensive Tools: Requires a free or paid TradingView account for backtesting; a paid account for executing trades via alerts.

With the Gunbot TradingView add-on, manage your entire strategy on TradingView and let Gunbot execute trades based on email-received trade signals.

Accuracy and Limitations

Though we strive for precision, the TradingView simulations may not always perfectly align with Gunbot's real-time decisions due to TradingView's limitations. These simulations are as close as possible to Gunbot's actual performance, but past backtesting does not guarantee future profits. Note: Certain features like Emotionless and Double Up are not included in the TradingView simulations.

Getting Started

Once you have purchased and provided your TradingView profile name you will receive notification when your access has been granted and you may begin using in TradingView.

Login to your TradingView account and click the Chart button.

The scripts are best viewed in Dark theme.

Enter the Pair and the Period you wish to use and then click Indicators.

Do a search for "Tuners" and then click to load "Gunbot Deluxe Tuners BE" and "Gunbot Tuners Companion", you will only need these 2 for now. Later on you can return and load "Gunbot Deluxe Tuners BE [Alerts]" if you wish to send trade signals to Gunbot.

Now that you have the Tuner scripts loaded click the Strategy Tester to open it's pane.

Drag the top of the Strategy Tester pane to where you can see Net Profit and Buy & Hold Return.

Click the Gear icon to enter your Gunbot settings.

Enter your Exchange's TRADING_FEES in the [Properties] Tab and then the [Inputs] Tab.

Drag this window to where you can also see the Strategy Tester pane stats.

Now you are ready to begin adjusting settings in the [Inputs] window while watching Net Profit (red is loss) to see how this affects your returns. Once you have settings that you are satisfied with, record them to be entered into the real Gunbot when you are ready to begin trading that pair.

To see the "console" readings open the Data Window and hover mouse over a candle, this can be useful for troubleshooting and will also allow you to see the color coding of the plots (inactive are blue).

The "Gunbot Tuners Companion" script is used for visually tuning the indicators which cannot be shown on the main chart window. It has it's own Gear icon where you will change it's settings. Once you have visually satisfactory settings, enter those same settings into the "Gunbot Deluxe Tuners BE" script settings to see how they perform.

There are a few non-Gunbot variables that are also present in the scripts:

"BTC_PND Exchange = " should be set to the Exchange of the pair you are testing if you are using BTC_PND_PROTECTION.

PricesA / PricesB sets percentage range of candle prices that are read. You may also choose to use candle sources instead. Only this portion of the candle will register when crossing indicators or levels. There is a plot in gray on top of the candles that represents this area.

  |   High= 100
| |
| | PricesA = 0-100
| |
| | PricesB = 0-100
| |
| Low = 0

Default range settings of 50 / 50 is equal to source settings of HL2 / HL2 for Prices.

TradingView scripts trade on the OPEN price of the NEXT candle AFTER conditions have been met. The green "LONG!" or "CLOSE SHORT!" and red "SHORT!" or "CLOSE LONG!" indicate the candle where the decision to trade was made, the blue, red, and purple markers indicate where the trade was made.

When using the "Gunbot Deluxe Tuners BE [Alerts]" script the green "LONG!" or "CLOSE SHORT!" and red "SHORT!" or "CLOSE LONG!" indicate on screen where the alerts will trigger and send to Gunbot's TradingView add-on.


Why don't I see the fields for Double Up or Reversal Trading?

Because Double Up and Reversal Trading is not supported (as stated in Disclaimer above).

Why can't I change the PERIOD from Auto?

Because you don't need to, the script reads the PERIOD from whatever you set in the chart.

Currently there is not a way to export settings directly from Pine scripts to Gunbot. So once you find the best settings you have to copy and paste them one at a time into your config in Gunbot (or open GUI / config.js beside TV script settings so you can see them to enter).

What settings should I use in the Format: Properties Tab?

Do NOT change any of these settings EXCEPT for Commission.

Why am I not seeing any trades?

Because the pair is likely bagged up to the left of your screen. Temporarily lower the STOP_LIMIT to a small value like 5 or scroll left to see. Other reasons may be that you have levels too conservative for that pair so no trade is ever made. Temporarily lower BUY_LEVEL, LONG_LEVEL, and SHORT_LEVEL to 0.1 to see.

Why did it not trade where I think it should?

Please refer to the Data Window while hovering over the candle in question to troubleshoot and answer.

How far back can I test?

This depends on the PERIOD you have set, the lower the PERIOD, the less amount of time can be backtested. There is a 2000 order limit in Pine. Free TradingView accounts provide 5000 candles of history and paid accounts provide 10000.

Which browser should I use?

Chrome, Edge, Safari browsers seems to work the best with TradingView, Internet Explorer and FireFox do not work as well with TradingView.

Can I use Heikin Ashi or other types of candles?

No, the Tuner scripts only use regular style "Candles". Some of the other types will run and give results but they will not be accurate.

Why has my Tuner stopped working?

If you encounter strange behavior first try zooming in or out, or refreshing the browser. If this does not solve then delete the indicator, refresh the browser page, and reload the indicator.

That didn't fix it, now what?

If you continue to have issues: Format -> Inputs -> Defaults (lower left) -> Reset Settings then remove the indicator, refresh browser, and reload it.

For further assistance, contact @allanster on Telegram.