
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
I haven't tried it yet, but I understand the idea of putting it together in one file, so maybe the developers can point out an option - howto connect unchanged data from a folder.
Good afternoon!
Here's a function I've written. It calculates the ratio of the current exchange rate to the rate at the beginning of 2010.
double CalcKorr()
{
double Bid = SymbolInfoDouble(_Symbol,SYMBOL_BID);
double OtkrVal[1];
datetime time=D'2010.01.01 00:00:00';
if (CopyOpen(_Symbol,PERIOD_MN1,time,1,OtkrVal) != 1) return(0);
return(Bid / OtkrVal[0]);
}
It works correctly if I run a test for 2011 or earlier periods, but returns 0 if I test for 2012 :(
Please advise what may be the problem.
Expert Advisor is running on 10 minutes, I am using server and account from Championship 2012 for testing.
Good afternoon!
Here's a function I've written. It calculates the ratio of the current exchange rate to the rate at the beginning of 2010.
double CalcKorr()
{
double Bid = SymbolInfoDouble(_Symbol,SYMBOL_BID);
double OtkrVal[1];
datetime time=D'2010.01.01 00:00:00';
if (CopyOpen(_Symbol,PERIOD_MN1,time,1,OtkrVal) != 1) return(0);
return(Bid / OtkrVal[0]);
}
It works correctly if I run a test for 2011 or earlier periods, but returns 0 if I test for 2012 :(
Please advise what may be the problem.
Expert Advisor is running on 10 minutes, I am using server and account from Championship 2012 for testing.
Yes, I don't know what the logic of the program is, but the period of 10 min is denoted a little differently.
Everything else works on 10 minutes, such as this:
CopyHigh(_Symbol, _Period, 0, 2, MaxVal )
Only this function tries to take data from the month.
And how to print the error? I understand that CopyOpen(_Symbol,PERIOD_MN1,time,1,OtkrVal) returns -1 instead of 1.
And how to print the error? I understand that CopyOpen(_Symbol,PERIOD_MN1,time,1,OtkrVal) returns -1 instead of 1. But why does this happen, can it output an error?
Put up a printout of the error - let's see.
error = 4401
I can't find any decodingof error codes in Metatrader...
error = 4401
I can't find any decodingof error codes in Metatrader...
OK, "Requested history not found". I.e. January 2010 is not found in 2012, right?
And on the demo account (not in the tester) what does it show?
OK, "Requested history not found". I.e. January 2010 is not found in 2012, right?
And on the demo account (not in the tester) what does it show?
Uh-huh, it is not detected.
I created a new demo account (not championship one). Lots greater than 5 are now skipped if I test for 2011, but there is the same error for 2012.
I guess I have to set somewhere how much history is accessible before the test period. And by default it must be 2 years... Only where is it configured...
So this error also occurs on a demo account(not in the tester)?
I would rather read about the history for testing in the "Testing of trading strategies" section.