Coding help - page 665

 
      double trendCurr = iCustom(Symbol(),0,"HalfTrend 2",PERIOD_CURRENT,Amplitude,alertsOn,alertsOnCurrent,alertsMessage,alertsNotification,alertsSound,alertsEmail,6,y);
      double trendPrev = iCustom(Symbol(),0,"HalfTrend 2",PERIOD_CURRENT,Amplitude,alertsOn,alertsOnCurrent,alertsMessage,alertsNotification,alertsSound,alertsEmail,6,y); 

May i know how can i call  icustom from this indi ?

Have error form the "y".

('y' - undeclared identifier)   

Files:
HalfTrend 2.mq4  19 kb
 
stevenpun:

May i know how can i call  icustom from this indi ?

Have error form the "y".

('y' - undeclared identifier)   

That means that you did not declare the y variable. You have to have it declared (like in the code you are trying to call :

int y = iBarShift(NULL,TimeFrame,Time[i]);  
 
mladen:

That means that you did not declare the y variable. You have to have it declared (like in the code you are trying to call :

I have try it before , and have the error 'TimeFrame' - undeclared identifier"   .

just confuse form this code where should i need to copy ?

{  int counted_bars=IndicatorCounted();
      if(counted_bars<0) return(-1);
      if(counted_bars>0) counted_bars--;
           int limit=MathMin(Bars-counted_bars,Bars-1);
           if (returnBars) { up[0] = limit+1; return(0); }
            if (TimeFrame!=Period())
            {
               int shift = -1; if (ArrowsOnFirstBar) shift=1;
               limit = MathMax(limit,MathMin(Bars-1,iCustom(NULL,TimeFrame,indicatorFileName,-99,0,0)*TimeFrame/Period()));
               for (int i=limit; i>=0; i--)
               {
                   int y = iBarShift(NULL,TimeFrame,Time[i]);  
                   int x = iBarShift(NULL,TimeFrame,Time[i+shift]); 


 
stevenpun:

I have try it before , and have the error 'TimeFrame' - undeclared identifier"   .

just confuse form this code where should i need to copy ?


You can not just copy a part of the code without having all the variables declared

In your case you have to declare the TimeFrame variable too

 
mladen:

You can not just copy a part of the code without having all the variables declared

In your case you have to declare the TimeFrame variable too

Yes i have solve the problem , thanks :D

Now I trying to add others filter , if have any others problem hope you can give me some suggestion .

 
stevenpun:

Yes i have solve the problem , thanks :D

Now I trying to add others filter , if have any others problem hope you can give me some suggestion .

:)

Happy coding :)

 

hi can u help me with this problem ? it seems like when price break out of a somehow long period of range price action , cci can't reflect the momentum good and with just a little pause in price and following the trend , cci starts to diverge . for example in this picture u can see at the end of second vertical line , cci has high momentum like price . price pause a little (first box) but after that cci starts to diverge .

my question is : why is that ? what type of price action may cause this from indicator coding point of view? 

i used 3(10.20.40) period to show this problem but i know if i use a period like 100 & add levels like -500,+500 this problem would go away (probably)


mladen:

:)

Happy coding :)

 
please accept my sincerest apologies, I didn't notice that it was decompiled otherwise I wouldn't have posted it ... guess I was in a hurry
 
KumoBreake:

hi can u help me with this problem ? it seems like when price break out of a somehow long period of range price action , cci can't reflect the momentum good and with just a little pause in price and following the trend , cci starts to diverge . for example in this picture u can see at the end of second vertical line , cci has high momentum like price . price pause a little (first box) but after that cci starts to diverge .

my question is : why is that ? what type of price action may cause this from indicator coding point of view? 

i used 3(10.20.40) period to show this problem but i know if i use a period like 100 & add levels like -500,+500 this problem would go away (probably)


Sorry, but have no idea. What is sure is that we can not filter out single events without adjusting the whole math model, which would mean, in the case you describe, to have a completely new CCI (if that would rename the name in that case)
 
mladen:
Sorry, but have no idea. What is sure is that we can not filter out single events without adjusting the whole math model, which would mean, in the case you describe, to have a completely new CCI (if that would rename the name in that case)
i got some idea s what might cause this but need more research, i will get back to u later