Good Evening.
i need an help. i have write this sample code to understand how many time Prorealtime platform call my indicator and how platform manage screen and drawing.
defparam drawonlastbaronly = true
MyTime = Time
MySecond = MyTime mod 100
if islastbarupdate then
for i = 1 to 50
if MySecond mod 2 = 0 then
drawtext("A#i#", barindex-i,1.1743)
else
drawtext("B#i#", barindex-i,1.1741)
endif
next
endif
return
code is very simple. it draw only on the last bar call, and if the last bar closing second is even or odd it draw text A or B.
when i run the indicator, i see on the screen apper line A, then text disappear then appear text line B and so on.
this i a video i record that explain.
http://www.mediafire.com/file/4n4zqz2ld1xfiqe/2020-10-13_23-38-06.mkv/file
i deduce that platform call my indicator for every new price, and within these call platform does nested call for each bar.
but i deduce also that platform clear screen for every new call associated with new price, otherwise I would have seen both lines of text remain on the screen, both A and B.
Instead, if line A appears, the B disappears and vice versa, so it means that the screen is cleared before every new call.
Do you know a way for the screen not to be blanked, at least for a certain indicator, so that what was previously drawn can be left on the screen?
If i have an indicator that calcuate a value for yesterday and plot it on the screen, that value will be ok forever and i wont’ to recalculate for every price in the future, wasting cpu.
Or i will have the chance to decide if clear past value or leave on the screen.