Once (Reserved Word)
Reserved word used to specify that the EL statement or begin-end block that follows will only be executed once.
Syntax
Once ([optional boolean expression]) {follow by single statement or statement block}
[begin]
Statement(s)
[end]
Example
Once Value1 = GetAppInfo( aiApplicationType );
Performs the assignment of Value1 a single time. This improves performance instead of using a separate conditional expression (which must be tested on each bar) such as:
if CurrentBar = 1 then Value1 = GetAppInfo( aiApplicationType );
Additional Examples
Once (MarketPosition=1)
Begin
ClearPrintLog;
Print("Log Header");
End;
Clears the print log and prints a header the first time the market position equals once.