Thursday 27 December 2012

iCustom CCI EMA

CCI EMA

the code in your post refers to it below.

for(i = limit; i >= 0; i--) {
cciTrendNow = iCustom(NULL, 0, "CCI EMA", CCIPeriod, MAPeriod, 1, i);
cciTrendPrevious = iCustom(NULL, 0, "CCI EMA", CCIPeriod, MAPeriod, 1, i+1);

================
All is says is: if CCI > 0 the trend is up: if < 0 the trend is down
for(i=limit; i>=0; i--)
            {
               int y = iBarShift(NULL,TimeFrame,Time[i]);
               double cciTrend = iCCI(NULL, TimeFrame, 50, PRICE_TYPICAL, y);
                      
                  
               TrendDoA[i]  = EMPTY_VALUE;
               TrendDoB[i]  = EMPTY_VALUE;
               Trend[i]     = iCustom(NULL,TimeFrame,IndicatorFileName,0,y);
               Direction[i] = Direction[i+1];
                  if (cciTrend>0) Direction[i] =  1;
                  if (cciTrend<0) Direction[i] = -1;
                  if (Direction[i]==-1) PlotPoint(i,TrendDoA,TrendDoB,Trend);
            }
         return(0);         
      }

No comments:

Post a Comment