Pips difference

 

Hi guys,so i have this code which goes and makes the following thing.

It start with opening 2 orders,one for buy and one for sell.

I want,after opening these 2 orders,after a set amount of pips to open another order.

I thought that would work with making the difference in the vask and vbid variables,sadly it doesnt work the way i thought :(

For example,after opening the first order i wanted to remember the price where it was opened and after an x difference in pips between the remembered price and the actual price to open an another one.

#property copyright "Domnul T"
#property link      "www.primumilion.com"
#property version   "1.00"
#property strict
extern  double lot_multiplik;
void OnTick()
{
double vask;
if(OrdersTotal()==0)
  {OrderSend(
      _Symbol,             
      OP_BUY,                 
      0.01,              
     Ask,               
     3,            
   Ask-90000*Point,            
    Ask+90000*Point,          
    NULL,        
     0,             
     0,        
    clrRed
   );
   MqlTick pret;
   SymbolInfoTick(_Symbol,pret);
 double vask    = MarketInfo("_Symbol",MODE_ASK);

}
  
   if(OrdersTotal()==1){
   OrderSend(_Symbol,OP_SELL,0.01,Bid,3,Bid+90000*Point,Bid-90000*Point,NULL,0,0,clrGreen);
    double vbid    = MarketInfo("_Symbol",MODE_BID);}
    double vask1    = MarketInfo("_Symbol",MODE_ASK);
if(vask1-vask==50)
{price=price*2;
OrderSend(
      _Symbol,             
      OP_BUY,                 
      price,              
     Ask,               
     3,            
   Ask-90000*Point,            
    Ask+90000*Point,          
    NULL,        
     0,             
     0,        
    clrRed
   );
   }
}
 
  

Reason: