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

Gertje plus Squalou plus Forexhard EA
https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?t=485
Page 2 of 18
Author:  jb68 [ Mon Apr 16, 2012 4:39 am ]
Post subject:  Re: Gertje plus Squalou plus Forexhard EA

acostafulano wrote:Is this supposed to be this way?:
FH.png
I'd like to add, though, that despite this weird thingy, my first gbpjoy breakout trade and correspondent grid fired up correctly :)

edit: 3 trades fired up now. Everything looks ok
Hi,
The thing you encircled with red is normal. That is Empty Value (NULL) on Empty4 and means there is no new CZ box forming. Steve DID a great job printing these variables but you have to understand this is a working stage (alpha or beta ) for the EA so this weird values might be removed from final version.
Author:  acostafulano [ Mon Apr 16, 2012 4:50 am ]
Post subject:  Re: Gertje plus Squalou plus Forexhard EA

jb68 wrote:
acostafulano wrote:Is this supposed to be this way?:
FH.png
I'd like to add, though, that despite this weird thingy, my first gbpjoy breakout trade and correspondent grid fired up correctly :)

edit: 3 trades fired up now. Everything looks ok
Hi,
The thing you encircled with red is normal. That is Empty Value (NULL) on Empty4 and means there is no new CZ box forming. Steve DID a great job printing these variables but you have to understand this is a working stage (alpha or beta ) for the EA so this weird values might be removed from final version.
Understood :) Just pointing out everything that appears to be weird to help get a bug-free EA. The concept is really promising
Author:  SteveHopwood [ Mon Apr 16, 2012 5:33 am ]
Post subject:  Re: Gertje plus Squalou plus Forexhard EA

jb68 wrote:
acostafulano wrote:Is this supposed to be this way?:
FH.png
I'd like to add, though, that despite this weird thingy, my first gbpjoy breakout trade and correspondent grid fired up correctly :)

edit: 3 trades fired up now. Everything looks ok
Hi,
The thing you encircled with red is normal. That is Empty Value (NULL) on Empty4 and means there is no new CZ box forming. Steve DID a great job printing these variables but you have to understand this is a working stage (alpha or beta ) for the EA so this weird values might be removed from final version.
They have already gone. They served their purpose.

I also got the 10 trades at once thingy, so defo a bug to hunt down. Made 2.5% when the market cooperated, but no chance of a real money account being so blessed. :lol:

:D
Author:  plateman [ Mon Apr 16, 2012 6:40 am ]
Post subject:  Re: Gertje plus Squalou plus Forexhard EA

Give this EA a chance, it has only been running for a few hours, I'm trading 0.2 lots and currently $360 up. I had two instances of multiple trades but each one closed at a (small) profit.
Author:  spotdespot [ Mon Apr 16, 2012 8:35 am ]
Post subject:  Re: Gertje plus Squalou plus Forexhard EA

SteveHopwood wrote:
jb68 wrote:
acostafulano wrote:Is this supposed to be this way?:
FH.png
I'd like to add, though, that despite this weird thingy, my first gbpjoy breakout trade and correspondent grid fired up correctly :)

edit: 3 trades fired up now. Everything looks ok
Hi,
The thing you encircled with red is normal. That is Empty Value (NULL) on Empty4 and means there is no new CZ box forming. Steve DID a great job printing these variables but you have to understand this is a working stage (alpha or beta ) for the EA so this weird values might be removed from final version.
They have already gone. They served their purpose.

I also got the 10 trades at once thingy, so defo a bug to hunt down. Made 2.5% when the market cooperated, but no chance of a real money account being so blessed. :lol:

:D
I had this too but also they also opened at 10 x the lot size (the initial trades opened at the specified lot size). I think this was because I had 0.2 as the trade size, 0.1 as the lots per 1000 or balance and a 20k balance......whoops the first time this happened I got away with it, second time (as I was looking at the first wondering what went on) I was very glad it wasn't live :lol:
Author:  SteveHopwood [ Mon Apr 16, 2012 9:13 am ]
Post subject:  Re: Gertje plus Squalou plus Forexhard EA

Latest update in post 1, fixing the multiple-trades thingy. It was the usual, a copy/paste/forgot-to-edit bloop.

Coders, to save a re-download go to
void HasSellFilled()

and find this line of code:
string name = NextBuyLineName;

and change the highlighted bit then recompile
string name = NextSellLineName;

I have reintroduced the BB0, BB1 etc value displays until we are sure the code is watertight.

I ran a visual backtest, M15 Open prices; this is what pointed me to the bloop. Allowing the test to continue, I noticed that there are occasional double trades at the same level. It looks as though the pending trade line deletion fails from time to time, but I have no idea why.

Here is the void HasBuyFilled() function with additional comments to explain my logic more fully:

Code: Select all

void HasBuyFilled()
{
   //This function examines the Bid to see if a pending Buy price has been reached, and sends the trade if so.
   //Uses the Bid for buys also, as this is the price we see on the chart

   double take, stop, price;
   int type;
   bool CancelTrade = false;

   
   //Set pending price 
   string name = NextBuyLineName;
   if (name != "")
   {
      if (ObjectFind(name) > -1) double PendingPrice = ObjectGet(name, OBJPROP_PRICE1);
   }//if (name != "")
   
   //Initial trade. If risetoline exists, meaning that the first trade has yet to be sent.
   if (ObjectFind(risetoline) > -1) 
   {
      name = risetoline;
      PendingPrice = ObjectGet(name, OBJPROP_PRICE1);
   }//if (ObjectFind(risetoline) > -1) 
   
   RefreshRates();
   if (Bid >= PendingPrice && PendingPrice > 0)
   {
      //Ensure that OpenTrades + 1 is < ((NoOfTrades * 2) -1). If it is == ((NoOfTrades * 2) -1),
      //a further trade would leave the grid fully populated with hedged trades achieving nothing but
      //paying the crim shed-loads of swap. In this case, close the position.
      if (IsBasketStopLossHit(OP_BUY) )
      {
         CloseAllTrades();
         if (ForceTradeClosure) CloseAllTrades();
         DeleteRemainingPendingLines();//Remove pending price lines         
         return;
      }//if (IsBasketStopLossHit(OP_BUY) )
      
      //If we are looking for an initial trade, only take it if the previous candle closed below the line
      if (name == risetoline)
      {
         if (iOpen(NULL, BoxTimeFrame, 1) >= PendingPrice) return;
      }//if (name == risetoline)
            
      price = Ask;
      type = OP_BUY;
      
      
      bool result = SendSingleTrade(type, TradeComment, SendLot, price, stop, take);
      if (result)
      {
         if (name == risetoline) SetUpBuyGrid();
         //Move the pending sell to half-way up the CZ box.
         if (ObjectFind(falltoline) > -1 && OpenTrades == 0)
         {
            double ltarget = ObjectGet(falltoline, OBJPROP_PRICE1);
            double extent = (PendingPrice - ltarget) / 2;
            price = NormalizeDouble(ltarget + extent, Digits);
            ObjectMove(falltoline, 0, Time[0], price);
         }//if (ObjectFind(falltoline) > -1)
         //Delete the pending trade line
         ObjectDelete(name);         
      }//if (result)
   }//if (Bid >= PendingPrice && PendingPrice > 0)
   

}//End void HasBuyFilled()
:D
Author:  magft [ Mon Apr 16, 2012 9:38 am ]
Post subject:  Re: Gertje plus Squalou plus Forexhard EA

SteveHopwood wrote:
forexhard wrote:Steve, there is a flaw in the indicator's box-making logic.

The idea is not to simply make boxes with a static/fixed height parameter. It should be more flexible than that. Just as the number of bars is allowed to grow wider even though the minimum is 30, the height in pips should be allowed to grow shorter even though the maximum is 30p.

The attached pics show the same box. But the white frame shows how big it should really be.

As a result, out of 100 possible CZ's, you could literally have 100 different heights and widths.
Over to the indi coders. I haven't a clue how the code works. Indi code leaves me looking even blanker than normal and saying, "Eh? Whut?"

It probably doesn't matter too much here, given the nature of the grid trading, but if anyone can correct this, then that would be great.

:D

Great work going on here, i've been busy with other projects, if no one else gets this sorted i'll have a look tonight. I'm familiar with the indy code so i'll see how we can make this work as required. I'll have a scan for anything that may be out of place. Any other issues whilst i'm at it?

Regards

Mike
Author:  SteveHopwood [ Mon Apr 16, 2012 10:43 am ]
Post subject:  Re: Gertje plus Squalou plus Forexhard EA

magft wrote:Great work going on here, i've been busy with other projects, if no one else gets this sorted i'll have a look tonight. I'm familiar with the indy code so i'll see how we can make this work as required. I'll have a scan for anything that may be out of place. Any other issues whilst i'm at it?

Regards

Mike
I don't think so, Mike. Thanks; it would be great for you to have a look at this little problem.

I have attached sq's original, in case that helps.

Cheers

:D
Author:  magft [ Mon Apr 16, 2012 11:02 am ]
Post subject:  Re: Gertje plus Squalou plus Forexhard EA

SteveHopwood wrote:
magft wrote:Great work going on here, i've been busy with other projects, if no one else gets this sorted i'll have a look tonight. I'm familiar with the indy code so i'll see how we can make this work as required. I'll have a scan for anything that may be out of place. Any other issues whilst i'm at it?

Regards

Mike
I don't think so, Mike. Thanks; it would be great for you to have a look at this little problem.

I have attached sq's original, in case that helps.

Cheers

:D
Steve

That is a really old version of the indy, in the comments v1.8. The one you have in first post is v1.13 but i have v1.13_R1 as well which has a minor mod. Can you remember what changes you made? I have a quick scan and looks like you have set defaults and commented out drawing bits is that correct?

Ive attached v1.13_R1 for reference, in the top the history states

Code: Select all

 * - v1.13 R1 (2011.09.22):
 *   With AutoBoxRange=true:
 *   Box continue fixed. Box Range changed when new Day starts because of change in ATR value.
 *   Also Box change values when variable "_period" no longer rise. "i+_period-1" points then to the wrong bar.
 *   In display_stats() Division by Zero 'num_buy' and 'num_sell' avoided.
This may be the issue FH was referring to, i'll have a play around tonight, day job beckons at the mo.

Regards

Mike
Author:  SteveHopwood [ Mon Apr 16, 2012 11:43 am ]
Post subject:  Re: Gertje plus Squalou plus Forexhard EA

magft wrote:
SteveHopwood wrote:
magft wrote:Great work going on here, i've been busy with other projects, if no one else gets this sorted i'll have a look tonight. I'm familiar with the indy code so i'll see how we can make this work as required. I'll have a scan for anything that may be out of place. Any other issues whilst i'm at it?

Regards

Mike
I don't think so, Mike. Thanks; it would be great for you to have a look at this little problem.

I have attached sq's original, in case that helps.

Cheers

:D
Steve

That is a really old version of the indy, in the comments v1.8. The one you have in first post is v1.13 but i have v1.13_R1 as well which has a minor mod. Can you remember what changes you made? I have a quick scan and looks like you have set defaults and commented out drawing bits is that correct?

Ive attached v1.13_R1 for reference, in the top the history states

Code: Select all

 * - v1.13 R1 (2011.09.22):
 *   With AutoBoxRange=true:
 *   Box continue fixed. Box Range changed when new Day starts because of change in ATR value.
 *   Also Box change values when variable "_period" no longer rise. "i+_period-1" points then to the wrong bar.
 *   In display_stats() Division by Zero 'num_buy' and 'num_sell' avoided.
This may be the issue FH was referring to, i'll have a play around tonight, day job beckons at the mo.

Regards

Mike
Thanks Mike. It is too long ago to remember what I was trying to do. I have a sqDynamicBreakoutBox.old in the folder, so I guess this was the original so I could revert once I had thoroughly screwed things up. :lol:
All times are UTC Page 2 of 18