OrderOpenPrice vs Open Price

 

Below is a trade which puzzles me. If you look at the log you will see that the BUY opened at 1.40435, yet when you use an alert, the alert shows 1.40445. A difference of .00010.

.

Is OrderOpenPrice() returning the value of the order " that was opened " or the value " if opened "? OrderClosePrice() returns, 1.40425, even when order isn't closed. And, with the exception of OrderOpenPrice(), all other values change, from tick to tick.

.

.

How do I work with the actual values of a trade and not just the " values to be "?

.

.

Expert Log Results:

.

.

11:29:09 ZEMG EURUSD,M1: Alert: Attempt to Open Initial Buy. Waiting for Response..
11:29:19 ZEMG EURUSD,M1: open #8770338 buy 1.00 EURUSD at 1.40435 tp: 1.40462 ok
11:29:19 ZEMG EURUSD,M1: Alert: Opened - Buy Order 0
11:29:19 ZEMG EURUSD,M1: Alert: 0

.
11:29:24 ZEMG EURUSD,M1: Alert: Ticket# 8770338 Order # 1 Type: OP_BUY OpenPrice: 1.40445 ClosePrice: 1.40425 Close: 1.4042 TakePB= 1.4046 TakePS= 1.4039

.

.

.

vC=iClose(NULL,1,0);

.

TakePB = (Bid+45*Point);
TakePS = (Ask-45*Point);

.

string Buytype = "OP_BUY";
.

ordertype = Buytype;

.

{OrderSelect(0,SELECT_BY_POS, MODE_TRADES);

.
Alert(Ticket# ",OrderTicket()," Order # ",Total," Type: ",ordertype," OpenPrice: ",OrderOpenPrice()," ClosePrice: ",OrderClosePrice()," Close: ",vC," TakePB= ",TakePB," TakePS= ",TakePS);}

 

The order didn't open at 1.40435.

That was the price you requested it open at.

It opened at 1.40445, without a requote due to the fact that the difference between the 2 prices being smaller that what you have allowed in slippage (from memory, I think you set slippage to 50?).

If you select an order with OrderSelect(), then OrderOpenPrice() will always reflect the actual price that the order was opened at.


CB

 
cloudbreaker wrote >>

The order didn't open at 1.40435.

That was the price you requested it open at.

It opened at 1.40445, without a requote due to the fact that the difference between the 2 prices being smaller that what you have allowed in slippage (from memory, I think you set slippage to 50?).

If you select an order with OrderSelect(), then OrderOpenPrice() will always reflect the actual price that the order was opened at.

CB

O.K. That get's me a little closer. I just wanted to be sure that my calculations were working with actual values. The possible reason too, for the difference in price then, maybe be because I have forced the order to open even if there's a requote.

.

.

{
while(Order == false)
{RefreshRates();
Order = OrderSend(Symbol(),OP_BUY,Lot,Ask,2,0,TakePB);}
}

.

.

Thanks!