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

Old and defunct Holy Graily Bob
https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?t=3966
Page 33 of 129
Author:  rdg281 [ Tue Dec 09, 2014 9:59 pm ]
Post subject:  Holy Graily Bob

:good:
Cheers :)
Author:  oliverjp [ Wed Dec 10, 2014 2:21 am ]
Post subject:  Holy Graily Bob

Hi Steve

Assuming suggested reason for immediate deletion of open orders is correct, I have slightly tweaked your ReadIndicatorValues() function to amend the logic so a wavy line detection is ignored if it occurs on the same candle as a Trend or Range signal. The wavy lines will still show on the chart because it is displaying from the indicator, but the EA will know to ignore the wavy lines and give preference to the Trend or Range signal.

Hope this allows you time for another cup of coffee in the morning. If not, please do chuck it away and code something more all encompassing :mrgreen:

All the best

Jeff

Code: Select all

//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
void ReadIndicatorValues()
{

   int cc = 0;
   
   //Declare a shift for use with indicators.
   int shift = 0;
   if (!EveryTickMode)
   {
      shift = 1;
   }//if (!EveryTickMode)
   double val = 0;
   
   //HGI
   static datetime OldReadBarTime = 0;
   if (EveryTickMode)
      OldReadBarTime = 0;
   
   //shift = 3;
   
   
   if (OldReadBarTime != iTime(Symbol(), TradingTimeFrame, 0) )
   {
      OldReadBarTime = iTime(Symbol(), TradingTimeFrame, 0);
      
         
      
      if (TimeCurrent() >= NextReadTime)
      {
         TrendArrowStatus = Trendnoarrow;
         RangeArrowStatus = Rangenoarrow;
         RadArrowStatus = Radnoarrow;
         WaveStatus = Wavenone;
         
         NextReadTime = TimeCurrent() + HgiReadDelaySeconds;
         
         //Read the TMA component
         TmaStatus = Tmanosignal;
         //Buffer 7 holds a range end signal. Changed back to 0 because HGI displays the wavy line on the current candle
         val = GetHGI(Symbol(), TradingTimeFrame, 7, 0);         
         if (!CloseEnough(val, EMPTY_VALUE) )
         {
            TmaStatus = Tmarangeendsignal;
            RangeEndValue = val;
            if (Bid < val)
               WaveStatus = Wavesell;//High wavy line so sell below it
            else
               WaveStatus = Wavebuy;//Low wavy line so buy above it
         }//if (!CloseEnough(val 0) )
         else
         {
            //Buffer 6 holds a range signal. 
            val = GetHGI(Symbol(), TradingTimeFrame, 6, 0);
            if (!CloseEnough(val, EMPTY_VALUE) )
            {
               TmaStatus = Tmarangesignal;
               RangeStartValue = val;
               if (Bid < val)
                  WaveStatus = Wavesell;//High wavy line so sell below it
               else
                  WaveStatus = Wavebuy;//Low wavy line so buy above it
            }//if (!CloseEnough(val 0) )
         }//else
         
         //Trend
         //Buffer 0 contains a large grend trend up arrow
         val = GetHGI(Symbol(), TradingTimeFrame, 0, shift);
         if (!CloseEnough(val, EMPTY_VALUE) )
         {
               TrendArrowStatus = Trenduparrow;
               WaveStatus = Wavenone;
         }//if (!CloseEnough(val 0) )
         else
         {
            //Buffer 1 holds large red down trend arrow
            val = GetHGI(Symbol(), TradingTimeFrame, 1, shift);
            if (!CloseEnough(val, EMPTY_VALUE) )
            {
                  TrendArrowStatus = Trenddownarrow;
                  WaveStatus = Wavenone;
            }//if (!CloseEnough(val 0) )
            //Range arrows
            else
            {
               //Buffer 3 holds small red down range arrow
               val = GetHGI(Symbol(), TradingTimeFrame, 3, shift);
               if (!CloseEnough(val, EMPTY_VALUE) )
               {
                     RangeArrowStatus = Rangedownarrow;
                     WaveStatus = Wavenone;

               }//if (!CloseEnough(val 0) )
               else
               {
                  //Buffer 2 holds small green up range arrow
                  val = GetHGI(Symbol(), TradingTimeFrame, 2, shift);
                  if (!CloseEnough(val, EMPTY_VALUE) )
                  {
                        RangeArrowStatus = Rangeuparrow;
                        WaveStatus = Wavenone;
                  }//if (!CloseEnough(val 0) )
                  //RAD arrows
                  else
                  {
                     //Buffer 4 holds green Rad arrows
                     val = GetHGI(Symbol(), TradingTimeFrame, 4, shift);
                     if (!CloseEnough(val, EMPTY_VALUE) )
                     {
                           RadArrowStatus = Raduparrow;
                     }//if (!CloseEnough(val 0) )
                     else
                     {
                        //Buffer 5 holds red Rad arrows
                        val = GetHGI(Symbol(), TradingTimeFrame, 5, shift);
                        if (!CloseEnough(val, EMPTY_VALUE) )
                        {
                              RadArrowStatus = Raddownarrow;
                        }//if (!CloseEnough(val 0) )
                     }//else
                     
                  }//else               
               }//else
            }//else
         }//else
         
         
      }
   }//if (OldReadBarTime != iTime(Symbol(), TradingTimeFrame, 0) )
   
   
   
   
   
   //MA
   if(MaPeriod>0)
   {
      static datetime OldM1BarTime;
      if(OldM1BarTime!=iTime(NULL,PERIOD_M1,0) && MaPeriod>0)
      {
         OldM1BarTime=iTime(NULL,PERIOD_M1,0);
         //~ TradeLong = false;
         //~ TradeShort = false;
         MaVal=GetMa(Symbol(),MaTF,MaPeriod,MaShift,MaMethod,MaAppliedPrice,0);
         if(Bid>MaVal)
         {
            MaTrend=up;
         }//if (Bid > MaVal) 

         if(Bid<MaVal)
         {
            MaTrend=down;
         }//if (Bid < MaVal) 

      }//if (OldM1BarTime != iTime(NULL, PERIOD_M1, 0))
   }//if (MaPeriod > 0)

}//void ReadIndicatorValues()
//End Indicator module
////////////////////////////////////////////////////////////////////////////////////////

SteveHopwood » Tue Dec 09, 2014 9:55 pm wrote:
"]Hi Steve,

I hate to be a party-pooper.....
The newest version still has the rapid open/close 'bug'.

Reason is the EA 'sees' a buy-wave, AND prints an big SELL arrow, these conflict. The wave tells the EA to set buy pendings, the sell arrow deletes them immediately. And again, and again.
Thanks. At last a post that doesn't merely say, "Errrrmmmm. It dunt wurk." I was beginning to despair of ever getting anything useful out of anyone other that the indi coders and Bob.

Yep. Defo something that needs sorting out. HGI was intended for manual traders who would sort out this kind of dichotomy for themselves.

Sadly, for an EA this means a major rewrite. Now, bear in mind this scenario. I have spent most of the day bug hunting. I am worn out. I am seriously pissed at some dimwits here and am about to go dimwit hunting. Dinner tonight included a couple of glasses of wine and a small whiskey. Said small whiskey is about to be followed by quite a large one. Those of us who drink alcohol understand how doing so lifts inhibitions, so the large one might be followed by another large one.

I might not remember this in the morning is what I am saying here. So, would you please send me a link to your post at a human time in the morning to remind me about it, please.

Ok, off to impose some discipline elsewhere. Offer up prayers for the dimwits, guys. They will be wasted, but try on their behalves.

:xm:
Author:  TheWolfInsideUs [ Wed Dec 10, 2014 2:26 am ]
Post subject:  Holy Graily Bob

Hi everyone,

Steve and the people you work with; you have a new fan! The speed at which you work is admirable. When will you go on a well deserved vacation? ;-)

Here is a little update on my progress with the EA. I should mention that I still use version 1J of the EA, because in my opinion the added features like the ADR closure are additional. (I will update to the latest version of the EA at a later time). From Friday to Monday night the EA made over 19% ROI on a 15 minute timeframe with a max DD of 5.1%. However it gave, after a great start today, approximately 13% back to the market. And what struck me is that the EA is even on a day like this very often correct with positioning it's trades, which is fantastic!

I do not know if we are already ready for this phase in the progress. But I would like to make a suggestion for profitability security. I'm pretty new on the website, but if I can remember well you are using some sort of a basket closure system for some of your EA's. After the experience of today, among other things, it might be a good idea to close all the open trades and pending orders when a certain profit expressed as a percentage is gained. And after this process you just let the beast (EA) get back to work.

Thanks for your time.

Enjoy your whiskey and maybe one day I can send you a bottle of Macallan 1939 because of the effort of guys like you.

My sincere respect,

The Wolf.
Author:  batemap [ Wed Dec 10, 2014 3:17 am ]
Post subject:  Holy Graily Bob

TheWolfInsideUs » Wed Dec 10, 2014 1:26 pm wrote:Hi everyone,

I do not know if we are already ready for this phase in the progress. But I would like to make a suggestion for profitability security. I'm pretty new on the website, but if I can remember well you are using some sort of a basket closure system for some of your EA's. After the experience of today, among other things, it might be a good idea to close all the open trades and pending orders when a certain profit expressed as a percentage is gained. And after this process you just let the beast (EA) get back to work.

The Wolf.
Hi Wolf

Look into Steve's (or others) trade managers (http://www.stevehopwoodforex.com/phpBB3 ... ?f=21&t=64).
Author:  taipan [ Wed Dec 10, 2014 4:13 am ]
Post subject:  Holy Graily Bob

batemap » Wed Dec 10, 2014 11:17 am wrote:
TheWolfInsideUs » Wed Dec 10, 2014 1:26 pm wrote:Hi everyone,

I do not know if we are already ready for this phase in the progress. But I would like to make a suggestion for profitability security. I'm pretty new on the website, but if I can remember well you are using some sort of a basket closure system for some of your EA's. After the experience of today, among other things, it might be a good idea to close all the open trades and pending orders when a certain profit expressed as a percentage is gained. And after this process you just let the beast (EA) get back to work.

The Wolf.
Hi Wolf

Look into Steve's (or others) trade managers (http://www.stevehopwoodforex.com/phpBB3 ... ?f=21&t=64).

Also, see milanese "an other AllPairTradeManager" thread (http://www.stevehopwoodforex.com/phpBB3 ... =21&t=3482
Author:  SteveHopwood [ Wed Dec 10, 2014 9:43 am ]
Post subject:  Holy Graily Bob

oliverjp » Wed Dec 10, 2014 2:21 am wrote:Hi Steve

Assuming suggested reason for immediate deletion of open orders is correct, I have slightly tweaked your ReadIndicatorValues() function to amend the logic so a wavy line detection is ignored if it occurs on the same candle as a Trend or Range signal. The wavy lines will still show on the chart because it is displaying from the indicator, but the EA will know to ignore the wavy lines and give preference to the Trend or Range signal.

Hope this allows you time for another cup of coffee in the morning. If not, please do chuck it away and code something more all encompassing :mrgreen:

All the best

Jeff
Millions of thanks Jeff. Hugely appreciated. :clap: :clap: :clap:

V 1t with Jeff's fix is in post 1 folks. It is an essential download if you cannot copy it for yourselves.

:xm:
Author:  SteveHopwood [ Wed Dec 10, 2014 9:58 am ]
Post subject:  Holy Graily Bob

rdg281 » Tue Dec 09, 2014 9:59 pm wrote:

This pattern happened since we started. First plus than minus, plus, minus etc
So case is when to take the profit and when restarting again.
I think that will be the game. Almost like the manual strategy of Bob :smile:
I think most of us are seeing this. Imagine being new here and starting HGB at the top end of the retrace. :arrrg:

Wolf, I am going to adopt your idea of shutting up shop for the day once a certain percentage of profit is hit; this will be a user input.

So, StopTradingAtProfitPercent = ?

Please post your suggestions for the default value.

:xm:
Author:  burmanfx [ Wed Dec 10, 2014 10:15 am ]
Post subject:  Holy Graily Bob

What about a percentage based, basket jumping stop? So once 10% is achieved jump overall stop to 5%, 10%, 15% profit etc. Keep up the great work Steve! Lot's of pips, now just need to hold on to them!
Author:  burmanfx [ Wed Dec 10, 2014 11:05 am ]
Post subject:  Holy Graily Bob

Another possible feature could be to kill all trades not in profit after x hours. weeding out bad trades, keeping the winners.
Author:  Gertje [ Wed Dec 10, 2014 11:06 am ]
Post subject:  Holy Graily Bob

SteveHopwood » Wed Dec 10, 2014 9:58 am wrote: I think most of us are seeing this. Imagine being new here and starting HGB at the top end of the retrace. :arrrg:

Wolf, I am going to adopt your idea of shutting up shop for the day once a certain percentage of profit is hit; this will be a user input.

So, StopTradingAtProfitPercent = ?

Please post your suggestions for the default value.

:xm:
5% would be nice. :D

I would suggest to also make a $-value entry, since the amount of UP is depending on the lotsize rather that the accountsize.

I trade 0.01x$1.000,- so 5% would be $50,- to start. After a while, when balance is $1.900,- the same size trades would have to chuck in $95,- to be closed by this feature.

V1s rocks, now upload the newer version.
All times are UTC Page 33 of 129