Download MetaTrader 5
To add comments, please log in or register
Sign up to publish an article and receive 200 USD
Marcelo Coutinho
1151
Marcelo Coutinho 2014.05.21 16:29 

Hi There !

One question please

My EA have a flag called bool firstOrder to know if we have already sent one order to the market (and already executed).

The problem is that if the EA somehow resets itself, this flag returns to true even if we have already sent an order.

Can someone please tell me from where to start with this subject? Any article describing how to verify any executed orders during the day?

Regards,

MRC  

Rogerio Figurelli
Moderator
38829
Rogerio Figurelli 2014.05.21 16:41  
YouTrade:

Hi There !

One question please

My EA have a flag called bool firstOrder to know if we have already sent one order to the market (and already executed).

The problem is that if the EA somehow resets itself, this flag returns to true even if we have already sent an order.

Can someone please tell me from where to start with this subject? Any article describing how to verify any executed orders during the day?

Regards,

MRC  

Hi Coutinho, there are some workarounds to check this precisely. 

For instance, you can scan your order history (maybe this is the best solution).

A simpler way is create an external flag, for instance using a file to store this flag and last date/time.
Marcelo Coutinho
1151
Marcelo Coutinho 2014.05.21 16:44  
figurelli:
Hi Coutinho, there are some workarounds to check this precisely. 

For instance, you can scan your order history (maybe this is the best solution).

A simpler way is create an external flag, for instance using a file to store this flag and last date/time.
Like the idea of "scan your order history". Do y know any command and/or library to start ?
Rogerio Figurelli
Moderator
38829
Rogerio Figurelli 2014.05.21 16:56  
YouTrade:
Like the idea of "scan your order history". Do y know any command and/or library to start ?
For sure, this link and function usage example may help you.
Marcelo Coutinho
1151
Marcelo Coutinho 2014.05.21 17:01  
figurelli:
For sure, this link and function usage example may help you.
Thank you
Alain Verleyen
Moderator
30295
Alain Verleyen 2014.05.21 17:06  
YouTrade:

Hi There !

One question please

My EA have a flag called bool firstOrder to know if we have already sent one order to the market (and already executed).

The problem is that if the EA somehow resets itself, this flag returns to true even if we have already sent an order.

Can someone please tell me from where to start with this subject? Any article describing how to verify any executed orders during the day?

Regards,

MRC  

Instead of playing with history, you can more simply use Global Variables of the Terminal. It's more easy to implement, however it depends of your needs, in some circumstances, you could be forced to check the history.
Marcelo Coutinho
1151
Marcelo Coutinho 2014.05.21 18:15  
angevoyageur:
Instead of playing with history, you can more simply use Global Variables of the Terminal. It's more easy to implement, however it depends of your needs, in some circumstances, you could be forced to check the history.
Thank you ... I will check to see if this solution solves my problem. Thank you very muck !
Rogerio Figurelli
Moderator
38829
Rogerio Figurelli 2014.05.21 18:34  
angevoyageur:
Instead of playing with history, you can more simply use Global Variables of the Terminal. It's more easy to implement, however it depends of your needs, in some circumstances, you could be forced to check the history.
Very good, for this Coutinho's need it's probably the best solution.
/
To add comments, please log in or register