Help me write an EA, thanks in advance - page 19

 

there is a flaw in the code - you need to comment out a line and insert another

if((CalculateCurrentOrders_SELL(Symbol())==1)&&(CalculateCurrentOrders_BUY(Symbol())==1)&&(CalculateCurrentOrders_STOP(Symbol())==0))
//if((CalculateCurrentOrders_STOP(Symbol())==0)&&(CalculateCurrentOrders_OPEN(Symbol())==1))
  { 
    Lot_BUY=Nach_Lot*4;
    Ticket_Open_BUYSTOP=OrderSend(Symbol(),OP_BUYSTOP,Lot_BUY,Cena_Otkr_BUY,3,SL_Otkr_BUY,TP_Otkr_BUY,Metka,magicnumber,0,Blue);
  }
 
In any case, after the 5th or 6th order, you have to narrow the channel of losses and profits....
 

This piece of code should also be used to open sells, otherwise it's always on buy in the code.

I don't know if I wrote it correctly to match the general style...

if  (zigzag_0>zigzag_1)
{  
 if((CalculateCurrentOrders_STOP(Symbol())==0)&&(CalculateCurrentOrders_OPEN(Symbol())==0))
  {
    Lot_BUY=Nach_Lot;
    Ticket_Open_BUY=OrderSend(Symbol(),OP_BUY,Lot_BUY,Ask,3,ND(Bid-SL_BUY*Point),ND(Ask+TP_BUY*Point),Metka,magicnumber,0,Green);
    Cena_Otkr_BUY=ND(Ask);
    TP_Otkr_BUY=ND(Ask+TP_BUY*Point);
    SL_Otkr_BUY=ND(Bid-SL_BUY*Point);
    TP_Otkr_SELL=SL_Otkr_BUY;
    SL_Otkr_SELL=TP_Otkr_BUY;
    Cena_Otkr_SELL=ND(Ask-Shirina_Kanala_STOP*Point);
    Lot_SELL=Nach_Lot*2;
    Ticket_Open_SELLSTOP=OrderSend(Symbol(),OP_SELLSTOP,Lot_SELL,Cena_Otkr_SELL,3,SL_Otkr_SELL,TP_Otkr_SELL,Metka,magicnumber,0,Blue);
  }
}  
else
{  
 if((CalculateCurrentOrders_STOP(Symbol())==0)&&(CalculateCurrentOrders_OPEN(Symbol())==0))
  {
    Lot_BUY=Nach_Lot;
    Ticket_Open_SELL=OrderSend(Symbol(),OP_SELL,Lot_SELL,Bid,3,ND(Ask+SL_BUY*Point),ND(Bid-TP_BUY*Point),Metka,magicnumber,0,Green);
    Cena_Otkr_SELL=ND(Bid);
    TP_Otkr_SELL=ND(Bid-TP_BUY*Point);
    SL_Otkr_SELL=ND(Ask+SL_BUY*Point);
    TP_Otkr_BUY=SL_Otkr_SELL;
    SL_Otkr_BUY=TP_Otkr_SELL;
    Cena_Otkr_BUY=ND(Bid+Shirina_Kanala_STOP*Point);
    Lot_BUY=Nach_Lot*2;
    Ticket_Open_BUYSTOP=OrderSend(Symbol(),OP_BUYSTOP,Lot_BUY,Cena_Otkr_BUY,3,SL_Otkr_BUY,TP_Otkr_BUY,Metka,magicnumber,0,Blue);
  }
}  

 
evillive:

This piece of code should also be used to open sells, otherwise it's always on buy in the code.

I don't know if I wrote it correctly to match the general style...

you can do it this way
 
In the demo it is normal to reach the third multiplier - so far so good
 
only the piece (zigzag_0>zigzag_1) does not work correctly
 
Lucas_SPb:
only the piece (zigzag_0>zigzag_1) does not work correctly


put it to the test without the zigzag at all, i.e. the first version

 

О!

You can use a random number generator )))) even - buy, odd - sell (or positive - buy, negative - sell))))))

 
comment out the expression(zigzag_0>zigzag_1 )
 
evillive:

О!

You can use a random number generator to guess ))))) Even - buy, odd - sell )))))


creative and humorous +5 =)
Reason: