if(copied<=0) { Print("Can't load ticks. Error: ",GetLastError()); }
0 is not an error, it simply means there is no ticks available.
As you provide yourself the link to the documentation, please read it again. No more than 2,000 ticks are available. There was probably a lot more than 2,000 ticks since 2 March, they are no more available.
0 is not an error, it simply means there is no ticks available.
As you provide yourself the link to the documentation, please read it again. No more than 2,000 ticks are available. There was probably a lot more than 2,000 ticks since 2 March, they are no more available.
Thank you. One more question
- is there any chance in mql5 that I can access tick value if I know datetime (that is located further, than 2,000 ticks)?
And can I use function CopyTicks in tester (metatrader 5 tester), because when I did it, I caught error 4014 (which means from documentation - ERR_FUNCTION_NOT_ALLOWED, Function is not allowed for call). Thank you very much for your answers!
Whats the problem here? No ticks are returned:
int OnInit() { //--- Initializing expert //--- ok return(INIT_SUCCEEDED); } //+------------------------------------------------------------------+ //| Deinitialization function of the expert | //+------------------------------------------------------------------+ void OnDeinit(const int reason) { } //+------------------------------------------------------------------+ //| "Tick" event handler function | //+------------------------------------------------------------------+ void OnTick() { //ExtExpert.OnTick(); MqlTick l_scTicks[]; int l_inCopiedTicks = 0; ulong l_ulCopyFrom = 0; Print( TimeCurrent() ); l_ulCopyFrom = TimeCurrent(); l_ulCopyFrom *= 1000; l_ulCopyFrom -= 5000; l_inCopiedTicks = CopyTicks("EURUSD", l_scTicks, COPY_TICKS_ALL, l_ulCopyFrom ); return; } //+------------------------------------------------------------------+ //| "Trade" event handler function | //+------------------------------------------------------------------+ void OnTrade() { } //+------------------------------------------------------------------+ //| "Timer" event handler function | //+------------------------------------------------------------------+ void OnTimer() { } //+------------------------------------------------------------------+
Can someone help me?
Hi,
"0" - it means that nothing is copied.
CopyTicks() must return non zero value.
On the Russian forum said that this function is a mistake that is not corrected.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use