NEED HELP!!! CCI exit if value lower than the previous value.. help me pls!!!!!

 

i am new to expert advisor. may i know how to set an exit if the current CCI value lower/higher than the previous value?

if(iCCI(NULL,0,7,PRICE_TYPICAL,0)>iCCI(NULL,0,7,PRICE_TYPICAL,2)) ??

I really need help here!~

 
double cci_current  = iCCI(NULL,0,7,PRICE_TYPICAL,0);
double cci_previous = iCCI(NULL,0,7,PRICE_TYPICAL,1);

if(cci_current > cci_previous || cci_current < cci_previous)
  {
  close_order...
  }
 
19730719:


Really thanks for your help.. i really appreciate it.

But how come it's not really work out here. is there any method out there?

 
19730719:


I have tried, but the position still remaining when the CCI value is lower or higher than previous bar..

Really thanks and appreciate for your help..