Gap between Bid prices

 

Hi

It's part of my code:

Print(" Open:", OrderOpenPrice(), " Bid:",Bid);
if(Bid-OrderOpenPrice()>=(30*Point))
{
        // Send Order
}

Output in journal of strategy tester:


Why Bid price jump from 0.87801 to 0.87822? 

In this situation my expert goes wrong(30Pip distance in condition). because condition should be true in 0.87812 instead of 0.87822

This gap is normal or not? if yes how can i control my orders send exactly in 30pip distance?

 
Ali D32:

Hi

It's part of my code:

Output in journal of strategy tester:


Why Bid price jump from 0.87801 to 0.87822? 

In this situation my expert goes wrong(30Pip distance in condition). because condition should be true in 0.87812 instead of 0.87822

This gap is normal or not? if yes how can i control my orders send exactly in 30pip distance?

yes, normal

 
Hi Ali, i don't know about mt4 programming but i think your EA will make a pending order.
 
Ali D32: Why Bid price jump from 0.87801 to 0.87822? 

In this situation my expert goes wrong(30Pip distance in condition).

That is a 2.1 PIP distance. A PIP is not a point.
           What is a TICK? - MQL4 and MetaTrader 4 - MQL4 programming forum
Reason: