I am trying to compare 2 indicators to make an entry/exit or both. The logic is if second indicator's value CrossAbove first indicator's value, then it should enter/exit a position. This logic works for RSI (Relative Strength Index) and other indicators but not for APZ (Adaptive Price Zone). Apparently, in Data Box on the chart, first and second indicator's parameters are the same when it should not be. Both indicators have the same value as a result. They never cross each other. Can someone enlighten me of what's happening.
My code is like this
// [B]ind.indicator[/B] - Indicator object // i[B]ndSeriesNewVal [/B]- Holds an [B]OHLC (Open High Low Close) [/B]price value . I selected [U]Close price[/U] // [B]ind.customSigPeriod[/B] - Holds value of period if (CrossAbove(ind.indicator.Values[ind.sigValueIndex], APZ(indSeriesNewVal, 2, ind.customSigPeriod).Lower, 1)) EnterPosition();
APZ Chart
RSI Chart
Comment