EA only opens one currency at a time

 

hello help code. I would like my EA to open only one currency at a time. so do not overlap openings of different currencies at the same time. thanks to who helps me

 

Help you with what? You haven't stated a problem, you stated a want. Show us your attempt (using the CODE button) and state the nature of your difficulty.
          No free help (2017)

Or pay someone. Top of every page is the link Freelance.
          Hiring to write script - General - MQL5 programming forum (2018)

We're not going to code it for you (although it could happen if you are lucky or the problem is interesting).
          No free help (2017)

 
Vincenzo Lungard:

hello help code. I would like my EA to open only one currency at a time. so do not overlap openings of different currencies at the same time. thanks to who helps me

Have your ea drop a file (on a specific position) which blocks further trading by other instances of the ea when opening trades .

Delete the blocker when closing trades.

Before opening a trade check if that file exists , if it does , you do not proceed .

You can include the magic number into the filename for added complexity (like , have 2 groups of ea's running , each one allowed to trade one currency at a time)

 
Vincenzo Lungard:

hello help code. I would like my EA to open only one currency at a time. so do not overlap openings of different currencies at the same time. thanks to who helps me

If you want to limit the trading to the symbol of the current chart, look at https://www.mql5.com/en/docs/predefined/_symbol - simply place trades in that symbol only.

Otherwise if you want to scan live positions, please look at https://www.mql5.com/en/docs/constants/tradingconstants/positionproperties . POSITION_SYMBOL is the property you can examine to check the currency of a specific position, so you could do this check before placing a new order.

Really its down to how you decide to code it based on this data
Documentation on MQL5: Constants, Enumerations and Structures / Trade Constants / Position Properties
Documentation on MQL5: Constants, Enumerations and Structures / Trade Constants / Position Properties
  • www.mql5.com
Position Properties - Trade Constants - Constants, Enumerations and Structures - MQL5 Reference - Reference on algorithmic/automated trading language for MetaTrader 5
Reason: