Problem with CopyHigh/Low - page 2

 
tivpaul :

Can you please let me know why is not ok to use CopyHigh/Low in OnInit() ? Thanks.

Answer: you can't and that's it. OnInit serves to prepare data, to prepare charts.

 
tivpaul: Can you please let me know why is not ok to use CopyHigh/Low in OnInit() ? Thanks.
  1. Terminal starts.
  2. Indicators/EAs are loaded. Static and globally declared variables are initialized. (Do not depend on a specific order.)
  3. OnInit is called.
  4. For indicators OnCalculate is called with any existing history.
  5. Human may have to enter password, connection to server begins.
  6. New history is received, OnCalculate called again.
  7. New tick is received, OnCalculate/OnTick is called. Now TickValue, TimeCurrent, account information and prices are valid.