Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 6. - page 165

 
T-G:

Probably, I have no errors on demo, but I have placed it on the real account and the order has not opened again, it says error!


Other EAs simply work fine and this one periodically gives errors, what else could it be?


- If you want to check all string variables in the program and make sure you have defined the starting value explicitly. This error most likely occurs when an uninitialized string gets into some function as a parameter.
- make a printout of the string variables values (along with the program line number, for convenience) and GetLastError() value before calling such functions.

 
Dear forum users, please advise,
void BU()
{
   for(int a=0; a<OrdersTotal(); a++) 
      {
       if(OrderSelect(a, SELECT_BY_POS))
        {      
         if(OrderType()==OP_BUY) 
          {
           if(OrderOpenPrice()<=(Bid-BULevel)&&OrderOpenPrice()>OrderStopLoss())
            {      
             OrderModify(OrderTicket(),OrderOpenPrice(),OrderOpenPrice(),OrderTakeProfit(),0,Green);
            }
           }       
 
         if(OrderType() == OP_SELL) 
           {
            if(OrderOpenPrice()>=(Ask+BULevel)&&OrderOpenPrice()<OrderStopLoss()) 
             {
              OrderModify(OrderTicket(),OrderOpenPrice(),OrderOpenPrice(),OrderTakeProfit(),0,Red);
             }
           } 
         }
       }
}
  return(0);

Why does Breakeven not work?

Extern int BULevel = 80 is declared;

At start if (BULevel!=0) BU();

 
alexey1979621:
Dear forum users, please advise,

Why does Breakeven not work?

Extern int BULevel = 80 is declared;

At start if (BULevel!=0) BU();




BULevel*Point
 
   double Red_Line = iIchimoku (Symbol(),0,Tenkan,Kijun,Senkou,MODE_TENKANSEN,1); // красная линия 
   double Blue_Line = iIchimoku (Symbol(),0,Tenkan,Kijun,Senkou,MODE_KIJUNSEN,1); // синяя линия 
   double UpO = iIchimoku (Symbol(),0,Tenkan,Kijun,Senkou,MODE_SENKOUSPANA,1); // верхняя граница облака 
   double DounO = iIchimoku (Symbol(),0,Tenkan,Kijun,Senkou,MODE_SENKOUSPANB,1); // нижняя граница облака 

      
   if(Volume[0]>1) return;

    // продажа
   if (Open[1]>Close[1] && Close[1] < DounO && Open[1]>DounO && Close[1] < Red_Line && Close[1] < Blue_Line) // продажа
     {
     Price = NormalizeDouble(Bid, Digits); // округляем до нужного нам числа цифр после запятой
     if(StopLoss >= STOPLEVEL)
          if(StopLoss > 0)
      {
       SL = Price - StopLoss*Point; // вычисляем стоплос
       SL = NormalizeDouble(SL, Digits); // округляем до нужного нам числа цифр после запятой
      }
       else SL = 0;

      if(TakeProfit > 0)
      {
       TP = Price - TakeProfit*Point;
       TP = NormalizeDouble(TP, Digits); 
      }
       else TP = 0;

      { 
      ticket=OrderSend(Symbol(),OP_SELL,Lots,Bid,Slippage,SL,TP,"Pattern_1",Magic,0,Red);
      return;
      }
    }
     
//---- buy conditions
   // покупка
   if (Open[1]<Close[1] && Close[1] > UpO && Open[1] < UpO && Close[1] > Red_Line && Close[1] > Blue_Line) // bay
   {
     Price = NormalizeDouble(Ask, Digits); // округляем до нужного нам числа цифр после запятой
     if(StopLoss >= STOPLEVEL)
     if(StopLoss > 0)
      {
       SL = Price - StopLoss*Point; // вычисляем стоплос
       SL = NormalizeDouble(SL, Digits); // округляем до нужного нам числа цифр после запятой
      }
       else SL = 0;
      if(TakeProfit > 0)
      {
       TP = Price + TakeProfit*Point; // вычисляем тейкпрофит
       TP = NormalizeDouble(TP, Digits); // округляем до нужного нам числа цифр после запятой
      }
       else TP = 0;

      {
      ticket=OrderSend(Symbol(),OP_BUY,Lots,Ask,Slippage,SL,TP,"Pattern_1",Magic,0,Blue);
      return;
      } 
   }
 }

Dear forum users, I can't figure out the Ishimoku indicator. I have made a small Expert Advisor based on it but it only opens buy position and does not open sell position. I think this is most probably due to the fact that the cloud is reversing, and I also did not correctly determine the conditions for entering the trade.

The figure shows a red down arrow where a sell trade should open and a red up arrow where a buy trade should open. A buy trade was opened with a wrong entry (in theory it should not be there).


 
Is it possible to determine the triggering time of a pending order without crossing the order price?
 
zfs:
Is it possible to find out the trigger time of a pending order without trying to cross the price of the order?


The way I see it, when a pending order is placed, it becomes OP_BUY or OP_SELL, (or is it wrong?)

If I set a comment (slow) with information about the order type and check if it was changed to 0 or 1, I would know the trigger time,

I hope there is something easier)).

 
ALXIMIKS:


I think when a pending order is executed it becomes OP_BUY or OP_SELL, (or is it wrong?)

If you enter information about the order type in the comment (medjic) and compare it each time it has changed by 0 or 1, then you can find out the trigger time,

But the method is somehow tight in view of the need for constant connection and in general, I hope there is something simpler))

Yes, thanks, I have thought of that variant, but what about on the real?)

 
zfs:
Is it possible to determine the triggering time of a pending order without crossing the order price?

datetime OrderOpenTime( )
 
<br / translate="no">
zfs:

Yes, thanks, that's an option I've thought of, but what about the real one?)


write the ticket number. and its status... if it has changed, then order open price... why would the magician prescribe something that is not customary or in the comments...

in a file to dump the history. open closed... Or just scroll through the history...

 
neama:


write the ticket number... and its status... if it has changed, then the order is open price... why would the magician prescribe something that was not his or hers...

to dump history into a file. open closed... or just scroll through history altogether...

Does the history record the triggered order?

Reason: