Profile Picture

ChartSettings.Symbol is null in IndicatorBase

Posted By alpha23 3 Years Ago
Message
Posted Saturday January 04 2014
Why is this null when adding an indicator to a chart? I need the Symbol in the indicator which in turn references the symbol in a database.

Thanks, Duane
Posted Monday January 13 2014
ChartSettings was meant for controlling how an indicator should be displayed on the chart when it is created in system code. It's not really meant to be read from the indicator code itself.

If you need to know what symbol an indicator is for, implement ISystemAccess and use the Symbol passed to the Initialize() method. If it's not in a system then the SystemData parameter will be null, but you should still get called with the correct Symbol.

Thanks,
Daniel
Posted Wednesday March 23 2016
On an Iindicator plotted on a chart, even with ISystemAccess implemented, Initialize(...) is never called.  Is there another mechanism to determine the symbol of an indicator plotted via the charting interface?

Secondly, the default ConstructorArgument for a ConstructorArgumentType.String doesn't seem to show on-screen (i.e. the field is shown, but the default value "$SPX" is not shown...)

Partial sample code...


public class IndicatorTest: ISystemAccess, IIndicator
{
   private string _code = "";
  [ConstructorArgument("IndexSymbol", ConstructorArgumentType.String, "$SPX", 1)]

  public void Initialize(SystemData systemdata, Symbol symbol)
   {
        _code = symbol.Name;
    }

  public IndicatorTest(string IndexSymbol)
   {
        _indexsymbol = IndexSymbol;
    }

   public void SetBars(RList<BarData> bars)
   {
   }

   ...


Best regards,
Richard Dale
Norgate Data
Posted Tuesday March 29 2016
FYI, this is still an issue in build 56.

Best regards,
Richard Dale
Norgate Data
Posted Monday April 11 2016
I've fixed the issue where ISystemAccess.Initialize is not called for indicators added directly to a chart outside of a system.  I still need to investigate the constructor argument issue.

Thanks,
Daniel
Posted Wednesday April 20 2016
ISystemAccess.Initialize works as designed now for indicators plotted on charts.  The constructor issue is only minor and doesn't really as it's only for a default - the user needs to input something there anyway.

Best regards,
Richard Dale
Norgate Data


Similar Topics


Reading This Topic


2005-2017 © RightEdge Systems