Initializes the calculation after expiration of the timeout, set in seconds.
<div style="background-color: #E3FBE5;">'''Note''': The maximum recalculation frequency is 100 milliseconds (0.1 sec).</div> RecalcLastBarAfter is used for the slow markets in which new ticks come in infrequently. Normally, calculation of the studies is performed in events when the immediate tick has come to a chart. When the tick has not come since the moment of the last calculation and during timeout (sec) a new calculation is being initialized. When the tick has been received before timeout expiration, time counter is reset and countdown for RecalcLastBarAfter(Timeout) starts anew. ==== Usage ====
<syntaxhighlight>RecalcLastBarAfter(Timeout)</syntaxhighlight>
Where: [[ :'''Timeout ''' - the number of seconds.]]
==== Example == <syntaxhighlight>if (LastBarOnChart_s ==True) then begin Print("Current time: ", FormatTime("HH:mm:ss", ELTimeToDateTime_s(CurrentTime_s)), "."); RecalcLastBarAfter(5); end;</syntaxhighlight>RecalcLastBarAfter is used for the slow markets. Calculation of Returns the studies is performed in events when the immediate tick has come to a chart. following:
When the tick has not come since the moment of the last calculation and during timeout (sec) a new calculation is being initialized<syntaxhighlight>Current time: 13:29:10. Current time: 13:29:15.Current time: 13:29:20.Current time: 13:29:25.Current time: 13:29:30.Current time: 13:29:35.Current time: 13:29:40.</syntaxhighlight>
When Also note that in this example the tick has been received before timeout expirationRecalcLastBarAfter statement is only active if the condition returns true, time counter meaning that if the current bar isn't the LastBarOnChart, the RecalcLastBarAfter statement is reset and countdown for RecalcLastBarAfter(Timeout) starts anew</syntaxhighlight> not executed.
[[Category:Execution Control]]