Troubleshooting: EA opens trades (backtester) when using one fib level parameter but not two

 

Hello,

I am tagging the only moderators I am aware of @Keith Watford  @MetaQuotes  in case William Roeder decides to comment on another one of my questions harassing me and then playing the victim.  From what I can see I have multiple people reading my questions but since they keep turning into back and forths with WIlliam, unprovoked on my part, I suspect I am allowing him to make me look hostile when I am just trying to defend myself against his cyber bullying and possibly driving other contributors away.  Since I am not the first one to make an issue of how he replies to people @Alain Verleyen, I would hope to get some type of resolution to this, and maybe just this preface to my question will get him to leave me alone if he doesn't intend on being cordial.

Here are my first two questions & unpleasant interactions with William 1 & 2.

NOW MY QUESTION....

I am working on another condition for opening trades with my EA and it will open trades in the backtester when using 1 fib level as an if statement but not 2.  

//Weekly Candles
bool LWblsh = iClose(NULL,PERIOD_W1,1) > iOpen(NULL,PERIOD_W1,1),
     LWbrsh = iClose(NULL,PERIOD_W1,1) < iOpen(NULL,PERIOD_W1,1),
     WbreakH = iHigh(NULL,PERIOD_W1,0) > iHigh(NULL,PERIOD_W1,1),
     WbreakL = iLow(NULL,PERIOD_W1,0) < iLow(NULL,PERIOD_W1,1),
     HODhrLW = iHigh(NULL,PERIOD_D1,0) > iHigh(NULL,PERIOD_W1,1),
     HODhrYD = iHigh(NULL,PERIOD_D1,0) > iHigh(NULL,PERIOD_D1,1),
     LODlrLW = iLow(NULL,PERIOD_D1,0) < iLow(NULL,PERIOD_W1,1),
     LODlrYD = iLow(NULL,PERIOD_D1,0) < iLow(NULL,PERIOD_D1,1);
double LWL = iLow(NULL,PERIOD_W1,1),
       LWH = iHigh(NULL,PERIOD_W1,1),
       TWL = iLow(NULL,PERIOD_W1,0),
       TWH = iHigh(NULL,PERIOD_W1,0),
       brknblLW38 = NormalizeDouble(TWH - ((TWH - LWL)*.382),Digits),//brkn = this week broke last week
       brknblLW61 = NormalizeDouble(TWH - ((TWH - LWL)*.618),Digits),
       brknblLW79 = NormalizeDouble(TWH - ((TWH - LWL)*.79),Digits),
       brknbrLW38 = NormalizeDouble(((LWH - TWL)*.382) + TWL,Digits),
       brknbrLW61 = NormalizeDouble(((LWH - TWL)*.618) + TWL,Digits),
       brknbrLW79 = NormalizeDouble(((LWL - TWL)*.79) + TWL,Digits),
       
       fldblLW38 = NormalizeDouble(LWH - ((LWH - LWL)*.382),Digits),//fld = failed to break last week
       fldblLW61 = NormalizeDouble(LWH - ((LWH - LWL)*.618),Digits),
       fldblLW79 = NormalizeDouble(LWH - ((LWH - LWL)*.79),Digits),
       fldbrLW38 = NormalizeDouble(((LWH - LWL)*.382) + LWL,Digits),
       fldbrLW61 = NormalizeDouble(((LWH - LWL)*.618) + LWL,Digits),
       fldbrLW79 = NormalizeDouble(((LWL - LWL)*.79) + LWL,Digits);

here is the code showing the equations used to calculate my preferred fib levels

//Sells
if (LWbrsh && WbreakL)
if (iHigh(NULL,PERIOD_D1,0) >= brknbrLW61)
if (Bid < brknbrLW79)
if (blshcndl)
if (blshcndl != bldoji)
if (SellSignal)
  {
 bool SendSell = OrderSend(_Symbol,OP_SELLLIMIT,lots,ent,10,Ssl,Stp,NULL,MNb,CP);
 if(!SendSell) 
  {
  static datetime currenttick = 0;
  MqlTick last_tick;
  if (SymbolInfoTick(Symbol(),last_tick) == currenttick)
  Print("unable to open order"+"-"+Error);
  else;
  }
 }

here is how the code is used in my practice entry, with either one of the fib levels hashed out the EA will take the trade but with both on it fails to take trades in the backtester. I've verified this because the first trade it takes doesn't break the 79% level and hits the 61.8% level exactly so with both on it should take the trade. Can anyone explain why this is?  Overall the idea is that price is between the 79 & 61.8 retracement levels and a bearish engulfing pattern has formed on the 4hr chart.  If there is a different way to go about coding that idea I'm open to that suggestion as well. 

Thank you.

Can 1 EA monitor & trade multiple currency pairs from within one chart?
Can 1 EA monitor & trade multiple currency pairs from within one chart?
  • 2014.02.18
  • www.mql5.com
I am wondering is it's possible to have a single EA running on any currency pair, but have it monitor multiple currency pairs and respond to trigge...