Static RSI and CCI on historic data?!
Hello my dudes. I'm backtesting an expert I created, and it doesn't seem to change CCI and RSI..?
Left side is the coded, right side is the backtest.
The code is within the OnTick scope.
Open a chart on GBPUSD and check if it shows candles on Jan 2nd around 6:00, try different time frames from M1 to H1.
The test shows data from around Jan 2nd 6 am, but the chart ends Dec 31st. What time period do you want to test, Dec, Jan? Provide more data about your test setup.
It looks like a confusion of how to use an indicator in MQL5. RSICur resp CCICur just hold a handle to the indicators. To retrieve the actual values check the reference manual for a sample.
Thanks man. Seems like a whole lotta manual calculating though, that I don't understand lol...
Do you maybe have any youtube/guide of a breakdown for what goes on there?
Thanks man. Seems like a whole lotta manual calculating though, that I don't understand lol...
Do you maybe have any youtube/guide of a breakdown for what goes on there?
Check this simple approach to get an idea:
static double buffer[1]; ResetLastError(); int hnd=iRSI(NULL,0,14,PRICE_MEDIAN); if(hnd==INVALID_HANDLE) { PrintFormat("failed to create handle of iRSI indicator for %s, error %d",_Symbol,GetLastError()); return false; } int indicator_shift=0; // most recent int amount=1; if(CopyBuffer(hnd,MAIN_LINE,indicator_shift,amount,buffer)<0) { PrintFormat("failed to copy data from iRSI indicator for %s, error %d",_Symbol,GetLastError()); return false; } double RSICur=buffer[0];
Check this simple approach to get an idea:
Got me some steps closer, thank you very much
Hello my dudes. I'm backtesting an expert I created, and it doesn't seem to change CCI and RSI..?
Left side is the coded, right side is the backtest.
The code is within the OnTick scope.