MQL4 - automated forex trading   /  

Forum

How to know a order is closed by stoploss or takeprofit?

Back to topics list To post a new topic, please log in or register

avatar
2
jinzy 2006.08.01 07:26 
Hello,ALL.
I have a question. How to know a order is closed by stoploss or takeprofit?
1, I order a ticket by:
Ordersend(Symbol( ),op_sell,lots,bid,3,sl,tp)

2,When the Current prize is equal tp or equal sl, the order will be closed by server system.

3, In this time, I want order a ticket right now , What can I do? How can I know when the order is closed?



  
article

Registration: Preliminary Results

Two and a half months have passed since Registration started. Only 7 days are left to complete it and participate in the Automated Trading Championship 2007. According to the latest information, 1 560 people have already registered at the website. 374 developers have fully completed registration.


avatar
2077
vixenme 2006.08.01 10:38 
you can see them in the history window

-> if they closed by tp you will see the green color
-> if they closed by sl you will see the pink color


or


it will show in the "comments" column as [tp] or [sl]

avatar
Moderator
5089
stringo 2006.08.01 13:32 

Select order by ticket and check its close time. If close time > 0 then order was closed. Compare s/l price and close price.

BTW server adds to order's comment [sl] postfix


avatar
175
codersguru 2006.11.20 19:39 
stringo wrote:

Select order by ticket and check its close time. If close time > 0 then order was closed. Compare s/l price and close price.

BTW server adds to order's comment [sl] postfix

Search the comment of the closed order for the strings : [sl] <-- close by stop loss! and [tp] <-- close by takeprofit!

avatar
109
flourishing 2007.07.25 12:10 

it is the only way to select by ticket ?? thank you.

Back to topics list  

To add comments, please log in or register