Continuous Array Out of Range - Custom Indicator
Hi I'm learning to code custom indicators, I am trying to do one for Ichimoku where the indicator must meet a checklist of 4 items:
1) TK Cross
2) Price relative to cloud
3) Favourable cloud (bullish/bearish)
4) Lag span above cloud
I have the following code with no errors however critical Array out of Range errors upon running:
If anyone could help me out I'd greatly appreciate it.
Thanks in advance,
Adam
if(prev_calculated==0) first=Senkou_B+1; else first=prev_calculated+1; CopyBuffer(ichihandle,0,0,Senkou_B+1,TenkanArray); ArraySetAsSeries(TenkanArray,true); ... for(bar = first; bar >=0; bar--)
Your are copying "Senkou_B+1" values, which are indexed from 0 tp Senkou_B, that's your range.
But your are using an index "bar" starting from limit which is initalized to Senkou_B1+1 or prev_calculated+1 => out of range.
Hi I'm learning to code custom indicators, I am trying to do one for Ichimoku where the indicator must meet a checklist of 4 items:
1) TK Cross
2) Price relative to cloud
3) Favourable cloud (bullish/bearish)
4) Lag span above cloud
I have the following code with no errors however critical Array out of Range errors upon running:
If anyone could help me out I'd greatly appreciate it.
Thanks in advance,
Adam