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 2 of 14
Author:  tomele [ Sun Oct 16, 2016 7:12 pm ]
Post subject:  Holy Graily Bob 'n Dotty 'n SuperSlope

Hello.

I have uploaded a corrected version in post 1.
Author:  dap711 [ Sun Oct 16, 2016 7:27 pm ]
Post subject:  Holy Graily Bob 'n Dotty 'n SuperSlope

Thank you so much for all that you do!! :yahoo:

Dwain
Author:  tomele [ Tue Oct 18, 2016 6:12 pm ]
Post subject:  Holy Graily Bob 'n Dotty 'n SuperSlope

Hello.

I have uploaded version 1d to the first post. It fixes some points and should be close to a final release. Explanations are here: http://www.stevehopwoodforex.com/phpBB3 ... 64#p148264
Author:  tomele [ Wed Oct 26, 2016 4:43 pm ]
Post subject:  Holy Graily Bob 'n Dotty 'n SuperSlope

Hello.

I have uploaded version 1e to the first post. This contains some fixes and improvements. Please read the explanation here: http://www.stevehopwoodforex.com/phpBB3 ... 50#p148712

Additionally, there are some more improvements that dap711 suggested:
dap711 wrote: I've been playing around some more and found a couple more suggestions. Hope you find them useful.

Replace starting at line 2639:

Code: Select all

        //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)

With this:

Code: Select all

         //The cross status
         SsCrossStatus = ssnocross;
         
         //Longcross
         if (SsColour[2] == red || SsColour[2] == yellow)
            if (SsColour[1] == green)
               if (SsColour[0] == green)
               {
                  SsCrossStatus = sslongcross;
                  LongTradeTrigger = true;
               }//if (SsColour[0] == green)
               
         //Short cross
         if (SsColour[2] == green || SsColour[2] == yellow)
            if (SsColour[1] == red)
               if (SsColour[0] == red)
               {
                  SsCrossStatus = ssshortcross;
                  ShortTradeTrigger = true;
               }//if (SsColour[0] == red)

Also think this needs to be changed:
Replace starting at line 2709:

Code: Select all

       if (BuySignal)
         SellCloseSignal = true;
      
      if (SellSignal)
         BuyCloseSignal = true;

           
      if (SsColour[1] == red || SsColour[0] == red)
         BuyCloseSignal = true;
      
      if (SsColour[1] == green || SsColour[0] == green)
         SellCloseSignal = true;
With:

Code: Select all

   
         //Not needed. These are checked below.
      //if (BuySignal)
      //   SellCloseSignal = true;
      
      //if (SellSignal)
      //   BuyCloseSignal = true;

       if (SsColour[1] == red || SsColour[0] == red || SsColour[1] == yellow || SsColour[0] == yellow)
              BuyCloseSignal = true;
      
       if (SsColour[1] == green || SsColour[0] == green || SsColour[1] == yellow || SsColour[0] == yellow)
              SellCloseSignal = true;
       

Thanks a lot again. :clap: :clap: :clap:
Author:  tomele [ Sat Nov 12, 2016 6:26 pm ]
Post subject:  Holy Graily Bob 'n Dotty 'n SuperSlope

Hello.

I have uploaded version "f" of the EA to the first post. It contains some code fixes and improvements.

GENERAL WARNING: This EA is not forward tested for very long. Never use any new EA version on a live cash account without prior demo testing. Stick to your actual live version until you are convinced of the new versions profitability.

Explanation and advice for DIYers are here: http://www.stevehopwoodforex.com/phpBB3 ... 45#p149345

Additionally, there are some more changes. This bot has always shown to be a resource hog. Dwain (@dap711) made a suggestion how to reduce this. The basic idea was to use internal code instead of calling the BaludaCSS indi via iCustom(). We have implemented this and the indi is obsolete now. Thank you Dwain. Absolutely brilliant.

1. Change the definition section for the SuperSlope variables to this:

Code: Select all

//I added HTF as an afterthought, so these variables are for TradingTimeFrame
double         Curr1Val[3];//For shifts 0 to 2
string         SsColour[3];//For shifts 0 to 2. Colours defined at top of file
string         SsCrossStatus="";//ssnocross, sslongcross or ssshortcross defined above
//Variables for HigherTimeFrame
double         HtfCurr1Val;
string         HtfSsColour="";
//Variables for MediumTimeFrame
double         MtfCurr1Val;
string         MtfSsColour="";
//Variables for SuperSlope
bool           BrokerHasSundayCandles;
2. Change the screen output for SS trading timeframe to this:

Code: Select all

   text = "SuperSlope trading time frame currency strengths: ";
   for (cc = 2; cc >= 0; cc--)
   {
      text = text + DoubleToStr(Curr1Val[cc], 4) + ": ";
   }//for (cc = 2; cc >= 0; cc--)
   SM(text + NL);
   
   //text = "Second trading time frame currency strengths: ";
   //for (cc = 2; cc >= 0; cc--)
   //{
   //   text = text + DoubleToStr(Curr2Val[cc], 4) + ": ";
   //}//for (cc = 2; cc >= 0; cc--)
   //SM(text + NL);
3. Comment out or delete the check for indi existence:

Code: Select all

      //if (!indiExists( "Baluda.SuperSlope.v.2.0 for EA" ))
      //{
      //   Alert("");
      //   Alert("Download the indi from Bob's HGI thread and adit the HGI_Name input");
      //   Alert("The required indicator Baluda.SuperSlope.v.2.0 for EA does not exist on your platform. I am removing myself from your chart.");
      //   RemoveExpert = true;
      //   ExpertRemove();
      //   return(0);
      //}//if (! indiExists( "IndiName" ))
4. Add the check for sunday candles at the end of OnInit() :

Code: Select all

   BrokerHasSundayCandles = false;
   for ( int i = 0; i < 8; i++ )
   {
      if ( TimeDayOfWeek( iTime( NULL, PERIOD_D1, i ) ) == 0 )
      {
         BrokerHasSundayCandles = true;
         break;
      }
   }
   
   //Call sq's show trades indi
   //iCustom(NULL, 0, "SQ_showTrades",Magic, 0,0);
5. Replace GetSuperSlope() with this:

Code: Select all

//+------------------------------------------------------------------+
//| GetSuperSlope()                                                       |
//+------------------------------------------------------------------+
double GetSuperSlope( int tf, int maperiod, int atrperiod, int pShift )
{
   double dblTma, dblPrev;
   int shiftWithoutSunday = pShift;
   if ( BrokerHasSundayCandles && PERIOD_CURRENT == PERIOD_D1 )
   {
      if ( TimeDayOfWeek( iTime( NULL, PERIOD_D1, pShift ) ) == 0  ) shiftWithoutSunday++;
   }   

   double atr = iATR( NULL, tf, atrperiod, shiftWithoutSunday + 10 ) / 10;
   double result = 0.0;
   if ( atr != 0 )
   {
      dblTma = iMA( NULL, tf, maperiod, 0, MODE_LWMA, PRICE_CLOSE, shiftWithoutSunday );
      dblPrev = ( iMA( NULL, tf, maperiod, 0, MODE_LWMA, PRICE_CLOSE, shiftWithoutSunday + 1 ) * 231 + iClose( NULL, tf, shiftWithoutSunday ) * 20 ) / 251;

      result = ( dblTma - dblPrev ) / atr;
   }
   
   return ( result );
   
}//GetSuperSlope()
6. Change the indi reading code to this:

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(HigherTimeFrame,HtfSlopeMAPeriod,HtfSlopeATRPeriod,0);
               
               //What colour is the histo:
               HtfSsColour = red;
               if (HtfCurr1Val > 0)
                  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(MediumTimeFrame,MtfSlopeMAPeriod,MtfSlopeATRPeriod,0);
               
               //What colour is the histo:
               MtfSsColour = red;
               if (MtfCurr1Val > 0)
                  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(TradingTimeFrame,TradingSlopeMAPeriod,TradingSlopeATRPeriod,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--)
         
         //Changed by tomele        
         //The cross status
         SsCrossStatus = ssnocross;
         
         //Long cross
         if (SsColour[2] == red || SsColour[2] == yellow)
            if (SsColour[1] == green)
               if (SsColour[0] == green)
               {
                  SsCrossStatus = sslongcross;
                  LongTradeTrigger = true;
               }//if (SsColour[0] == green)
               
         //Short cross
         if (SsColour[2] == green || SsColour[2] == yellow)
            if (SsColour[1] == red)
               if (SsColour[0] == red)
               {
                  SsCrossStatus = ssshortcross;
                  ShortTradeTrigger = true;
               }//if (SsColour[0] == red)
          
      }//if (UseHGI || TrendTimeFrameStatus != hginotrend)
