Holy Graily Bob 'n Grid

EA's inspired by nanningbob's work here, especially those based on his 240 Moving Average trend detection filter.
Post Reply
User avatar
cyberevil
Trader
Posts: 95
Joined: Mon Oct 26, 2015 5:55 pm
Location: Vancouver, BC

Holy Graily Bob 'n Grid

Post by cyberevil »

Here is my current working set file. It's running on some very basic settings for the time being. Once I get the basic logic up and running and my heart is satisfied then i'll start playing with all the bells and whistles Steve has added ;)

PS. my set file keeps changing so :?
PSS don't use it on live account.
You do not have the required permissions to view the files attached to this post.
User avatar
SteveHopwood
Owner
Posts: 9904
Joined: Tue Nov 15, 2011 8:43 am
Location: Misterton - an insignificant village in England. Very pleasant to live in.

Holy Graily Bob 'n Grid

Post by SteveHopwood »

Anybody using 1u to fill in a missing grid will have come across the same problems I did. I have fixed them in V 1v in post 1.

To make the changes yourselves, go to line 900 and copy this over the top of the code snippet:

Code: Select all

   //Force a pending grid order send
   if (SendGrid)
   {
      int type = PendingOrderType + 2;//enum starts at 0, so we need to add 2 to make the order a stop or limit
      int retno = MessageBox("Please confirm that you want to send a pending trade grid", "Confirm grid sending", MB_YESNOCANCEL);
            
      if (retno == IDYES)
      {
         double price = NormalizeDouble(Bid + (DistanceBetweenTrades / factor), Digits);//Defaults to buy stop/sell limit
         if (type == 2 || type == 5)//Buy limit sell stop
            price = NormalizeDouble(Bid - (DistanceBetweenTrades / factor), Digits);
         if (!CloseEnough(GridStartPrice, 0))
            price = GridStartPrice;
         if (type == 2 || type == 4)
            SendBuyGrid(Symbol(), type, price, Lot);
         else
            SendSellGrid(Symbol(), type, price, Lot);
         RemoveExpert = true;
         Alert(Symbol() + ": I have removed myself from the chart.");
         ExpertRemove();
         return(0);               
      }//if (retno == IDYES) 
   }//if (SendGrid)
:xm:
Read the effing manual, ok?

Afterprime is the official SHF broker. Read about them at https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?p=175790#p175790.

I still suffer from OCCD. Good thing, really.

Anyone here feeling generous? My paypal account is always in the market for a tiny donation. pianodoodler@hotmail.com is the account.

To see The Weekly Roundup of stuff you guys might have missed Click here

My special thanks to Thomas (tomele) for all the incredible work he does here.
Peepaws
Trader
Posts: 121
Joined: Thu Nov 27, 2014 11:19 pm

Holy Graily Bob 'n Grid

Post by Peepaws »

SteveHopwood » Sun Jan 31, 2016 3:00 pm wrote:V 1u is in post 1.

It occurred to me that there might be times when we want to add a fresh grid - I do at the mo on that GJ chart I posted. I have added this functionality.

Loving this new feature Steve! Thank you I think the Ea is perfect now!

:clap: :clap: :clap: :clap: :clap:
User avatar
tonyharmony
Trader
Posts: 148
Joined: Sat Dec 20, 2014 10:54 pm
Location: Ipswich, Queensland Australia

Holy Graily Bob 'n Grid

Post by tonyharmony »

SteveHopwood » Mon Feb 01, 2016 8:51 am wrote:Anybody using 1u to fill in a missing grid will have come across the same problems I did. I have fixed them in V 1v in post 1.

To make the changes yourselves, go to line 900 and copy this over the top of the code snippet:

Code: Select all

   //Force a pending grid order send
   if (SendGrid)
   {
      int type = PendingOrderType + 2;//enum starts at 0, so we need to add 2 to make the order a stop or limit
      int retno = MessageBox("Please confirm that you want to send a pending trade grid", "Confirm grid sending", MB_YESNOCANCEL);
            
      if (retno == IDYES)
      {
         double price = NormalizeDouble(Bid + (DistanceBetweenTrades / factor), Digits);//Defaults to buy stop/sell limit
         if (type == 2 || type == 5)//Buy limit sell stop
            price = NormalizeDouble(Bid - (DistanceBetweenTrades / factor), Digits);
         if (!CloseEnough(GridStartPrice, 0))
            price = GridStartPrice;
         if (type == 2 || type == 4)
            SendBuyGrid(Symbol(), type, price, Lot);
         else
            SendSellGrid(Symbol(), type, price, Lot);
         RemoveExpert = true;
         Alert(Symbol() + ": I have removed myself from the chart.");
         ExpertRemove();
         return(0);               
      }//if (retno == IDYES) 
   }//if (SendGrid)
:xm:
Thanks for the update Steve!

Decided to have a go at updating myself, rather than just downloading...
Once I figured out to remove the numbers, as it copies them as well, I compiled and had great success! :yahoo:

I think I'll keep doing this when the time arises as it is a new trick I am learning.
Who says they can't teach an old dog new tricks! :lol:

Cheers
One can't learn from one's success, but one can learn an enormous amount from one's failures! Determination to succeed is the only goal....
User avatar
cozybooks
Trader
Posts: 301
Joined: Wed Mar 27, 2013 1:33 am

Holy Graily Bob 'n Grid

Post by cozybooks »

Hey Steve,

I'm not convinced I'm encountering a real problem but thought I'd post it in case anyone else sees the same thing. I've had the same issue with rev U and V.

I initially had the problem on a one hour timeframe, so I tried setting up tests with a 5 minute timeframe, but both had the same problem.

I'm doing Stop_Orders_Only with a grid size of 5.

I'm using the ATR setting for TP, SL and grid. The grid size works fine, and the TP on the pending buy and sell stop orders is correct, but the SL on the pendings orders (both long and short) is zero.

I was using an oddball setting for SL ( .72 of a 4 Hour ATR with 20 periods), so I tried using a straight 1.0 instead of the .72, but had the same issue. I then tried putting in a SL at the top of the EA, thinking maybe if there was an initial stop loss, then it would change it. Same problem, except on my 5 minute timeframe test (just to get a signal more quickly), it got as far as the first four sell stop orders (all with a SL of zero instead of the ATR setting), then hit an error trying to send the 5th pending sell order for an invalid stop.

The journal shows sl: 0.00000 on the pending orders sent.

I was getting this problem on an ECN broker account, so I tried setting it up on my non-ecn broker, but that's the setup where I got the invalid stop error trying to generate the 5th pending.

Sorry in advance if I'm missing something obvious. It's still early Monday here in the U.S. and my brain isn't very functional even at its peak!!
User avatar
SteveHopwood
Owner
Posts: 9904
Joined: Tue Nov 15, 2011 8:43 am
Location: Misterton - an insignificant village in England. Very pleasant to live in.

Holy Graily Bob 'n Grid

Post by SteveHopwood »

cozybooks » Mon Feb 01, 2016 2:28 pm wrote:Hey Steve,

I'm not convinced I'm encountering a real problem but thought I'd post it in case anyone else sees the same thing. I've had the same issue with rev U and V.

I initially had the problem on a one hour timeframe, so I tried setting up tests with a 5 minute timeframe, but both had the same problem.

I'm doing Stop_Orders_Only with a grid size of 5.

I'm using the ATR setting for TP, SL and grid. The grid size works fine, and the TP on the pending buy and sell stop orders is correct, but the SL on the pendings orders (both long and short) is zero.

I was using an oddball setting for SL ( .72 of a 4 Hour ATR with 20 periods), so I tried using a straight 1.0 instead of the .72, but had the same issue. I then tried putting in a SL at the top of the EA, thinking maybe if there was an initial stop loss, then it would change it. Same problem, except on my 5 minute timeframe test (just to get a signal more quickly), it got as far as the first four sell stop orders (all with a SL of zero instead of the ATR setting), then hit an error trying to send the 5th pending sell order for an invalid stop.

The journal shows sl: 0.00000 on the pending orders sent.

I was getting this problem on an ECN broker account, so I tried setting it up on my non-ecn broker, but that's the setup where I got the invalid stop error trying to generate the 5th pending.

Sorry in advance if I'm missing something obvious. It's still early Monday here in the U.S. and my brain isn't very functional even at its peak!!
Read the user guide. It is there to stop me having to read damn fool questions.
Read the effing manual, ok?

Afterprime is the official SHF broker. Read about them at https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?p=175790#p175790.

I still suffer from OCCD. Good thing, really.

Anyone here feeling generous? My paypal account is always in the market for a tiny donation. pianodoodler@hotmail.com is the account.

To see The Weekly Roundup of stuff you guys might have missed Click here

My special thanks to Thomas (tomele) for all the incredible work he does here.
User avatar
tonyharmony
Trader
Posts: 148
Joined: Sat Dec 20, 2014 10:54 pm
Location: Ipswich, Queensland Australia

Holy Graily Bob 'n Grid

Post by tonyharmony »

cyberevil » Mon Feb 01, 2016 8:00 am wrote:Here is my current working set file. It's running on some very basic settings for the time being. Once I get the basic logic up and running and my heart is satisfied then i'll start playing with all the bells and whistles Steve has added ;)

PS. my set file keeps changing so :?
PSS don't use it on live account.
Hey Cyber, how are you going mate? Thanks for the use of your setfile... :D

Just a quick question if you don't mind me asking? Have you adjusted your set file to suit Version 1v?

Just a little curious to know what you would use in your 'Grid Inputs', under Grid Type as your setfile suggests '0'!

Which would you use 'Stop_And_Limit_Orders', or just the 'Stop_Orders_Only' to replace the '0' in your style of trading?

I am a bit like you you, as some days I like to watch the market, get in and out, and that's my trading done for the day....

Interested to know your thoughts, thanks... :D

Cheers
Tony
One can't learn from one's success, but one can learn an enormous amount from one's failures! Determination to succeed is the only goal....
FXCoder
Posts: 5
Joined: Fri Nov 27, 2015 12:52 pm
Location: Sydney, Australia

Holy Graily Bob 'n Grid

Post by FXCoder »

Hi Tony,
A value of 0 in GridType represents "Stop Orders Only". A value of 1 represents "Stop and Limit Orders".

Cheers,

Bob
Just a little curious to know what you would use in your 'Grid Inputs', under Grid Type as your setfile suggests '0'!

Which would you use 'Stop_And_Limit_Orders', or just the 'Stop_Orders_Only' to replace the '0' in your style of trading?
User avatar
tonyharmony
Trader
Posts: 148
Joined: Sat Dec 20, 2014 10:54 pm
Location: Ipswich, Queensland Australia

Holy Graily Bob 'n Grid

Post by tonyharmony »

FXCoder » Tue Feb 02, 2016 11:12 am wrote:Hi Tony,
A value of 0 in GridType represents "Stop Orders Only". A value of 1 represents "Stop and Limit Orders".

Cheers,

Bob
Just a little curious to know what you would use in your 'Grid Inputs', under Grid Type as your setfile suggests '0'!

Which would you use 'Stop_And_Limit_Orders', or just the 'Stop_Orders_Only' to replace the '0' in your style of trading?
Thanks Bob, I appreciate the clarification...

I thought that may have been the case as it is the default option in HGB'nG V 1v...

Cheers :D
Tony
One can't learn from one's success, but one can learn an enormous amount from one's failures! Determination to succeed is the only goal....
User avatar
SteveHopwood
Owner
Posts: 9904
Joined: Tue Nov 15, 2011 8:43 am
Location: Misterton - an insignificant village in England. Very pleasant to live in.

Holy Graily Bob 'n Grid

Post by SteveHopwood »

GridType is an enumeration, ENUM in the code. These are array constants that allow coders to show users a list of relevant inputs only. They are represented in set files by their integer equivalents, so Stop_Orders_Only is represented by 0, whilst Stop_And_Limit_Orders is represented by 1.

Fledgling coders, I only came across enumerations a few weeks ago; they are really useful. There are a number of inbuilt enumeration constants accessed through the ENUM command, as in:
extern ENUM_TIMEFRAMES TradingTimeFrame=PERIOD_M15;
This would be represented by 15 in the set file.

Rene showed me how to define my own:

Code: Select all

enum GridStrategyType
{
   Stop_Orders_Only,
   Stop_And_Limit_Orders
};

Then FXCoder showed me how to present them as a user input:
input GridStrategyType GridType=Stop_Orders_Only;

Useful thingies.

:xm:
Read the effing manual, ok?

Afterprime is the official SHF broker. Read about them at https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?p=175790#p175790.

I still suffer from OCCD. Good thing, really.

Anyone here feeling generous? My paypal account is always in the market for a tiny donation. pianodoodler@hotmail.com is the account.

To see The Weekly Roundup of stuff you guys might have missed Click here

My special thanks to Thomas (tomele) for all the incredible work he does here.
Post Reply

Return to “Thingy Bob EA's”