What does OrderPrint really return

Back to topics list To post a new topic, please log in or register
avatar
19
TheLobos 2016.04.08 04:47
 

Hi, 

I'm having trouble with an EA I'm writing in the sense that my orders are being closed very quickly (ie: before SL or TP is reached). I've examined the orders using OrderPrint() and I've noticed something odd. The manual says that OrderPrint() returns the following:

#ticket number; open time; trade operation; amount of lots; symbol; open price; Stop Loss; Take Profit; close time; close price; commission; swap; profit; comment; magic number; pending order expiration date. 

 but when I do an OrderPrint() of my actual order, I get the following: 

#1; 2016.03.01 12:47:24; sell; 1.00; GBPUSD; 1.40096; 1.40146; 1.39896; 1.40116; 0.00; 0.00; -20.00; ABC_MA_Cross-GBPUSD-240; 123402240

 I've inserted semicolons in the order output to make the different fields stand out a bit more. 

 

What I'm not getting is this: according to the docs field #8 is TakeProfit and field #9 is CloseTime. However in the output I'm getting field #8 is TakeProfit (1.39896, correct)  but field #9 is a price (1.40116) and as such can not be "close time" (as suggested by the docs). 

I believe that this is relevant to my issue, because my order is being close at price 1.40117, a strange coincidence. Can anybody shed some light on what is happening here? 

Thanks a lot 

 

avatar
13012
WHRoeder 2016.04.08 13:53 #
 
  1. Appears that price and time are reversed in the documentation vs actual output. Tell Metaquotes. (Pre-build 600 doc is identical.)
  2. You buy at the Ask and sell at the Bid. So for your sell order your SL will be triggered at the Ask. Your SL is 5 pips from the open. Add the spread and your SL is almost nothing.
avatar
125
zirkoner 2016.04.08 14:19 #
 
TheLobos:

Hi, 

I'm having trouble with an EA I'm writing in the sense that my orders are being closed very quickly (ie: before SL or TP is reached). I've examined the orders using OrderPrint() and I've noticed something odd. The manual says that OrderPrint() returns the following:

#ticket number; open time; trade operation; amount of lots; symbol; open price; Stop Loss; Take Profit; close time; close price; commission; swap; profit; comment; magic number; pending order expiration date. 

 but when I do an OrderPrint() of my actual order, I get the following: 

#1; 2016.03.01 12:47:24; sell; 1.00; GBPUSD; 1.40096; 1.40146; 1.39896; 1.40116; 0.00; 0.00; -20.00; ABC_MA_Cross-GBPUSD-240; 123402240

 I've inserted semicolons in the order output to make the different fields stand out a bit more. 

 

What I'm not getting is this: according to the docs field #8 is TakeProfit and field #9 is CloseTime. However in the output I'm getting field #8 is TakeProfit (1.39896, correct)  but field #9 is a price (1.40116) and as such can not be "close time" (as suggested by the docs). 

I believe that this is relevant to my issue, because my order is being close at price 1.40117, a strange coincidence. Can anybody shed some light on what is happening here? 

Thanks a lot 

 

On an open order, there is no CloseTime, so it's not printed. It's not documented.
Back to topics list  

To add comments, please log in or register