Username: Password:

Author Topic: Free TradingView Scripts for Backtesting and Tuning Strategies in Gunbot  (Read 159735 times)

Offline allanster

  • Contributor
  • **
  • Posts: 128
  • lux ex tenebris • deuro mea umbra absens
    • View Profile
Gunbot Free Tuners

I've created free tuners for BB, BB with RSI, BB/STEPGAIN, PINGPONG, STEPGAIN, and TSSL strategies on TradingView to help visualize and optimize these in Gunbot. TradingView plugin is NOT required and this works with free account on TradingView to help you learn, see, and optimize settings for the built in strategies used in Gunbot. Enjoy!

You will need to register for an account on TradingView (free) to use these, after creating your TradingView account:

• Please go here and click the upper right [Follow] button to receive notifications in TradingView whenever I do updates or release new scripts.

• Go to @allanster_bot on Telegram and click the [/get_free_tuners] button and enter your TradingView profile name when asked.

Please allow some time for me to approve, I am US Central Time. I will periodically check my Telegram bot for requests, and you will be notified once you have been granted access. After receiving access read below posts for instructs on how to use.

NOTICE: By requesting access to these Gunbot Tuner scripts you acknowledge that you have read and understood that this is for research purposes only and I am not responsible for any financial losses you may incur by using them!

Scroll down for how to use. If you wish to see example pictures below you must be signed in (free) to see them.
« Last Edit: April 19, 2024, 10:22:07 PM by allanster »
more human than human

Offline allanster

  • Contributor
  • **
  • Posts: 128
  • lux ex tenebris • deuro mea umbra absens
    • View Profile
Free TradingView Scripts for Tuning Strategies in Gunbot / GunbotXT
« Reply #1 on: October 22, 2017, 03:29:14 PM »
Install like this...

After you have clicked "Thumbs Up" to notify me and I have granted access, you will receive notice in TradingView. Open a chart in TradingView and then right click anywhere there is blank space on the chart and click Insert Indicator...
« Last Edit: May 02, 2019, 01:40:11 PM by allanster »
more human than human

Offline allanster

  • Contributor
  • **
  • Posts: 128
  • lux ex tenebris • deuro mea umbra absens
    • View Profile
Free TradingView Scripts for Tuning Strategies in Gunbot / GunbotXT
« Reply #2 on: October 23, 2017, 05:01:58 AM »
BB settings are self explanatory, same for Stepgain, you just enter your settings and script is programmed to mimic Gunbot's desire to continue stepping up to the next levels until trend reversal. Gunbot uses much more sophisticated trendwatcher than what we are capable of coding in Pine, so you won't see some of the larger profit trades like you will see in Gunbot. But by comparing different minimum level amounts, EMA numbers, Stops, etc... you will be able to see expected number of trades and potential for bagging, and also be able to compare which settings gives you highest returns for that pair. Once applied in Gunbot you should see even better returns than what are displayed in these scripts backtests.
« Last Edit: December 17, 2017, 12:37:41 PM by allanster »
more human than human

Offline allanster

  • Contributor
  • **
  • Posts: 128
  • lux ex tenebris • deuro mea umbra absens
    • View Profile
Free TradingView Scripts for Tuning Strategies in Gunbot / GunbotXT
« Reply #3 on: October 23, 2017, 05:17:05 AM »
Scripts are set to trade (default) like this for backtesting, Initial Capital needs to be equal to Order Size...

You should have Initial Capital and Order Size set to 100000 and leave it set this way, otherwise higher value pairs like BTCSUDT will NOT backtest properly and changing the amounts can cause unexpected results due to TradingView's backtest engine being very tempermental. The main purpose is to compare profit percentage with different tunings, so don't be concerned with the actual capital values being used. If you aren't seeing trades in TradingView it could be because you have changed these settings and you will need to set them back, and also possibly reload the indicator and refresh the web page.
« Last Edit: March 05, 2018, 07:03:29 AM by allanster »
more human than human

Offline allanster

  • Contributor
  • **
  • Posts: 128
  • lux ex tenebris • deuro mea umbra absens
    • View Profile
Free TradingView Scripts for Tuning Strategies in Gunbot / GunbotXT
« Reply #4 on: October 23, 2017, 05:25:09 AM »
If you aren't seeing Trades on chart in one of the tuners the most common issues are you have changed your Initial Capital settings (see above post), also you may just have a bag off the chart that you don't see, try temporarily lowering you STOP_LIMIT to rule this possibility out.

On the tuners where I haven't updated to "Auto" period yet, if that particular tuner calls for PERIOD in the tuner settings, then it needs to match the chart. For example -> if chart is set to 5 min then strat Period setting must be set to 5 min as well.

Also remember that candle CLOSE must fully cross, it is possible you have your levels set too high (which is one of the purposes of using these scripts to see this).

When you make a change to settings you must tab out of that changed field (or click somewhere else) in order for the change to be reflected.


« Last Edit: March 05, 2018, 07:03:50 AM by allanster »
more human than human

Offline allanster

  • Contributor
  • **
  • Posts: 128
  • lux ex tenebris • deuro mea umbra absens
    • View Profile
Re: Free TradingView Scripts for Tuning BB and Stepgain in Gunbot
« Reply #5 on: October 26, 2017, 01:16:47 PM »
Updated and Improved Free Tuners! Both now have ability to set the date range to be backtested. This will now allow you the ability to compare apples to apples which chart period is most profitable for that pair & strategy. (Hint: BTC-NEO has triple the profits at 45min compared to 5min or 15min). TradingView limits backtests to 2000 orders so if you see that you are approaching this number of trades in your backtesting then be aware of this limitation.

« Last Edit: October 30, 2017, 09:27:17 PM by allanster »
more human than human

Offline kobalt

  • Rookie
  • *
  • Posts: 22
    • View Profile
Re: Free TradingView Scripts for Tuning BB and Stepgain in Gunbot
« Reply #6 on: October 27, 2017, 11:01:57 AM »
HUGE!
Amazing who would have thought that adjusting the time frame would have such a huge impact....

Which version of gunbot are you using with this? (I assume 5.0.55?)
Big thanks!
« Last Edit: October 27, 2017, 11:22:44 AM by kobalt »

Offline allanster

  • Contributor
  • **
  • Posts: 128
  • lux ex tenebris • deuro mea umbra absens
    • View Profile
Re: Free TradingView Scripts for Tuning BB, Stepgain, PP in Gunbot
« Reply #7 on: October 30, 2017, 10:47:06 AM »
These should work with any version from 3.3.2 and up. In 3.3.2 if you are using default settings of 0.02 and 0.04 these mean 2 and 4 hours, so if you were trading on 15 min chart you would divide 2 and 4 hours by 15min to get your EMA1 and EMA2 numbers to plug in.

0.02 (hours) / 15min = 08 = EMA1
0.04 (hours) / 15min = 16 = EMA2

Set your stop to 99.9 if you are using 3.3.2

The logic behind the strategies themselves has not changed. I'll be adding XT strategies which will obviously only apply to GunbotXT and newer.

Also... Colors were chosen to be optimized for viewing in dark mode...
« Last Edit: November 01, 2017, 10:24:33 AM by allanster »
more human than human

Offline allanster

  • Contributor
  • **
  • Posts: 128
  • lux ex tenebris • deuro mea umbra absens
    • View Profile
Re: Free TradingView Scripts for Tuning Strategies in Gunbot / GunbotXT
« Reply #8 on: November 01, 2017, 07:03:20 AM »
I've had some requests asking how to use after adding the the tuner to the chart so here is a little more information regarding that. We are going to be looking at BB-RSI so first open the chart pair that you are interested in tuning settings for. Then load the Gubot BB-RSI indicator (shown earlier in thread above how to do this).

Next right click on the chart and add 2nd indicator "Relative Strength Index" so that we can see what Gunbot sees, we do this because the RSI in our tuner doesn't show on the chart, it is working in the script behind the scenes. By adding this 2nd indicator we will now be able to see both the Bollinger Bands AND the RSI that Gunbot is using for it's trade decisions. Both BB and RSI conditions must be satisfied before Gunbot will fire.
« Last Edit: November 01, 2017, 08:01:48 AM by allanster »
more human than human

Offline allanster

  • Contributor
  • **
  • Posts: 128
  • lux ex tenebris • deuro mea umbra absens
    • View Profile
Re: Free TradingView Scripts for Tuning Strategies in Gunbot / GunbotXT
« Reply #9 on: November 01, 2017, 07:06:44 AM »
Next at the bottom of the chart open the Strategy Tester: Perfomance Summary pane just high enough so that you can see the Net Profit.

Now at the top of the chart click Format on the BB-RSI indicator and you should be able to see both the "Inputs" window and the Net Profit, if not drag the "Inputs" window so that it isn't covering up the Net Profit at the bottom.

NOTE: Chart picture is oversized so scroll right if cut off!
« Last Edit: November 01, 2017, 07:54:56 AM by allanster »
more human than human

Offline allanster

  • Contributor
  • **
  • Posts: 128
  • lux ex tenebris • deuro mea umbra absens
    • View Profile
Re: Free TradingView Scripts for Tuning Strategies in Gunbot / GunbotXT
« Reply #10 on: November 01, 2017, 07:19:22 AM »
Now here is after tuning, you can see I was able to increase profit from 5.69% to 13.43% by tweaking the settings which I would now put into Gunbot if I were using this pair. I picked this pair during this timeframe to show worst case scenario of a pair that sucked for the entire month and trended down throughout that range of dates. BB-RSI is impressive. With the proper settings you can make money now even on this garbage!

NOTE: Chart picture is oversized so scroll right if cut off!
« Last Edit: November 01, 2017, 08:39:34 AM by allanster »
more human than human

suparub

  • Guest
Re: Free TradingView Scripts for Tuning Strategies in Gunbot / GunbotXT
« Reply #11 on: November 01, 2017, 09:52:39 AM »
Just beautiful, full kudos to you Monsieur. For which Gunbot version(s) these scripts are optimized for ?

Offline bolenath

  • Rookie
  • *
  • Posts: 10
    • View Profile
Re: Free TradingView Scripts for Tuning Strategies in Gunbot / GunbotXT
« Reply #12 on: November 05, 2017, 11:16:20 PM »
Really nice. thank you!!
Would be cool if you did one for tssl too :)

Offline tank1200

  • Rookie
  • *
  • Posts: 2
    • View Profile
Re: Free TradingView Scripts for Tuning Strategies in Gunbot / GunbotXT
« Reply #13 on: November 06, 2017, 03:33:36 PM »
Very nice. Thank You for the hard work and sharing. Cant wait to apply some of these and see what happens.  Just playing around with them I can see some pretty decent numbers

Offline robert1robert

  • Rookie
  • *
  • Posts: 4
    • View Profile
Re: Free TradingView Scripts for Tuning Strategies in Gunbot / GunbotXT
« Reply #14 on: November 07, 2017, 02:14:41 PM »
Is there a way to get alarms for this script like I can for other scripts?

Offline albatros24

  • Rookie
  • *
  • Posts: 26
    • View Profile
Re: Free TradingView Scripts for Tuning Strategies in Gunbot / GunbotXT
« Reply #15 on: November 07, 2017, 02:22:03 PM »
Thank you!

Offline vorus

  • Rookie
  • *
  • Posts: 3
    • View Profile
Re: Free TradingView Scripts for Tuning Strategies in Gunbot / GunbotXT
« Reply #16 on: November 08, 2017, 08:56:05 AM »
Great scripts, thank you for sharing them.
But I have got a few questions:

1) As seen in the screenshot below, although the BB is hit several times with the defualt parameters set to start from 1st November, it shows no profit and no trades. Why might this be?  The same thing happens in other strategies as well. Is it because it doesn't satisfy the minimum gain value somehow?



2) You mentioned the parameters set in the scripts were defaults of Gunbot but for BB for example; yours has SMA: 20, High BB: 18, Low BB: 40 where as Gunbot defaults are SMA: 50, High BB: 45, Low BB: 45. Is there something I am missing here or have things changed in the few days you published this and the GB 5.5.0.6 got published?

3) The default strategy for BB RSI in Gunbot has High and Low BB set to 1, but in your strategy they are 40-18 again. Does Gunbot actually take these BB values in consideration of not? I think this might be a question about GB but... You putting them in your scripts made me wonder what that is about.

4) I guess the list of trades tab do not REALLY work but show an overall gain in the long period, as it only shows a few trades even in the parameters you set for dates (back to the beginning of October).

Offline allanster

  • Contributor
  • **
  • Posts: 128
  • lux ex tenebris • deuro mea umbra absens
    • View Profile
Re: Free TradingView Scripts for Tuning Strategies in Gunbot / GunbotXT
« Reply #17 on: November 09, 2017, 07:39:22 PM »
Is there a way to get alarms for this script like I can for other scripts?

No, there are two types of scripts... studies and strategies. Studies give you alerts, these tuners are strategies and do not give alerts. The sole purpose of these is for helping users to find good settings in Gunbot and also to be used as a visual learning aid as to how the actual Gunbot strategies work.
more human than human

Offline allanster

  • Contributor
  • **
  • Posts: 128
  • lux ex tenebris • deuro mea umbra absens
    • View Profile
Re: Free TradingView Scripts for Tuning Strategies in Gunbot / GunbotXT
« Reply #18 on: November 09, 2017, 07:53:17 PM »
1) As seen in the screenshot below, although the BB is hit several times with the defualt parameters set to start from 1st November, it shows no profit and no trades. Why might this be?  The same thing happens in other strategies as well. Is it because it doesn't satisfy the minimum gain value somehow?

Please read the above reasons... https://gunthy.org/forum/index.php/topic,1788.msg8746.html#msg8746 and https://gunthy.org/forum/index.php/topic,1788.msg8747.html#msg8747

2) You mentioned the parameters set in the scripts were defaults of Gunbot but for BB for example; yours has SMA: 20, High BB: 18, Low BB: 40 where as Gunbot defaults are SMA: 50, High BB: 45, Low BB: 45. Is there something I am missing here or have things changed in the few days you published this and the GB 5.5.0.6 got published?

No this is a misunderstanding, I am merely showing you where the "defaults" settings are for TradingView indicators. Those just happened to be the settings I had in there when I published these on TradingView and you may use whatever settings you like including Gunbot's default settings.

3) The default strategy for BB RSI in Gunbot has High and Low BB set to 1, but in your strategy they are 40-18 again. Does Gunbot actually take these BB values in consideration of not? I think this might be a question about GB but... You putting them in your scripts made me wonder what that is about.

Yes Gunbot takes them into account, it may appear that they do not effect as much only because BOTH conditions (bb AND rsi) must be met.

4) I guess the list of trades tab do not REALLY work but show an overall gain in the long period, as it only shows a few trades even in the parameters you set for dates (back to the beginning of October).

List of trades tab absolutely does work. You are only seeing a few trades because you are looking at BB-RSI which is a slow (but very accurate) strategy. It doesn't trade as often as the other strategies. If you aren't seeing many trades on the other strategies then you either have your settings way off or you are trying to use pairs that may not be conducive to that strategy.
« Last Edit: December 23, 2017, 08:06:48 PM by allanster »
more human than human

Offline allanster

  • Contributor
  • **
  • Posts: 128
  • lux ex tenebris • deuro mea umbra absens
    • View Profile
Re: Free TradingView Scripts for Tuning Strategies in Gunbot / GunbotXT
« Reply #19 on: November 10, 2017, 12:54:51 PM »
UPDATE: GunbotXT BB-RSI tuner had an issue with not making hardly any buys. I discovered an issue where an extra set of close parentheses in the sell formulae were preventing most buys. This is completely unexplainable because having that extra set should not have mattered. If it did matter, then it should have prevented ALL buys, but instead was only preventing MOST buys. Pushed an update so next time you load it should be fixed.

Changed   ((sell formula))   to   (sell formula)

Wow
more human than human