I am trying to write a EA that can be attached to multiple Charts.
My first try on Demo Account showed me that when I attach the EA on two pairs I get the values of my inputs variables shared among the 2 running EA.
I have a EA that defines the maximum number of open orders for this EA attached to the pair USDCHF
input int max_orders = 3;
When I attach the same EA to the USDJPY chart I also define the max_order for this instance to be 3.
What I would like to see happening is a total of 6 opened orders because it works as a grid EA. But what I observed is that I get 2 orders for USDCHF and one for USDJPY.
Is there any code practice to avoid that?
Of course there are many.
You could write a book about this subject alone.