CustomSymbolNewChartEventArgs
class cAlgo.API Since 5.3
DesktopCLICloud
Provides data for custom symbol 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 CustomSymbolNewChartEventArgs
Namespace: cAlgo.API · Group: EventArgs
Examples
protected override void OnStart()
{
var customSymbol = CustomSymbols.Add("EURUSD.custom", Symbols.GetSymbol("EURUSD"));
customSymbol.NewChart += OnCustomSymbolNewChart;
}
private void OnCustomSymbolNewChart(CustomSymbolNewChartEventArgs args)
{
Print("New {0} chart opened for {1}, custom bars available: {2}", args.Chart.TimeFrame, args.CustomSymbol.Name, args.CustomBars != null);
}
def on_start(self):
customSymbol = api.CustomSymbols.Add("EURUSD.custom", api.Symbols.GetSymbol("EURUSD"))
customSymbol.NewChart += self.on_custom_symbol_new_chart
def on_custom_symbol_new_chart(self, args):
api.Print(f"New {args.Chart.TimeFrame} chart opened for {args.CustomSymbol.Name}, custom bars available: {args.CustomBars is not None}")
Properties
| Name | Description |
|---|---|
ChartDesktopCLICloudChart | Chart that is newly opened or switched to custom symbol. |
CustomBarsDesktopCLICloudCustomBars | Gets custom bars for the newly opened custom symbol chart. |
CustomSymbolDesktopCLICloudCustomSymbol | Gets custom symbol. |