How to Set Condition for CCI(120) cross above RSI Level-80

 

Hi all,

  I am creating a custom indicator. I need to check whether CCI(120) signal line cross above RSI level 80 and  CCI(120) signal line cross below RSI level 20. How to do it

 
help with what? you want something. show your try
 
  1. berna1406: CCI(120) signal line cross above RSI level 80 

    RSI level 80 is 80. So your question is CCI crossing above 80. RSI is irrelevant.

  2. berna1406: How to do it

    Look for a cross.

    double aPrev = …(i+1), aCurr = …(i),
           bPrev = …(i+1), bCurr = …(i);
    bool   wasUp = aPrev > bPrev,
            isUp = aCurr > bCurr,
         isCross = isUp != wasUp;