Questions from Beginners MQL5 MT5 MetaTrader 5 - page 1305

 
Corrected. Added redundancies (in progress). Third day trying to solve the problem.
 
//+------------------------------------------------------------------+
//| Expert tick function                                             |
//+------------------------------------------------------------------+
void OnTick()
  {
// проверим снова, может ли советник торговать
   if(checkTrading()==false)
     {
      Alert("Советник не может торговать,не удовлетворяются торговые требования");
      return;
     }
   ArraySetAsSeries(mrate,true);
   ArraySetAsSeries(L1,true);
   ArraySetAsSeries(L2,true);
   ArraySetAsSeries(L3,true);
 

Vladimir, the template of this EA has been tested many times, I've traded it on the real world.

But the condition >level,<level does not work.

 
Oleg Kolesov:

Now remove all unnecessary items from the position opening condition and leave only one condition. Add one condition at a time until you get to the point where the new added condition kills the trading signal.

 
Thank you. I'll give it a try.
 
Oleg Kolesov:

Vladimir, the template of this EA has been tested many times, I've traded it on the real world.

The >level,<level condition does not work.

If you noticed, it's the second page I'm working in telepathy mode. I've never seen the code you're talking about. I think Telepathy is enough for one more page at most...

 
//+------------------------------------------------------------------+
//|  Проверяет условия на покупку                                    |
//+------------------------------------------------------------------+
bool checkBuy()
  {
   bool dobuy = false;
   if(L3[2]<level1 && L3[1]>level1 && L2[2]<level1 && L2[1]>level1)
           {
            dobuy = true;
           }
   return(dobuy);
  }
After
&& L2[2]<level1 && L2[1]>level1)

3 or 4 deals??? How about brackets sometime?

 
Oleg Kolesov:
Vladimir, what's wrong?

Doesn't compile. Requires some kind of indicator.

 
 
Oleg Kolesov:
EA gets data from an indicator.

Doesn't compile. Requires some kind of indicator ...

Reason: