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

Holy Graily Bob 'n Grid
https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?t=4525
Page 84 of 99
Author:  Reamasesa [ Mon May 09, 2016 6:56 am ]
Post subject:  Holy Graily Bob 'n Grid

Cayrema » Mon May 09, 2016 5:57 am wrote:Hello family.
I want to thank Steve and the others who have been involved in the creation of this great EA. I have been using v1w with success the last few days and when Steve came up with the experimental version I threw it on my demo. This morning I have been receiving errors from the experimental version. The bot places pending stops, then a few minutes later it deletes them. Is anybody else having the same error or am I the only one?
Am using Global Prime demo.
Hi,

I had something like that too with nearly all versions. Try disabling the equity/margin check, I'm not in front of my charts so I don't remember but it's "kiwi" something.
Author:  SteveHopwood [ Mon May 09, 2016 7:53 am ]
Post subject:  Holy Graily Bob 'n Grid

Ehup folks.

You may as well take the Experimental version off demo for now - I have. I will sort out the problem later.

:xm:
Author:  SteveHopwood [ Mon May 09, 2016 8:45 am ]
Post subject:  Holy Graily Bob 'n Grid

I did not have to look for the solution myself - Heraclees had already sent it in a pm. :clap: :clap: :clap: :clap: :clap:

line 5860:
if (PendingTradesTotal < (GridSize * 2) )//There should be up to GridSize * 2

should be:
if (PendingTradesTotal < GridSize)

The grid is GridSize * 2 when trading the original systems; this one only has GridSize trades. It just needs a teensy bit of footwork to accommodate all three systems and I will do that later.

Peasant's fix in 1a in post 1.

1a send a whole bunch of pendings as soon as I made the fix, and they have remained in place.

:xm:
Author:  SteveHopwood [ Mon May 09, 2016 12:53 pm ]
Post subject:  Holy Graily Bob 'n Grid

Experimental version 1b is in post one, with an enhancement inspired by Heraclees.

Taking a buy signal, the ea will only add pending buys if the market falls, when none of the originals have filled.

Copy this over the top of void CanWeAddAnotherPendingTrade() to make the changes yourself.

:xm:

Code: Select all

void CanWeAddAnotherPendingTrade()
{

   //This function adds more pending trades if the market initially moves in the opposite direction 
   //of the signal.
   
   double price = 0;
   bool result = false;
   double stop = 0, take = 0;
   
   //Another buy stop?
   if (!BuyOpen)//Only if the trading sequence has not already started
      if (BuyStopOpen)
      {
         price = NormalizeDouble(LowestBuyStopPrice - ((DistanceBetweenTrades * 2) / factor), Digits);
         if (Bid <= price)
            if (!DoesTradeExist(OP_BUYSTOP, price))
            {
               take = CalculateTakeProfit(OP_BUY, price);
               stop = CalculateStopLoss(OP_BUY, price);
               result = SendSingleTrade(Symbol(), OP_BUYSTOP, TradeCommentCOT, Lot, price, stop, take);
            }//if (!DoesTradeExist(OP_BUYSTOP, price))
      }//if (BuyStopOpen)


   //Another sell stop?
   if (!SellOpen)
      if (SellStopOpen)
      {
         price = NormalizeDouble(HighestSellStopPrice + ((DistanceBetweenTrades * 2) / factor), Digits);
         if (Bid >= price)
            if (!DoesTradeExist(OP_SELLSTOP, price))
            {
               take = CalculateTakeProfit(OP_SELL, price);
               stop = CalculateStopLoss(OP_SELL, price);
               result = SendSingleTrade(Symbol(), OP_SELLSTOP, TradeCommentCOT, Lot, price, stop, take);
            }//if (!DoesTradeExist(OP_BUYSTOP, price))
      }//if (SellStopOpen)


}//End void CanWeAddAnotherPendingTrade()
Author:  Reamasesa [ Mon May 09, 2016 4:08 pm ]
Post subject:  Holy Graily Bob 'n Grid

Hi,

Getting tons of "invalid stops" all of a sudden from the experimental version. I can't attach my set file, it used to work perfectly with the regular version and the first experimental version.
Not sure what had changed.

Grid size is 5, distance is 20, no ATR for grid or anything.

Thanks.
Author:  piter44 [ Tue May 10, 2016 6:50 am ]
Post subject:  Holy Graily Bob 'n Grid

Reamasesa » Mon May 09, 2016 4:08 pm wrote:Hi,

Getting tons of "invalid stops" all of a sudden from the experimental version. I can't attach my set file, it used to work perfectly with the regular version and the first experimental version.
Not sure what had changed.

Grid size is 5, distance is 20, no ATR for grid or anything.

Thanks.
Same here with the experimental version, I receive dozen of errors 130: invalid stop
Author:  senzhi [ Tue May 10, 2016 7:06 am ]
Post subject:  Holy Graily Bob 'n Grid

piter44 » Tue May 10, 2016 7:50 am wrote:
Reamasesa » Mon May 09, 2016 4:08 pm wrote:Hi,

Getting tons of "invalid stops" all of a sudden from the experimental version. I can't attach my set file, it used to work perfectly with the regular version and the first experimental version.
Not sure what had changed.

Grid size is 5, distance is 20, no ATR for grid or anything.

Thanks.
Same here with the experimental version, I receive dozen of errors 130: invalid stop
Confirmed, albeit only where the stop orders would have replaced the usual stop limits. I get the error but the stop orders are still placed.

Mind you, not GP, Darwinex demo.
Author:  Maximilian [ Tue May 10, 2016 7:56 am ]
Post subject:  Holy Graily Bob 'n Grid

Hi guys,
see the following charts. Offsetting worked like a charm. Anyhow now the positions (EURUSD) are not hedged anymore which lead to the situation, that there are no SLs/ TPs and in case of the downtrend continuation a leaky toilet. I was thinking about solutions but my shrinking brain is too narrowminded to give me a clue if the following points are valid and worth to automate: either send a new (full? / trend following?) grid if the last hedged position is closed because of offsetting, or set emergency SLs and wait for trend reversal. Last one could obvoiusly result in even deeper DD for a longer period. When I had the time I did send manually a full grid, which worked quite well.
What do you do in such situations? Or did I miss some thing?
Cheers Max
Author:  SteveHopwood [ Tue May 10, 2016 8:45 am ]
Post subject:  Holy Graily Bob 'n Grid

Maximilian » Tue May 10, 2016 7:56 am wrote:Hi guys,
see the following charts. Offsetting worked like a charm. Anyhow now the positions (EURUSD) are not hedged anymore which lead to the situation, that there are no SLs/ TPs and in case of the downtrend continuation a leaky toilet. I was thinking about solutions but my shrinking brain is too narrowminded to give me a clue if the following points are valid and worth to automate: either send a new (full? / trend following?) grid if the last hedged position is closed because of offsetting, or set emergency SLs and wait for trend reversal. Last one could obvoiusly result in even deeper DD for a longer period. When I had the time I did send manually a full grid, which worked quite well.
What do you do in such situations? Or did I miss some thing?
Cheers Max
I have been managing these situations by sending a new grid in the appropriate direction. On my todo list is generating some scripts to do this for those of us viewing our trades on a different machine to that which is doing the trading.

I will have a look and see if the bot can be coded to deal with the situation you describe.

:xm:
Author:  Maximilian [ Tue May 10, 2016 8:49 am ]
Post subject:  Holy Graily Bob 'n Grid

I have been managing these situations by sending a new grid in the appropriate direction. On my todo list is generating some scripts to do this for those of us viewing our trades on a different machine to that which is doing the trading.

I will have a look and see if the bot can be coded to deal with the situation you describe.

:xm:
:clap: :good: :yahoo:
All times are UTC Page 84 of 99