Two programs sharing the same variables

 
Hello. I am developing an EA that must work in more than one chart window due to that some part of the program analyzes the trend in one time frame and other part of the program does the same but in other timeframe. The aim is to avoid contradictory trades, because may be that in a 5 minute frame one trend may be upward and in the same pair, but in a frame of 1 hour the trend may be downward. The idea is each program that tells a central program what to do, by setting boolean variables. This central program reads the boolean variables, and based on them take a determined decision.
My question is: it is possible that one program can read the variable of another program? For instance, the program that works in the 5 min timeframe set a boolean var in "V"... and the program that works in the 1H timeframe, reads that value, and takes an action.
If somebody tell me how to do that I will be very grateful.

Betowm
(excuse my bad English)
 
 
ydrol:
Hi, See Global Variables

Thank you very much ydrol. You are great !! Another question: Where I have to declare that globalvariable ? because I have the EA code spread in different charts windows, each one with its own code. In what of them I have to write that globalvariable? Thank you in advance.
 
Hi Check the functions listed on the left of the link. One of them shows how to declare them. More here
 
Right now I get to read. Thank you !!!