Stupid question about variables...

 

... but i can't find any good answer in docs or forum.


Imagine local variables declared in the global scope of an EA like :

bool BUY,SELL;


There are several EAs running on different currencies onthe same account, each one using BUY,SELL, etc...



Question :

Can i use the same name in each EA and they'll run independant, or must i use BUY1 in EA1, BUY2 in EA2,etc... to avoid conflict while trading on same account?


uuhh am i clear?



Thanks for advance.



Dam. :)



mmmm, and i'll add : in a EA i put on order ticket number in a variable on the global scope of this EA, can i have the same name in another EA/diff currency/same account without any interference in managing the ticket pool? Just want to use that for removing EA ticket search iterations.

 

Variable names are local. Reuse in as many differrent EA as you like. Run same EA on another chart, no interaction.


The only way to pass values between EA is to use GlobalVariableSet/Get(), or write to a common file.

 

Thanks for the conf Phy. :) :) :)



Hope this helps for someone else.

Reason: