BarsTickEventArgs
class cAlgo.API
DesktopCLICloud
Provides data for the tick bar event.
Definition
public class BarsTickEventArgs
Namespace: cAlgo.API · Group: EventArgs
Examples
protected override void OnStart()
{
Bars.Tick += OnBarsTick;
}
private void OnBarsTick(BarsTickEventArgs args)
{
var lastBar = args.Bars.LastBar;
Print("{0} {1} tick | Close: {2} | First tick of a new bar: {3}", args.Bars.SymbolName, args.Bars.TimeFrame, lastBar.Close, args.IsBarOpened);
}
def on_start(self):
api.Bars.Tick += self.on_bars_tick
def on_bars_tick(self, args):
last_bar = args.Bars.LastBar
api.Print(f"{args.Bars.SymbolName} {args.Bars.TimeFrame} tick | Close: {last_bar.Close} | First tick of a new bar: {args.IsBarOpened}")
Properties
| Name | Description |
|---|---|
BarsDesktopCLICloudBars | Gets the Bar objects data. |
IsBarOpenedDesktopCLICloudbool | Defines if current tick is the first tick of a new bar. |