My idea is trying to replace the Bars by iBars(symbol, 0).
DeepThought:
My idea is trying to replace the Bars by iBars(symbol, 0).
It's obviously he wants Bars from actual chart. It will be iBars(Symbol(), 0) but it's same story... maybe something with start datetime.
My idea is trying to replace the Bars by iBars(symbol, 0).
Just_Mike:
It's obviously he wants Bars from actual chart. It will be iBars(Symbol(), 0) but it's same story... maybe something with start datetime.
It's obviously he wants Bars from actual chart. It will be iBars(Symbol(), 0) but it's same story... maybe something with start datetime.
Then he probably hit the history limit. He must pick the lesser number of bars for both the symbol and Symbol(). But not sure if it has sense, the candles may not align.
Well I think he hasn't resized his array pairs. So he set an array with size = 0 as ..Series - can't work :(
gooly:
Well I think he hasn't resized his array pairs. So he set an array with size = 0 as ..Series - can't work :(
No, his problem is that he expects the CopyRates downloads data to the index he specified. But there are probably no more data at broker, 11k seems quite usual number for many of them, and many have even less.
Well I think he hasn't resized his array pairs. So he set an array with size = 0 as ..Series - can't work :(
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Hi guys, I have indicator with CopyRates function in OnInit. Something like that:
int OnInit() {
MqlRates pairs[];
int count = 0;
ArraySetAsSeries(pairs, true);
if (CopyRates(symbol, 0, 0, Bars, pairs) == -1 || ArraySize(pairs) < Bars) {
Print ("Error: ", GetLastError(), " pairs count: ", ArraySize(pairs), " needed: ", Bars, " ", symbol);
return -1;
}
}