How do I set a single currency pair to only trade once until it closes a position?

 
Let's say I have GBP/JPY, USD/JPY, and GBP/CHF. I wish to have these currency pairs trade only once so that I would only have three open positions at a time and not have a "free margin error" or margin call. Once a certain currency pair gains profit by closing a position, it will then open another position for that particular currency. Either way, it will only have three open positions at a time. How do I do this? Any input, please. Thanks.
 
funman:
How do I do this?

learn programming.

as another one has said "oops i have thought this forum is for help me" i have to say, that if you try to programming MQ4 as your hobby, what is your fun if you ask for the solutions ?

and if you are programming MQ4 for profit, why do you think that others should help to increase your profit without payment ?

i am tired of such posts. the amount is more then 70 percent here in the forum.

no reason to answer such posts in the future.

 

Meikel... Is Right.... A LOT...That's LOTS AND LOTS and even MORE...Trial and error......is the only real way.. (that's trial and error AFTER many hours of trying to understand what the documentation is really wanting to see you do....). Expect to get flamed here if you ask for somebody to do your work for you.......or if you ask stupid basic questions... Search for the answers first....

I'm still learning too...(but also making money)....some of these guys REALLY know this stuff...... use their insights wisely... I could help too but you don't seem to have made any effort to write this code yourself....

What you're asking for is basic....Start by learning how to open and close orders...then conditions as to if and when.... Good Luck...

 
funman:
Let's say I have GBP/JPY, USD/JPY, and GBP/CHF. I wish to have these currency pairs trade only once so that I would only have three open positions at a time and not have a "free margin error" or margin call. Once a certain currency pair gains profit by closing a position, it will then open another position for that particular currency. Either way, it will only have three open positions at a time. How do I do this? Any input, please. Thanks.

Make sure to open three different charts, and use three different EAs. Each EA will be coded only for opening a single order with that pair, by scanning open orders, and matching symbols. But it is all handled by loops.

Reason: