Yes you can use a draw_once loop to draw the initial picture and then set a flag so that it doesn't run again.
Then on the next run you can overwrite the old picture with the new one.
TimeToStruct(Time[0],t); // should be TimeToStruct(time[0],t);
Good point Amir time[0] sounds like more reasonable option.
Marco what do you mean exactly by draw_once loop? I tried to google it but couldn't find such thing as "draw_once".
Good point Amir time[0] sounds like more reasonable option.
Marco what do you mean exactly by draw_once loop? I tried to google it but couldn't find such thing as "draw_once".
It's just a boolean flag you set.
Sometimes people use two loops one to draw history upon loading the expert and one that redraws a part of the current + n candles.
This is to prevent the indicator from redrawing all candles at every tick.
But i dont think it's applicable in your example.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
I suppose my question is trivial, but I am strugglin with this. I want to draw straight lines on the chart when it hits specific hour and I want them to be longer than one bar. Lets say I have 1H Chart and when it is 12 o'clock I want lines drawn above 8:00, 9:00, 10:00 and 11:00 (I mean straight line from 8:00 to 11:00), but when I am trying to alter values in already calculated buffers everything on my chart disappears. Is there another way to achieve this? Should I call some "recalculate" function on my desired hour?