IsTradeAllowed : in what cases IsTradeAllowed can be helpful? what is the rational behind it?

To add comments, please log in or register
mikeitexpert
44
mikeitexpert  
I have been trying to find out what is the use of 

IsTradeAllowed function?


in the definition it say "

Checks if the Expert Advisor is allowed to trade and trading context is not busy."


does that mean all trading Expert Advisers share the same context for all terminals/currency pairs?


Thank you

IsTradeAllowed - Checkup - MQL4 Reference
IsTradeAllowed - Checkup - MQL4 Reference
  • docs.mql4.com
IsTradeAllowed - Checkup - MQL4 Reference
mikeitexpert
44
mikeitexpert  

I believe the is because under concept of trading concept, in meta trader each user is assigned one trading context, which means no matter how many request I send under one account, all of them are queued under my trading context and they processed in first come first serve order,


Therefore, for me as user, to send requests I should check (using IsTradeAllowed and IsTradeContextBusy) my trading context see and decide whether or not I want to send a new trading request or prefer to wait until my trading context is free for new request to be submitted or not.


Please verify my understanding if I am right.


Thank you

IsTradeAllowed - Checkup - MQL4 Reference
IsTradeAllowed - Checkup - MQL4 Reference
  • docs.mql4.com
IsTradeAllowed - Checkup - MQL4 Reference
To add comments, please log in or register