CustomTimeFrameNewChartEventArgs.Chart
property · CustomTimeFrameNewChartEventArgs · cAlgo.API Since 5.3
DesktopCLICloud
Chart that is newly opened or switched to custom time frame.
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 Chart Chart {get;}
customTimeFrameNewChartEventArgs.Chart: Chart
Returns Chart
Examples
protected override void OnStart()
{
var customTimeFrame = TimeFrameManager.Custom.Add("My Time Frame");
customTimeFrame.NewChart += OnCustomTimeFrameNewChart;
}
private void OnCustomTimeFrameNewChart(CustomTimeFrameNewChartEventArgs args)
{
args.Chart.DrawStaticText("info", "Custom time frame chart", VerticalAlignment.Top, HorizontalAlignment.Left, Color.Gray);
}
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):
args.Chart.DrawStaticText("info", "Custom time frame chart", VerticalAlignment.Top, HorizontalAlignment.Left, Color.Gray)