Definition
The OnBarUpdate() method is called whenever a bar is updated. If the "CalculateOnBarClose" property is set to true, it is only called on the close of each bar, otherwise it is called on each incoming tick. This is the method where all of your strategy or indicator core calculation logic should be contained.
Method Return Value
This method does not return a value.
Syntax
See example below. The NinjaScript indicator and strategy wizards automatically generate the method syntax for you.
Examples
protected override void OnBarUpdate()
{
if (CurrentBar < 1)
return;
if (Low[0] > Lows[1])
Print("The current bar's low price is greater");
}
|
|
|