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
Where and how is MarketWatch generated?
as I understood this block is trying to add a symbol to the list, with checking the result.
But if Expert Advisor is a multiple currency pairs (which is not obvious from above example).
This code is in a currency pair loop, Exp_Symbol on every pass, except the first, is a "foreign" currency pair. If there are five currency pairs, SymbolSelect(Exp_Symbol, true) will be called five times for five different symbols.
The call to SymbolSelect(), SymbolIsSynchronized(), CopyRates() functions in my code by "alien" symbols (the history should be updated accordingly). At first test there is data, but at second test there is no data and Expert Advisor crashes in the tester.
This code is in currency pair loop, Exp_Symbol on every pass except first one is "alien" currency pair. I have a call to SymbolSelect(), SymbolIsSynchronized(), CopyRates() functions by "alien" symbols (hence the history should be swapped). At first test there is data, but at second test there is no data and Expert Advisor crashes in the tester.
Can you send an expert and a description of the optimisation/testing settings to servicedesk?
I want to unload the data for January 2009. I have unloaded data for 15 minutes and hour, but I can't unload the data for 5 minutes, it says there is no history. Why is not downloading history of 5 minutes?
void OnStart()
{
int size = 25;
datetime dateFrom;
datetime dateTo;
MqlRates rates[];
MqlDateTime stDate;
int FileHandle;
stDate.day = 1;
stDate.hour = 0;
stDate.mon = 1;
stDate.year = 2009;
dateFrom = StructToTime( stDate );
stDate.day = 31;
dateTo = StructToTime( stDate );
ArraySetAsSeries(rates,true);
int copied=CopyRates(Symbol(), PERIOD_M5, dateFrom, dateTo, rates);
for(int i=0;i<100;i++)
{
if(GetLastError()!=0)
{
Sleep(5000);
copied=CopyRates(Symbol(), PERIOD_M5, dateFrom, dateTo, rates);
}
else
{
break;
}
Print("Нет истории, проход № " + i);
}
if(copied>0)
{
Print("Скопировано баров: "+IntegerToString(copied));
//string format="open = %G, high = %G, low = %G, close = %G, volume = %d";
string out;
size = ArraySize(rates);
ResetLastError();
FileHandle=FileOpen("Data.csv",FILE_WRITE|FILE_CSV);
if(FileHandle==INVALID_HANDLE)
{
Print("Ошибка " + IntegerToString((GetLastError())));
}
for(int i=size-1;i>=0;i--)
{
FileWrite(FileHandle, TimeToString(rates[i].time), DoubleToString(rates[i].open, _Digits), DoubleToString(rates[i].high, _Digits), DoubleToString(rates[i].low, _Digits), DoubleToString(rates[i].close, _Digits));
}
Print("size = " + FileSize(FileHandle));
FileFlush(FileHandle);
FileClose(FileHandle);
}
else
{
Print("Не удалось получить исторические данные по символу ",Symbol());
Print("Ошибка " + GetLastError());
}
}
I decided to check how ArrayResize function works with all parameters. It compiles without problems, auto-trading is enabled everywhere, but the Expert Advisor unloads from the chart without even going to OnInit.
What is the problem, I can't figure it out.
I decided to check how ArrayResize function works with all parameters. It compiles without problems, auto-trading is enabled everywhere, but the Expert Advisor unloads from the chart without even going to OnInit.
What is the problem, I can't figure it out.
Banal out of range, check in "Experts" tab
Reserving is not an allocation, your array is still five items, although the memory is allocated for 10.
Banal out of range, look at the "Experts" tab.
Reserving is not allocation, your array is still five items, even though you have allocated memory for 10.
I decided to check how ArrayResize function works with all parameters. It compiles without problems, auto-trading is enabled everywhere, but the Expert Advisor unloads from the chart without even going to OnInit.
Hello,
I, after testing and enabling optimisation, get this:
Core 1 genetic pass (127, 1195) tested with error "critical runtime error
The test is normal.