"iCustom" Alternative - page 2

 
@William Roeder #: Exponential requires 3.45×(Length+1) bars to converge to 1/10 percent. (EMA Period 5 requires 21 initial bars.)  Moving average - Wikipedia

Unfortunately Wikipedia has removed that part from their current text. The explanation is only accessible in the "editing history" — 14:45, 22 November 2022

Here is a screenshot for future reference:



 
Fernando Carreiro #: Unfortunately Wikipedia has removed that part from their current text. The explanation is only accessible in the "editing history" — 14:45, 22 November 2022‎. Here is a screenshot for future reference:

oh, i see, then instead of icustom, you just have to insert the indicator logic in the oninit function. thanks for the formula

 
Sie Samuel Roland Youl #: oh, i see, then instead of icustom, you just have to insert the indicator logic in the oninit function. thanks for the formula
Don't try to use any price (or indicator) or server related functions in OnInit (or on load or in OnTimer before you've received a tick), as there may be no connection/chart yet:
  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. A new tick is received, OnCalculate/OnTick is called. Now TickValue, TimeCurrent, account information and prices are valid.