can you please help me with Reset() an set the value into Plot series from mouse click handler? My indicator adds a button to the toolbar and when button is turn ON, mouse left click handler waiting for left click into the chart area and finds out bar index for clicked bar. So far, everything works great. Now I need to reset all values in my Plot series named DS and then set value = 1 into Plot series DS only for bars right from clicked bar. I have two for cycles in OnMouseLeftDown(), one for reset DS a one for set value = 1 into DS.
DS.GetValueAt(i) worked fine for all i, but DS[i] worked only for i = 0 and for i >= 1 will cause error "Unhandled exception: Index was out of range". DS.reset(i) or setting DS[i] = 1 also will cause same error - see line 202, 216, 217 in attached indicator (now commented). I tried to debug it, I searched the help guide and forums but nothing helped. Can you please advise me?
Thank you.
asfax
Comment