How to find the value of previous candle in an indicator?
int limit = rates_total - prev_calculated; if (prev_calculated > 0) limit++; bool previousIsBearish = Open[i + 1] > Close[i + 1]; // PROBLEM IS HEREYour lookback is one.
How to do your lookbacks correctly #9 — #14 & #19
Great, thank you sorted.
I'm new to indicators. I'd need to find the open/close of the previous candle on my indicator.
It's basically an indicator that shows buy/sell arrows on the chart.
I want to check 2 previous candles and if there is an engulfing candle I highlight with an arrow:
I'm using this code but it errors that "array out of range":
Here is my indicator: