wrong calculations - page 2

 
ankit29030:


i have a ecn account and spread on usd/jpy are less than 1.5....

OP_BUYSTOP is equal to integer 4 and OP_SELLSTOP is equal to 5... 

So why not use OP_BUYSTOP and OP_SELLSTOP ?  then people, who you would like to help you, wouldn't have to look up what 4 and 5 mean as the 2nd parameter in OrderSend()
 

At the time when that order is placed with SL you have 3 open orders,  so this code is executed . . . 

   if(OrdersTotal()==3)  //  <----  3 open orders ! !
      {
      if(vfot==0)
         OrderSend(Symbol(),5,v3,NormalizeDouble(OrderOpenPrice()-r3*Point,5),3,NormalizeDouble(OrderOpenPrice()-r2*Point,5),0,NULL);
      if(vfot==1)
         OrderSend(Symbol(),4,v3,NormalizeDouble(OrderOpenPrice()+r3*Point,5),3,NormalizeDouble(OrderOpenPrice()+r2*Point,5),0,NULL);

The difference between the open price and the SL is the difference between r3 and r2  r3 is 112  r2 is slp/4 which is 300/4 = 75  so 112 - 75 = 37 or 3.7 pips  so the order is correct.

When this code is executed what order is selected ? You must select an order before you can use OrderOpenPrice()