Download MetaTrader 5

chart "Refresh" causes the plots to be misbehave

To add comments, please log in or register
selnomeria
254
selnomeria  

After I compile the indicator, on the chart, the lines are drawn correctly.

However, if i then right click on chart and click "REFRESH", the lines are messing up and drawing strangely... 

what happens? should I use something code in INIT/DEINIT?


 ChartRedraw() doesnt help. also, I've tested and before/after refreshing, the "rates_total" and "prev_calculated" values are not changed... so what changes there?

whroeder1
16808
whroeder1  
There are no mind readers here, we can't see your broken code. Most likely, you have some temporaries from the previous iteration, instead of using a buffer.
selnomeria
254
selnomeria  
whroeder1:
There are no mind readers here, we can't see your broken code. Most likely, you have some temporaries from the previous iteration, instead of using a buffer.


YES, you are correct! I had temporaries !


BTW, is there any way to keep those temporaries in this situation? any solution? 

whroeder1
16808
whroeder1  
If they are static or global, fine as long as you don't reprocess bar zero. Otherwise use buffer(s) so you can get the previous values for the current buffer.
selnomeria
254
selnomeria  
whroeder1:
If they are static or global, fine as long as you don't reprocess bar zero. Otherwise use buffer(s) so you can get the previous values for the current buffer.


"don't reprocess bar zero"  -

can you tell me two words about this? what does this mean I dont know, or how to do it programatically?

To add comments, please log in or register