I have a created a custum indicator base on RSI, it give higher RSI value from higher time frame...
And i want to create a EA base on it.
So in the EA, i use iCustom to get the info from it...
The problem is this one:
- The value receive from iCustom is not accurate
if i put the custom indicator on the chart while in visual mode, it will give the value as i expect. But not in the EA it self...
So i decided to use the standard RSI ( Maybe its my CI ).
But it turn out to do the same thing....
so heres the code i use :
in the EA i put this
___
double rsi = iRSI(Symbol(),PERIOD_H4,14,PRICE_CLOSE,getBarShift(PERIOD_H4,0));
Comment("rsi: ",rsi);
___
//with the function
int getBarShift(int timeframe,int shift){
double time = iTime(NULL,0,shift);
return(iBarShift(NULL,timeframe,time));
}
And if you create a indicator with this....
it should give both the same result....
By the way i use a 1 hour chart to test.
But i notice that on the Comment the value is changing on every bar(But it should change every 4 bar like the CI)
but not on the indicator(It work great)...
It look like the EA is not able to retreive 4h RSI value accuratly...
any hint on this.....
Thanks
And i want to create a EA base on it.
So in the EA, i use iCustom to get the info from it...
The problem is this one:
- The value receive from iCustom is not accurate
if i put the custom indicator on the chart while in visual mode, it will give the value as i expect. But not in the EA it self...
So i decided to use the standard RSI ( Maybe its my CI ).
But it turn out to do the same thing....
so heres the code i use :
in the EA i put this
___
double rsi = iRSI(Symbol(),PERIOD_H4,14,PRICE_CLOSE,getBarShift(PERIOD_H4,0));
Comment("rsi: ",rsi);
___
//with the function
int getBarShift(int timeframe,int shift){
double time = iTime(NULL,0,shift);
return(iBarShift(NULL,timeframe,time));
}
And if you create a indicator with this....
it should give both the same result....
By the way i use a 1 hour chart to test.
But i notice that on the Comment the value is changing on every bar(But it should change every 4 bar like the CI)
but not on the indicator(It work great)...
It look like the EA is not able to retreive 4h RSI value accuratly...
any hint on this.....
Thanks
Sorry for my bad english translation