To open second order after 5 pips...

 

I want to open a second order when the price= first order's price + 5 pips

I try to use Ask for buy, Bid for sell. However, these are not effectively.

   if (contiditions are ok.);

      {

       openprice1=Ask;

       Open Trade (OP_BUY);

     }

   if (Ask==openprice1+0.05)

    {

      openprice2=Ask;

      Open Trade (OP_BUY)

   }

I try to give an example for buy on GBPJPY.

Ask and bid are changing countinusly. How can I open second order when the price= first order's price + 5pips?

Best,

 
Doubles are rarely equal. Understand the links in:
          The == operand. - MQL4 programming forum
Reason: