Dear, users!
This error means that you try to get non-existing parameter. For example when you write:
SourceGraph.CloseValue(ValueIndex-i)
ValueIndex=1 and i:=5 then you will try to get close value of candle with number -4. This is a mistake, because number of candles begins from 0.
To avoid this problem you should add condition of checking candle number:
if ValueIndex-i>=0 then