Author:  SteveHopwood [ Mon Nov 28, 2016 2:17 pm ]
Post subject:  Holy Graily Bob 'n Dotty 'n SuperSlope

V 1g is in post 1, with the same changes as those I made to HGBnD. Any bloops that show up with HGBnD will need correcting here as well.

:xm:
Author:  SteveHopwood [ Mon Nov 28, 2016 5:47 pm ]
Post subject:  Holy Graily Bob 'n Dotty 'n SuperSlope

I have attempted to fix some faulty logic in the latest version. Post one as usual.

:xm:
Author:  SteveHopwood [ Sun Dec 04, 2016 11:47 am ]
Post subject:  Holy Graily Bob 'n Dotty 'n SuperSlope

V 1h is in post 1. Explanation at http://www.stevehopwoodforex.com/phpBB3 ... 41#p150241

:xm:
Author:  traderduke [ Thu Dec 08, 2016 9:34 am ]
Post subject:  Holy Graily Bob 'n Dotty 'n SuperSlope

Steve & Tomele
Thanks for directing me to this Ea, it's exactly what I was hoping to accomplish in my abbreviated EA. I thought I would give it a try before I tried the complicated cut & paste extraction. :arrrg:

Tomele
Although I'm showing all three time frames I have only allowed the trading time frame to be TRUE and no HGI. See my chart of 12 pr all show 'NO Trade Signal' and my inputs for GBPNZD. I also tried to minimize my Grid Size and instead of 3 pending's I got 7. Hope my screen shot help.

So far the trades it has entered have both been winners. Great work tomele and Dwain, again thanks for your input.

BR
Ray
12-8-2016 3-12-40 AM-BaSS-12 no trade signal.png
12-8-2016 3-35-24 AM-GN-no trade.png
12-8-2016 4-15-19 AM-BaSS-GBPUSD-7trades.png

PS; as requested, added setfile; and report at this time 5 for 5 basket winners
HGIDot-H4.set
12-8-2016 9-17-16 AM-hgi-Bass-report.png
Author:  traderduke [ Sun Dec 11, 2016 3:02 pm ]
Post subject:  Holy Graily Bob 'n Dotty 'n SuperSlope

Steve & Tomele
This the quietest thread on the forum. Is any body else trading this winner.

Here are my end of week results. I still can't seem to control the number of grids. I don't hedge so I'm not sure How else to control the DD.
Here is my report, looks good for the week but for some reason the trades seem to be coming very slow almost like 1 at a time even though the text says many are red or green??

I had 2 big losers 1 for 220 pips & the other 130pips so I tried to install a "Basket Symbol specific TP & SL" but it failed to operate on another test run. I won't load it here because it failed. I'll forward it to Tomele and you can do what you want with it but I think out of control reverse trends need an escape such as "Basket Symbol specific TP & SL"


Thanks for this great work
Ray

12-11-2016 9-33-05 AM-HGI'nGSS-dec9.png
All times are UTC Page 2 of 14