Time the close of a Market Buy Order in a EA?

 

Hi all,

I'm submitting a BUY marker order with an EA, and need to measure the time it takes to Close this order.

Basically, I'm sending a Buy market order with a Fixed take profit:

BuyTicket = OrderSend(Symbol(), OP_BUY, LotSize, MarketInfo(Symbol(),MODE_ASK), Slippage, StopLoss, MarketInfo(Symbol(),MODE_ASK) + TakeProfitFixed,
"Buy Order with Fixed Profit", MagicNumber, 0, Green);

Any help is appreciated, thanks.

John.

 
jfortes:

Hi all,

I'm submitting a BUY marker order with an EA, and need to measure the time it takes to Close this order.

Basically, I'm sending a Buy market order with a Fixed take profit:

BuyTicket = OrderSend(Symbol(), OP_BUY, LotSize, MarketInfo(Symbol(),MODE_ASK), Slippage, StopLoss, MarketInfo(Symbol(),MODE_ASK) + TakeProfitFixed, 
"Buy Order with Fixed Profit", MagicNumber, 0, Green);

Any help is appreciated, thanks.

John.

When it has closed select it ( using OrderSelect() ) then compare it's OrderOpenTime() and OrderCloseTime() . . .
 
RaptorUK:
When it has closed select it ( using OrderSelect() ) then compare it's OrderOpenTime() and OrderCloseTime() . . .


Thanks RaptorUK.
Reason: