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

Gridtrading from daily open
https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?t=4666
Page 28 of 37
Author:  marcoFF [ Wed Apr 27, 2016 12:13 pm ]
Post subject:  Gridtrading from daily open

Gertje » Mon Apr 25, 2016 6:31 pm wrote:This morning I woke up to some 600 banked pis, and -90 floating across 6-7 pairs.
I used the nucleair option to close all out, and be done for the day.

More time to watch RnR in awe.... :yahoo:
Hi Gertje, are you using some kind of trade manager now? Or simply manual close after X grid opened?
Author:  made2ride [ Thu Apr 28, 2016 7:43 am ]
Post subject:  Gridtrading from daily open

My 1st post and 1st have to say thanks to everybody as I’ve learnt so much in the short time I’ve been here.
I’ve read through and found a reference but sadly no cure to an error message that I’m now getting with the “SendIndividualGridsAtExtremes” setting, which when set at true will only send buy stops correctly, the sell stops are returning alert messages with:

Sell stop: Lots 0.01: Price 1.4622: Bid 1.4548, (trying to place the sell stop above actual price as if sending a sell limit).
GBPUSD Greedy Wotsit OP_SELLSTOP order send failed with error(130): invalid stops

I have zero knowledge of coding but have looked through the EA code and the only thing I found was at line 1171 which read as SendBuyGrid that I changed for SendSellGrid but sadly this has not made any difference.
I have now downloaded the latest version and still have the same error. :arrrg:

Please tell me where I’m going wrong and how to proceed?
I am using Global Prime
Thanks Joe
Author:  Gertje [ Thu Apr 28, 2016 7:51 am ]
Post subject:  Gridtrading from daily open

marcoFF » Wed Apr 27, 2016 12:13 pm wrote:
Gertje » Mon Apr 25, 2016 6:31 pm wrote:This morning I woke up to some 600 banked pis, and -90 floating across 6-7 pairs.
I used the nucleair option to close all out, and be done for the day.

More time to watch RnR in awe.... :yahoo:
Hi Gertje, are you using some kind of trade manager now? Or simply manual close after X grid opened?
Simple manual close.
Author:  SteveHopwood [ Thu Apr 28, 2016 8:51 am ]
Post subject:  Gridtrading from daily open

made2ride » Thu Apr 28, 2016 7:43 am wrote:My 1st post and 1st have to say thanks to everybody as I’ve learnt so much in the short time I’ve been here.
I’ve read through and found a reference but sadly no cure to an error message that I’m now getting with the “SendIndividualGridsAtExtremes” setting, which when set at true will only send buy stops correctly, the sell stops are returning alert messages with:

Sell stop: Lots 0.01: Price 1.4622: Bid 1.4548, (trying to place the sell stop above actual price as if sending a sell limit).
GBPUSD Greedy Wotsit OP_SELLSTOP order send failed with error(130): invalid stops

I have zero knowledge of coding but have looked through the EA code and the only thing I found was at line 1171 which read as SendBuyGrid that I changed for SendSellGrid but sadly this has not made any difference.
I have now downloaded the latest version and still have the same error. :arrrg:

Please tell me where I’m going wrong and how to proceed?
I am using Global Prime
Thanks Joe
There is a fix for this in V 1e in post 2.

Add your own fix by copying this over the top of the code block starting at line 1186:

Code: Select all

      //Add a new grid at L4
      if (SendIndividualGridsAtExtremes)
      {
         if (BuyStops == 1)
         {
            price = NormalizeDouble(HighestBuyStopPrice + (DistanceBetweenTrades / factor), Digits);
            if (price <= Ask)
               price = NormalizeDouble(Ask + (DistanceBetweenTrades / factor), Digits);
               
            SendBuyGrid(Symbol(), OP_BUYSTOP, price, Lot);
         
         }//if (BuyStops == 1)
         
         if (SellStops == 1)
         {
            price = NormalizeDouble(LowestBuyStopPrice - (DistanceBetweenTrades / factor), Digits);
            if (price >= Bid)
               price = NormalizeDouble(Bid - (DistanceBetweenTrades / factor), Digits);
            
            SendBuyGrid(Symbol(), OP_SELLSTOP, price, Lot);
         
         }//if (SellStops  == 1)
         
         
      
      }//if (SendIndividualGridsAtExtremes)
:xm:
Author:  made2ride [ Thu Apr 28, 2016 9:18 am ]
Post subject:  Gridtrading from daily open

wow that was quick Steve
Thanks
Joe
Author:  SteveHopwood [ Thu Apr 28, 2016 9:32 am ]
Post subject:  Gridtrading from daily open

I left a conditional the wrong way around - my usual copy/paste/forgot-to-edit. Fixed in post 2.

Your own fix. Line 1192:
if (price >= Ask)

if (price <= Ask)

You might want to hold on a few minutes though. I am about to add offsetting into the mix.

:xm:
Author:  marcoFF [ Thu Apr 28, 2016 9:35 am ]
Post subject:  Gridtrading from daily open

SteveHopwood » Thu Apr 28, 2016 9:51 am wrote:
made2ride » Thu Apr 28, 2016 7:43 am wrote:My 1st post and 1st have to say thanks to everybody as I’ve learnt so much in the short time I’ve been here.
I’ve read through and found a reference but sadly no cure to an error message that I’m now getting with the “SendIndividualGridsAtExtremes” setting, which when set at true will only send buy stops correctly, the sell stops are returning alert messages with:

Sell stop: Lots 0.01: Price 1.4622: Bid 1.4548, (trying to place the sell stop above actual price as if sending a sell limit).
GBPUSD Greedy Wotsit OP_SELLSTOP order send failed with error(130): invalid stops

I have zero knowledge of coding but have looked through the EA code and the only thing I found was at line 1171 which read as SendBuyGrid that I changed for SendSellGrid but sadly this has not made any difference.
I have now downloaded the latest version and still have the same error. :arrrg:

Please tell me where I’m going wrong and how to proceed?
I am using Global Prime
Thanks Joe
There is a fix for this in V 1e in post 2.

Add your own fix by copying this over the top of the code block starting at line 1186:

Code: Select all

      //Add a new grid at L4
      if (SendIndividualGridsAtExtremes)
      {
         if (BuyStops == 1)
         {
            price = NormalizeDouble(HighestBuyStopPrice + (DistanceBetweenTrades / factor), Digits);
            if (price <= Ask)
               price = NormalizeDouble(Ask + (DistanceBetweenTrades / factor), Digits);
               
            SendBuyGrid(Symbol(), OP_BUYSTOP, price, Lot);
         
         }//if (BuyStops == 1)
         
         if (SellStops == 1)
         {
            price = NormalizeDouble(LowestBuyStopPrice - (DistanceBetweenTrades / factor), Digits);
            if (price >= Bid)
               price = NormalizeDouble(Bid - (DistanceBetweenTrades / factor), Digits);
            
            SendBuyGrid(Symbol(), OP_SELLSTOP, price, Lot);
         
         }//if (SellStops  == 1)
         
         
      
      }//if (SendIndividualGridsAtExtremes)
:xm:
Thanks for that Steve, it's possible to add a trade manager like suggest by Zennor some post ago?
Something can put the trade in be/trailing the price grid after grid?
In any case thanks for your effort.
Marco.

Ps. not a bad start for new demo with adx, he like the jpy pair last night.. :yahoo:
less 24hr trading..
notbadstart-adx.jpg
Author:  SteveHopwood [ Thu Apr 28, 2016 10:46 am ]
Post subject:  Gridtrading from daily open

It is not so easy to add offsetting as I thought, and sorting out the bloop I found when copying the code across took longer than it should have done, so I have run out of time. I will finish off later.

:xm:
Author:  SteveHopwood [ Thu Apr 28, 2016 6:38 pm ]
Post subject:  Gridtrading from daily open

V 1f is in post 2, with offsetting implemented. I got into a real tangle doing this and guarantee nothing. 1f should go nowhere near a live account yet.

There is an offsetting inputs section just below the ADX inputs:
  • AllowSimpleAndComplexOffsetting: this allows the offsetting of the biggest winner in one group of trades against the biggest loser in the group, and offsetting a number of trades from the winning side of a hedge against the biggest loser on the other side.
  • AllowSingleSideOffsets: allows offsetting a group of trades against a loser from the same group of trades. This is not allowed if AllowSimpleAndComplexOffsetting = false
:xm:
Author:  zaguy [ Thu Apr 28, 2016 6:44 pm ]
Post subject:  Gridtrading from daily open

Once again, a sincere thanks for all the hard work Steve.
All times are UTC Page 28 of 37