CustomSymbolBarsNeededArgs.CustomSymbol
property · CustomSymbolBarsNeededArgs · cAlgo.API Since 5.3
DesktopCLICloud
Gets custom symbol.
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 CustomSymbol CustomSymbol {get;}
customSymbolBarsNeededArgs.CustomSymbol: CustomSymbol
Returns CustomSymbol
Examples
protected override void OnStart()
{
CustomSymbols.Add("MYEURUSD", Symbols.GetSymbol("EURUSD")).BarsNeeded = OnBarsNeeded;
}
private void OnBarsNeeded(CustomSymbolBarsNeededArgs args)
{
Print("Custom symbol {0} needs bars", args.CustomSymbol.Name);
}
from System import Action
def on_start(self):
api.CustomSymbols.Add("MYEURUSD", api.Symbols.GetSymbol("EURUSD")).BarsNeeded = Action[CustomSymbolBarsNeededArgs](self.on_bars_needed)
def on_bars_needed(self, args):
api.Print(f"Custom symbol {args.CustomSymbol.Name} needs bars")