CustomTimeFrameNewChartEventArgs
class cAlgo.API Since 5.3
DesktopCLICloud
Provides data for custom time frame NewChart event.
Environment behaviour
CLI — not supported. Available to plugins only, and plugins cannot run in the CLI.
Cloud — not supported. Available to plugins only, and plugins cannot run in the cloud.
Definition
public class CustomTimeFrameNewChartEventArgs
Namespace: cAlgo.API · Group: EventArgs
Examples
protected override void OnStart()
{
var customTimeFrame = TimeFrameManager.Custom.Add("My Time Frame");
customTimeFrame.NewChart += OnCustomTimeFrameNewChart;
}
private void OnCustomTimeFrameNewChart(CustomTimeFrameNewChartEventArgs args)
{
Print("New {0} chart opened for {1}", args.CustomTimeFrame.Name, args.CustomBars.Symbol.Name);
}
def on_start(self):
customTimeFrame = api.TimeFrameManager.Custom.Add("My Time Frame")
customTimeFrame.NewChart += self.on_custom_time_frame_new_chart
def on_custom_time_frame_new_chart(self, args):
api.Print(f"New {args.CustomTimeFrame.Name} chart opened for {args.CustomBars.Symbol.Name}")
Properties
| Name | Description |
|---|---|
ChartDesktopCLICloudChart | Chart that is newly opened or switched to custom time frame. |
CustomBarsDesktopCLICloudCustomBars | Gets custom bars for the newly opened custom time frame chart. |
CustomTimeFrameDesktopCLICloudCustomTimeFrame | Gets custom time frame. |