Hello, I’m trying to create an algorithm based on the divergences. I tried to call divergence indicators (RSI or MACD) found on the site but it doesn’t work, I think the error comes from my code. For example I tried to call the indicator “DivergenceRSIWithLookback”, and to indicate as conditions to buy if the indicator is > to 0 and the close is > to the highest of the previous candle, or to short if the indicator is < to 0 and the close is < to the lowest of the previous candle, But this does not give any trade. I removed the conditions close >high [1] and close I removed the variables from the indicator to integrate them directly into the code but it still didn’t work. It still doesn’t work. Can someone help me solve this problem? 🙂 DEFPARAM Cumulateorders = False DEFPARAM FLATAFTER = 214400 DEFPARAM FLATBEFORE = 000100 // Conditions pour ouvrir une position acheteuse indicator1 = Call "DivergenceRSIWithLookback" c1 = (indicator1 > 0) //c2 = close> high[1] IF c1 AND Not OnMarket THEN BUY 1 CONTRACTS AT MARKET ENDIF // Conditions pour ouvrir une position vendeuse indicator2 = Call "DivergenceRSIWithLookback" c3 = (indicator1 < 0) //c4 = close < low[1] IF c3 AND Not OnMarket THEN SELLSHORT 1 CONTRACTS AT MARKET ENDIF SET STOP$LOSS 500 SET TARGET$PROFIT 500