stevehopwoodforex.com
https://www.stevehopwoodforex.com/phpBB3/
Print view

Holy Graily Bob 'n Dotty 'n SuperSlope
https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?t=4925
Page 1 of 14
Author:  SteveHopwood [ Sat Oct 01, 2016 10:30 am ]
Post subject:  Holy Graily Bob 'n Dotty 'n SuperSlope

SERIOUS WARNING
  • Most Forex traders lose all their money.
  • Using the robot posted here in trading Forex does not guarantee success.
  • Trading this robot could lead to serious financial loss.
  • Trading this robot without understanding its underlying trading strategies guarantees traders will lose their money.
  • This is not a set-and-forget ea; there is no such thing and anyone who tries to claim there is, is either stupid or lying. This ea requires frequent manual intervention.
  • At best, a trading robot is only 90% as good as the manual strategy it trades. At best. At worst, it can be much less effective. If the strategy is rubbish, so is the robot.
  • To trade this robot, you have to understand:
MAKE SURE YOU READ THIS POST http://www.stevehopwoodforex.com/phpBB3 ... 41#p111241 There was a Forex bloodbath on Jan 15th 2015 that you need to know about.

I refer to SUPER CSS-2.0 here and in the inputs as SuperSlope - abbreviated to SS here.

HGBnDnSS is an extension of Holy Graily Bob 'n Dotty. The trade trigger here is an SS cross. It can be kept that simple.

A quick note to noobs. Those of us who have been in on DottyBot's development from the start understand what is going on here, so I am not going to clutter up this thread with information already posted elsewhere. User Guide describes the panoply of gridding/hedging/offsetting. Holy Graily Bob 'n Dotty is posted at http://www.stevehopwoodforex.com/phpBB3 ... 40#p145240. Post 2 describes the full hedge trade that inspired the addition of the full hedging feature. The User Guide describes the panoply of gridding/hedging/offsetting.

Place the attached version of the indi in your Empty4/Indicators folder if you want to see the same colours as those the EA describes. You do not need it on your chart. The EA refers to the colours red and green and the version for an EA has the bars coloured red and green - I prefer this.

You need to download two libraries because the bot will not run without them: The trade trigger is the simple cross of the currencies on your TradingTimeFrame (this is in the SuperSlope inputs section). You have the alternative to use different higher time frame filters - watch the defaults because these could all be enabled:
  • Buy low, sell high.
  • Highest time frame SS.
  • Medium time frame SS.
All three of these have a Usexxxxx input, so turn them to 'false' to disable the filter. If either/both the higher time frame SS filters are enabled, then the bot will only buy when it/they are green and sell when it/they are red.

The version here is a revamp of the original, created from the HGBnD shell and so containing all the improvements to the code made by Thomas (tomele). We are all deeply grateful for your epic contribution Thomas. Thanks you. :clap: :clap: :clap: :clap:


Have fun.

:xm:

dclayw's version
dclayw added his own tweaks to the code to suit the experiments he wanted to run. He recently posted two lots of success over a four month period. He has posted his tweaked version and a set file at http://www.stevehopwoodforex.com/phpBB3 ... 12#p156612. Scroll back a handful of posts to view his results.

Matters of general interest
Go here to download and run the script that will fill your platform's missing chart history: http://www.stevehopwoodforex.com/phpBB3 ... f=15&t=254
Read this post:
http://www.stevehopwoodforex.com/phpBB3 ... p?f=6&t=78 Newbie traders, read this for inspiration and warning. Those of you who have suffered losses, read it for inspiration.

Masterly summary of hedging: http://www.forexfactory.com/showthread. ... ost4977179

EA coding
I receive may requests to code EA's. Traders, if I code your EA for free, then I will share it here. If you want me to code your EA without sharing, then my fee is $100 payable into my paypal account. I explain why at http://www.stevehopwoodforex.com/phpBB3 ... ?f=15&t=79, at the bottom of the post.

Useful utilities/EA's/scripts -

-
Author:  tomele [ Sat Oct 01, 2016 2:24 pm ]
Post subject:  Holy Graily Bob 'n Dotty 'n SuperSlope

