Download MetaTrader 5

Objects drawn bammy when i change timeframe?

To add comments, please log in or register
Stephen Reynolds
10935
Stephen Reynolds  
Hi, on the attatched code can someone help me see why when i change timeframe it messes around with the objects. So i always have to take indicator off the chart then place back on again to get the objects drawn as their meant to. 
Files:
whroeder1
17122
whroeder1  
It's an indicator that draws objects on the chart. Why would you expect it to not draw objects on the new TF?
Stephen Reynolds
10935
Stephen Reynolds  
whroeder1:
It's an indicator that draws objects on the chart. Why would you expect it to not draw objects on the new TF?

Im not sure i explained what i meant correctly. When i place the Indicator onto lets say a 1hr chart it places objects as their meant to, but if i go to change the chart to a 5m then it doesnt draw the objects on the chart like it should for a 5m chart. It draws either too many or places them incorrectly?

If i want to get them correctly drawn on the 5m chart i have to remove it from the chart then place it back onto the 5m chart for the objects to then be displayed correctly.

whroeder1
17122
whroeder1  
Your indicator doesn't delete its objects on deinit, and doesn't try to move them, so of course they stay where drawn on the previous TF.
To add comments, please log in or register