How to differientate if a position has been closed by an user manually or by the EA logic?

Back to topics list To post a new topic, please log in or register
avatar
83
BeLikeWater 2015.01.07 12:33
 

How to differientate if a position has been closed by an user manually or by the EA logic?

Is this possible?

Greetings

BeLikewater

avatar
2017
gooly 2015.01.07 13:36 #
 

1) the EA has to save the ticket number

2) the EA to delete this ticket number in case the EA closes it.

3) If this ticket number 'disappers' (OrdersTotal()) or OrderClose() creates an Error (most probable):

4108

ERR_INVALID_TICKET

Invalid ticket


you the EA should know it has been closed by someone or something  (STP,TGT) else.

avatar
13006
WHRoeder 2015.01.07 13:55 #
 
gooly: If this ticket number 'disappers'

4108

ERR_INVALID_TICKET

Invalid ticket

Ticket numbers never disappear, they only move from active list to the history list. If a pending order is deleted, or an open order is closed (by what ever reason) it is in the history list. If you select by valid ticket you will get the order.

BeLikeWater: How to differientate if a position has been closed by an user manually or by the EA logic?
There is no way to tell. As gooly implied, only the EA knows it is about to close a position. It must remember that fact in persistent storage (disk.) either (short term) a Global (terminal) Variable with the name including the ticket number, or (long term) a file.
avatar
89
chudanever 2015.01.07 20:15 #
 
i think magic no can go.just put magic no on your close order identifier
avatar
83
BeLikeWater 2015.01.07 20:53 #
 

So its no possible.. I think it should be implemented, could have its functionality!

Greetings

BeLikewater

Back to topics list  

To add comments, please log in or register