:!!:
Thanks Steve. I will set up a hell of a rat race with all four family members. :clap: :cheer: :yahoo:
Author:  SteveHopwood [ Sat Oct 01, 2016 5:02 pm ]
Post subject:  Holy Graily Bob 'n Dotty 'n SuperSlope

I have posted new versions of all flavours of Holy Graily Bob 'n Dotty and Dottybot. I have not updated version numbers.

tomele PM'd me with a suggested improvement which I have adopted. It affects the price calculation when a massive spread event has finished and the bot is replacing pending trades.

DIYers, go to void CheckForSpreadWidening() and scroll down to this snippet:

Code: Select all

         //Non-hedged
         if (BuyOpen)
         {
            SendBuyGrid(Symbol(), OP_BUYSTOP, NormalizeDouble(HighestBuyPrice + (DistanceBetweenTrades / factor), Digits), Lot);
            if (UseHedgingWithGrid)
               SendSellGrid(Symbol(), OP_SELLSTOP, NormalizeDouble(LowestSellPrice - (DistanceBetweenTrades / factor), Digits), Lot); 
         
            return;
         }//if (BuyOpen)
Replace it with this:

Code: Select all

         //Non-hedged
         if (BuyOpen)
         {
            SendBuyGrid(Symbol(), OP_BUYSTOP, NormalizeDouble(Ask + (DistanceBetweenTrades / factor), Digits), Lot);
            if (UseHedgingWithGrid)
               SendSellGrid(Symbol(), OP_SELLSTOP, NormalizeDouble(Bid - (DistanceBetweenTrades / factor), Digits), Lot); 
         
            return;
         }//if (BuyOpen)
The difference is merely: HighestBuyPrice is replaced by Ask; LowestSellPrice is replaced by Bid. Look at the next snippet and you will see that these two are consistent now.

You do not need the update if you plan to demo this EA without gridding etc; you may as well hang on until we add something else that forces an update.

Thanks again Thomas. Much appreciated by all of us. :clap: :clap: :clap:

:xm:
Author:  tomele [ Wed Oct 05, 2016 1:36 pm ]
Post subject:  Holy Graily Bob 'n Dotty 'n SuperSlope

Hello.

Most of those nasty little bugs that annoyed us for so long have been found. Version 1a is in the first post.

Please note that we have MondayStartTradingTime (default "02.00") and FridayStopTradingTime (default "12.00") as SERVER time now instead of MondayStartTradingHour, FridayStopTradingHour, AllowSaturdayTrading and AllowSundayTrading in LOCAL time. Please adjust them to your preferences.

Explanations and advices for the DIYers are here: http://www.stevehopwoodforex.com/phpBB3 ... 30#p147229
Author:  tomele [ Wed Oct 05, 2016 7:30 pm ]
Post subject:  Holy Graily Bob 'n Dotty 'n SuperSlope

Hello.

Krzysztof (@krzysiekqq2) PM`d me and pointed to an error in the CSS calculation. Thank you, Krzysztof. Very much appreciated. :good: :yahoo: :clap:

The corrected version is in post 1 now. Please download it again.

Explanation: There was four times HigherTimeFrame instead of MediumTimeFrame used in the calculation of MtfCurr1Val and MtfCurr2Val. The code from line 2574 must be:

Code: Select all

         //MTF SS
         //Read at the open of each new TradingTimeFrame in case it has changed colour
         if (UseMediumTimeFrameControl)
         {
               
               //Buffer 0 holds first currency in the pair
               MtfCurr1Val = GetSuperSlope(Symbol(), MediumTimeFrame, MtfMaxBars, MtfAutoTimeFrame, MediumTimeFrame, MtfDifferenceThreshold, MtfLevelCrossValue, 
                                               MtfSlopeMAPeriod, MtfSlopeATRPeriod, 0, 0);
               
               //Buffer 1 holds second currency in the pair
               MtfCurr2Val = GetSuperSlope(Symbol(), MediumTimeFrame, MtfMaxBars, MtfAutoTimeFrame, MediumTimeFrame, MtfDifferenceThreshold, MtfLevelCrossValue, 
                                               MtfSlopeMAPeriod, MtfSlopeATRPeriod, 1, 0);
                                               
               //What colour is the histo:
               MtfSsColour = red;
               if (MtfCurr1Val > MtfCurr2Val)
                  MtfSsColour = green;
                                               
         }//if (UseMediumTimeFrameControl)
Author:  tomele [ Fri Oct 07, 2016 1:07 pm ]
Post subject:  Holy Graily Bob 'n Dotty 'n SuperSlope

Hello.

I have uploaded version 1b to the first post. It fixes a problem where the bot gets stuck sending invalid orders in fast moving markets.

There are also new inputs for those traders that use brokers with more then 5 daily candles per week. You can now specify Saturday and Sunday trading times.

Explanation and advice for the DIYers are here: http://www.stevehopwoodforex.com/phpBB3 ... 29#p147429
Author:  Wavegarrick [ Fri Oct 07, 2016 2:57 pm ]
Post subject:  Holy Graily Bob 'n Dotty 'n SuperSlope

Hi Thomas,

Excellent stuff, thank you :good:

Cheers
Leon
Author:  tomele [ Sun Oct 16, 2016 3:25 pm ]
Post subject:  Holy Graily Bob 'n Dotty 'n SuperSlope

Hello.

I have uploaded version 1c to the first post. Explanation and advice for the DIYers are here: http://www.stevehopwoodforex.com/phpBB3 ... 40#p148131

I have also implemented a modification that dap711 suggested:
I've added a modification to my version of this EA and thought I would share it with you. I wanted to be able to use the TradingDifferenceThrehold but found it wasn't accounted for when opening and closing a trade. I replaced the below code:

Code: Select all

               //What colour is the histo:
               HtfSsColour = red;
               if (HtfCurr1Val > HtfCurr2Val)
                  HtfSsColour = green;
with this code:

Code: Select all

            SsColour[cc] = yellow;
            if (Curr1Val[cc] > 0)  //buy
               if (Curr1Val[cc] - TradingDifferenceThreshold/2 > 0) //green
                  SsColour[cc] = green;
 
            if (Curr1Val[cc] < 0)  //sell
               if (Curr1Val[cc] + TradingDifferenceThreshold/2 < 0) //red
                  SsColour[cc] = red;
Also added this new define:

Code: Select all

#define  yellow ": Yellow"
This allows me to open and close a trade at different level other than the 0 cross. I'm currently testing TradingDifferenceThreshold with a level of 4.0 which basically equals the 2.0 upper and lower bands of the SuperSlope. This mod is backward compatible with the 0 level cross trading and just adds another dimension of trading.

Dwain
Brilliant, Dwain, Thanks a lot. :clap: :clap: :clap:
Author:  retireme [ Sun Oct 16, 2016 3:26 pm ]
Post subject:  Holy Graily Bob 'n Dotty 'n SuperSlope

Nice job Tomele...
Author:  dap711 [ Sun Oct 16, 2016 6:56 pm ]
Post subject:  Holy Graily Bob 'n Dotty 'n SuperSlope

My suggested code change that Tomas added is valid, however I told him to replace the higher SS time frame by mistake. The code should have been added to the current time frame. Sorry for the confusion.


Instead of replacing this:

Code: Select all

               //What colour is the histo:
               HtfSsColour = red;
               if (HtfCurr1Val > HtfCurr2Val)
                  HtfSsColour = green;

Please replace this instead:

Code: Select all

             //Set the colours
            SsColour[cc] = red;
            if (Curr1Val[cc] > Curr2Val[cc])
               SsColour[cc] = green;
 
This is the whole corrected thing if you prefer to replace it all:

Code: Select all

     ///////////////////////////////////////
      //Indi reading code goes here.

      if (!UseHGI || TrendTimeFrameStatus != hginotrend)
      {
         //HTF SS
         //Read at the open of each new TradingTimeFrame in case it has changed colour
         if (UseHigherTimeFrameControl)
         {
               
               //Buffer 0 holds first currency in the pair
               HtfCurr1Val = GetSuperSlope(Symbol(), HigherTimeFrame, HtfMaxBars, HtfAutoTimeFrame, HigherTimeFrame, HtfDifferenceThreshold, HtfLevelCrossValue, 
                                               HtfSlopeMAPeriod, HtfSlopeATRPeriod, 0, 0);
               
               //Buffer 1 holds second currency in the pair
               HtfCurr2Val = GetSuperSlope(Symbol(), HigherTimeFrame, HtfMaxBars, HtfAutoTimeFrame, HigherTimeFrame, HtfDifferenceThreshold, HtfLevelCrossValue, 
                                               HtfSlopeMAPeriod, HtfSlopeATRPeriod, 1, 0);
                
               //What colour is the histo:
               HtfSsColour = red;
               if (HtfCurr1Val > HtfCurr2Val)
                  HtfSsColour = green;
                                  
                                 
         }//if (UseHigherTimeFrameControl)
         
         //MTF SS
         //Read at the open of each new TradingTimeFrame in case it has changed colour
         if (UseMediumTimeFrameControl)
         {
               
               //Buffer 0 holds first currency in the pair
               MtfCurr1Val = GetSuperSlope(Symbol(), MediumTimeFrame, MtfMaxBars, MtfAutoTimeFrame, MediumTimeFrame, MtfDifferenceThreshold, MtfLevelCrossValue, 
                                               MtfSlopeMAPeriod, MtfSlopeATRPeriod, 0, 0);
               
               //Buffer 1 holds second currency in the pair
               MtfCurr2Val = GetSuperSlope(Symbol(), MediumTimeFrame, MtfMaxBars, MtfAutoTimeFrame, MediumTimeFrame, MtfDifferenceThreshold, MtfLevelCrossValue, 
                                               MtfSlopeMAPeriod, MtfSlopeATRPeriod, 1, 0);
                                               
               //What colour is the histo:
               MtfSsColour = red;
               if (MtfCurr1Val > MtfCurr2Val)
                  MtfSsColour = green;
                                               
         }//if (UseMediumTimeFrameControl)
   
         LongTradeTrigger = false;
         ShortTradeTrigger = false;
         TradingTimeFrameStatus = hginosignal;
         
         //Read SuperSlope
         for (cc = 2; cc >= 0; cc--)
         {
            //Buffer 0 holds first currency in the pair
            Curr1Val[cc] = GetSuperSlope(Symbol(), TradingTimeFrame, TradingMaxBars, TradingAutoTimeFrame, TradingTimeFrame, TradingDifferenceThreshold, TradingLevelCrossValue, 
                                         TradingSlopeMAPeriod, TradingSlopeATRPeriod, 0, cc);
            //Buffer 1 holds second currency in the pair
            Curr2Val[cc] = GetSuperSlope(Symbol(), TradingTimeFrame, TradingMaxBars, TradingAutoTimeFrame, TradingTimeFrame, TradingDifferenceThreshold, TradingLevelCrossValue, 
                                         TradingSlopeMAPeriod, TradingSlopeATRPeriod, 1, cc);
                
            //Changed by tomele 
            //Set the colours
            SsColour[cc] = yellow;
            if (Curr1Val[cc] > 0)  //buy
               if (Curr1Val[cc] - TradingDifferenceThreshold/2 > 0) //green
                  SsColour[cc] = green;
 
            if (Curr1Val[cc] < 0)  //sell
               if (Curr1Val[cc] + TradingDifferenceThreshold/2 < 0) //red
                  SsColour[cc] = red;
                                                      
         }//for (cc = 2; cc >= 0; cc--)
                  
         //The cross status
         SsCrossStatus = ssnocross;
         
         //Longcross
         if (SsColour[2] == red)
            if (SsColour[1] == green)
               if (SsColour[0] == green)
               {
                  SsCrossStatus = sslongcross;
                  LongTradeTrigger = true;
               }//if (SsColour[0] == green)
               
         //Short cross
         if (SsColour[2] == green)
            if (SsColour[1] == red)
               if (SsColour[0] == red)
               {
                  SsCrossStatus = ssshortcross;
                  ShortTradeTrigger = true;
               }//if (SsColour[0] == red)
               
         
         
      }//if (UseHGI || TrendTimeFrameStatus != hginotrend)
    


Thanks,
Dwain
All times are UTC Page 1 of 14