Help with a very small part of code please
Nicolas Zouein:
Please can anyone point out what is wrong in this part of code below, it is showing "array out of range" and pointing that the error is on this line: datetime time = Time[0];
Hi,
Please try this :)
datetime time = iTime(_Symbol,PERIOD_D1,1);
Yohana Parmi:
Hi,
Please try this :)
Thank You so much, you're a queen !
Nicolas Zouein: it is showing "array out of range" and pointing that the error is on this line: datetime time = Time[0];
Don't try to use any price or server related functions in
OnInit (or on load,) as there may be no connection/chart yet:
- Terminal starts.
- Indicators/EAs are loaded. Static and globally declared variables are initialized. (Do not depend on a specific order.)
- OnInit is called.
- For indicators OnCalculate is called with any existing history.
- Human may have to enter password, connection to server begins.
- New history is received, OnCalculate called again.
- New tick is received, OnCalculate/OnTick is called. Now TickValue, TimeCurrent and prices are valid.
Please can anyone point out what is wrong in this part of code below, it is showing "array out of range" and pointing that the error is on this line: datetime time = Time[0];