Hi,
I am trying to code multitimeframe, multicurrency EA. The issue I am struggling with is that when I try to get some data for currency different than the other that EA runs on, data is only available for the first currency. It will be better to illustrate this with example:
I am running the EA on USDLFX, aand I try to calculate some values with RSI. The code goes like this:
pairNames is a list of pairs:
EURUSD, GBPUSD, AUDUSD, NZDUSD, USDCAD, USDCHF, USDJPY
So it calculates ok for EURUSD, but then all the other pairs get only 0 from iRSI, and I get 4054 error code when I ask for last error.
When I change the sequence and for example GBPUSD will be first, then G/U will calculate and E/U and all other pairs will get only 0 from iRSI.
I have been sitting on this till late night yesterday with no results. Couldn't google anything helpful. If someone had similar problem and resolved it, I really would be greatful for some clue.
I am trying to code multitimeframe, multicurrency EA. The issue I am struggling with is that when I try to get some data for currency different than the other that EA runs on, data is only available for the first currency. It will be better to illustrate this with example:
I am running the EA on USDLFX, aand I try to calculate some values with RSI. The code goes like this:
Inserted Code
for(int i = 0; i < NoOfPeriods; i++) { rsiDelta = iRSI(pairName, TradePeriod[i], 3, PRICE_CLOSE, 0) - iRSI(pairName, TradePeriod[i], 3, PRICE_CLOSE, 1); if (rsiDelta >= RSITrendSensitivity2) score += RSITrendScore; else if (rsiDelta >= RSITrendSensitivity1) score += RSITrendScore / 2; else if (rsiDelta <= RSITrendSensitivity2) score -= RSITrendScore; else if (rsiDelta <= RSITrendSensitivity1) score -= RSITrendScore / 2; }
pairNames is a list of pairs:
EURUSD, GBPUSD, AUDUSD, NZDUSD, USDCAD, USDCHF, USDJPY
So it calculates ok for EURUSD, but then all the other pairs get only 0 from iRSI, and I get 4054 error code when I ask for last error.
When I change the sequence and for example GBPUSD will be first, then G/U will calculate and E/U and all other pairs will get only 0 from iRSI.
I have been sitting on this till late night yesterday with no results. Couldn't google anything helpful. If someone had similar problem and resolved it, I really would be greatful for some clue.
“I made most of my money sitting on my hands.”