firstOrder=true not working after EA restart

 

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  

 
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.
 
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 ?
 
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.
 
figurelli:
For sure, this link and function usage example may help you.
Thank you
 
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.
 
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 !
 
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.