Confused about adding indicators to signals: by original method, by AddIndicator, by Command Line

Questions about MultiCharts .NET and user contributed studies.
Talky_Zebra
Posts: 45
Joined: 07 Mar 2024
Has thanked: 13 times
Been thanked: 1 time

Confused about adding indicators to signals: by original method, by AddIndicator, by Command Line

Postby Talky_Zebra » 23 Apr 2024

What I would like to do:
  • Add indicators to signals programmatically
  • Change their input settings programmatically
  • Get data from them to use in signal logic
  • See them on the chart
The only one I really understand is the "original method" where I might do something like this:

Code: Select all

private VariableSeries<double> adx_values; private PowerLanguage.Function.ADX m_adx_indic; protected override void Create() { m_adx_indic = new PowerLanguage.Function.ADX(this); } protected override void StartCalc() { m_adx_indic.Length = 20; } protected override void CalcBar(){ adx_values.Value = m_adx_indic[0]; StrategyInfo.SetPlotValue(0, adx_values.Value); }
... and then make a "dumb" indicator to plot the values... which I then also have to attach to the chart programmatically as with JoshM's tutorial here: https://www.tradingcode.net/multicharts ... -strategy/. Clunky, but it gets the job done.

Is any of this made easier or faster using either AddIndicator or the CommandLine to add an indicator, as well as providing all of the flexibility that I listed at the top? (BTW: I don't mean just using ADX, that was just an example. It could be any indicator.)

Return to “MultiCharts .NET”