Have you tried Print the number of ticks returned by the function, I have, with the from parameter set, it returns 2000 ticks, CopyTicksRange, if returns effectively something return all the ticks required, not CopyTicks, I had an all-in-one function to do the job in all circumstance, CopyTicksRange first, if no ticks, a loop with CopyTicks, and in that loop, from and to was set, and only 2000 ticks was returned per loop, it is said in the doc "not more than 2000", it's not specific to that case on not specifying from and count, or to_msc
I have no idea why you insist about this "2000".
voidOnStart()
{
//---MqlTick ticks[];
datetime fromDT = D'2025.12.01';
ulong from = ulong(fromDT)*1000;
ulong to = ulong(TimeCurrent())*1000;
int copied = CopyTicks(_Symbol,ticks,COPY_TICKS_ALL,from,10000);
printf("CopyTicks : %i copied",copied);
int rangeCopied = CopyTicksRange(_Symbol,ticks,COPY_TICKS_ALL,from,to);
printf("CopyTicksRange : %i copied",rangeCopied);
}
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
Have you tried Print the number of ticks returned by the function, I have, with the from parameter set, it returns 2000 ticks, CopyTicksRange, if returns effectively something return all the ticks required, not CopyTicks, I had an all-in-one function to do the job in all circumstance, CopyTicksRange first, if no ticks, a loop with CopyTicks, and in that loop, from and to was set, and only 2000 ticks was returned per loop, it is said in the doc "not more than 2000", it's not specific to that case on not specifying from and count, or to_msc
I have no idea why you insist about this "2000".
2025.12.19 10:44:51.904 Ticks (USDCHF,H1) CopyTicks : 10000 copied
2025.12.19 10:44:51.918 Ticks (USDCHF,H1) CopyTicksRange : 524549 copied
I have no idea why you insist about this "2000".
2025.12.19 10:44:51.904 Ticks (USDCHF,H1) CopyTicks : 10000 copied
2025.12.19 10:44:51.918 Ticks (USDCHF,H1) CopyTicksRange : 524549 copied