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 have tried to use it like this:
But the statement is returning -1 instead of the number of ticks copied. Please let me know. I understand that the ticks for TimeCurrent() cannot be 2, it must be 1, but with 1 still I get -1 as an output. please guide.
For anyone who finds this topic researching the usage of CopyTicks (and CopyRange) I want to address two misconceptions in this thread.
- As per documentation for CopyTicks, it clearly states that 0 implies the "current" time:
- When using any datetime (such as TimeCurrent()) make sure to convert the time to milliseconds. For datetime is in seconds elapsed since January 01, 1970, whereas from_msc is in milliseconds since January 01, 1970:
The OP used TimeCurrent() without converting it to milliseconds. For what it's worth, here's an example function which searches for the last known tick till a given time.
Example call: