Timeframe change, variables do not update
-
Hello everyone, sorry for my English, I'm Portuguese.
I have a problem I can't solve, my EA doesn't update the variables when I change timeframes, I don't know why?
I'm using current time, the variables are numeric in double.
I've already tried using a button when clicking changes the variables to 0 and it still doesn't work.
I tried to reset the timeframe to the EA but I can't do it with a custom command.
Any help?




-
Do you mean the both needs to work on 2 TF at the same time or it is you who changes it manually?
-
Well, actually this AE doesn't open buy or sell orders, it's a tool for me to analyze the charts, and I don't want it to work on 2 TF I wanted, for example, I'm D1, I'll change the chart to M30 and it will update the variables.
In the conditions I'm using time current but it doesn't update, try updating the variables with modification and the values shown in the top right corner are all set to zero. -
@Bejenaru The only way to find information in the past is by searching for it via loops. Because your current structures are not loops, only the information stored from the exact moment you changed to the new TF onwards is considered. You need loops to get the past info when changing the TF.
Considering you are not using it as an EA but as an indicator, you should use an indicator instead.