I am stuck with my code where I want to create sort of scan loop for checking if there are any orders between first order open and stoploss.
If order is missing send order. Result EA should look like there are always order on some price between first order open and its stoploss.
Can someone push me to right direction here or send me some similar example how to solve this.
If order is missing send order. Result EA should look like there are always order on some price between first order open and its stoploss.
Can someone push me to right direction here or send me some similar example how to solve this.
Inserted Code
int bMagic=111; int start() { //---- int tot=OrdersTotal(); int bCount; if(tot==0) { OrderSend(Symbol(),OP_BUY,1,Ask,3,Ask-25*Point,Ask+25*Point,0,bMagic,0,Green); } if(tot!=0) { for(int count=tot-1;count>0;count--) { if(!OrderSelect(count,SELECT_BY_POS))continue; { if(OrderSymbol()==Symbol() && OrderMagicNumber()==bMagic) { if(OrderType()==OP_BUY) { double bOpen=OrderOpenPrice(); double bSL=OrderStopLoss(); double bTicket=OrderTicket(); bCount++; } } } } } int range; if(bCount!=0) { range=(bOpen-bSL)/Point; } if(range!=0) { //???? } //---- return(0); }