Hi, can someone help ? Can someone check if this code is correct?
I need help to see if the 1st cci cross above 100 and 2nd cci below 0 is correct or not?? Like this part
" if( cci1[0] >= UPPER_LEVEL
&& cci2[0] <= MIDDLE_LEVEL && repeat ) "
Does it match to my description above??
And one more thing what does this code do?
" if( cci1[0] < UPPER_LEVEL || cci2[0] > MIDDLE_LEVEL )
repeat = true; "
- cci[0] being the last bar.
- cci[1] being the last-second bar.
Then if you want to insure that cci2[lastbar=0] is in the same moment superior to mid level :
When you're using || you're meaning OR :
I need help to see if the 1st cci cross above 100 and 2nd cci below 0 is correct or not?? Like this part
" if( cci1[0] >= UPPER_LEVEL
&& cci2[0] <= MIDDLE_LEVEL && repeat ) "
Does it match to my description above??
And one more thing what does this code do?
" if( cci1[0] < UPPER_LEVEL || cci2[0] > MIDDLE_LEVEL )
repeat = true; "
No, it is not read as a cross. It is just say as when cci1 is above or equal to UPPER_LEVEL AND cci2 is less than or equal to MIDDLE_LEVEL AND repeat is TRUE then DO sendinfo and also then set repeat to false.
The second one is to set variable repeat with "true" when cci1 less than upperlevel OR when cci2 more than middlelevel.
When you looking for a cross, then look Icham post above.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi, can someone help ? Can someone check if this code is correct?
Description
CCI A cross above 100
CCI B below 0
An alert should pop out when this 2 condition happen.
#define UPPER_LEVEL 100
#define MIDDLE_LEVEL 0
#define LOWER_LEVEL -100
#define INDICATOR_NAME "iCCIAlert"
if( cci1[0] >= UPPER_LEVEL
&& cci2[0] <= MIDDLE_LEVEL && repeat )
{
SendInfo(INDICATOR_NAME, StringConcatenate(INDICATOR_NAME, " ", Symbol(), " ", TfToString(Period()), " Opportunity Alert "));
repeat = false;
}
if( cci1[0] < UPPER_LEVEL || cci2[0] > MIDDLE_LEVEL )
repeat = true;