Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Access Incidator Series Data from Strategy

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Access Incidator Series Data from Strategy

    I have a custom indicator that along with some plots also
    Code:
    Series<double>
    properties for data that I want to track, but not plot.

    Whenever I access
    Code:
    customIndicator.SeriesX[0]
    from the strategy the value is always zero.

    Is this something that is not supported. Can only plotted values be referenced?

    Any help or tips what be greatly appreciated.

    #2
    Hello calebsandfort,

    Thank you for the post.

    Please see this reference sample that demonstrates how to expose indicator values that are not plots:



    The important parts are the public properties of the series in the #region Properties section of the SampleBoolSeries.cs indicator file.

    Please let me know if I can assist further.
    Chris L.NinjaTrader Customer Service

    Comment


      #3
      Originally posted by calebsandfort View Post
      I have a custom indicator that along with some plots also
      Code:
      Series<double>
      properties for data that I want to track, but not plot.

      Whenever I access
      Code:
      customIndicator.SeriesX[0]
      from the strategy the value is always zero.

      Is this something that is not supported. Can only plotted values be referenced?

      Any help or tips what be greatly appreciated.
      Hi Chris

      Thanks for sending this along. This is basically what I was doing, but instead of doing
      Code:
      SampleBoolSeries().BullIndication[0]
      , I was doing
      Code:
      boolIndicator.BullIndication[0]
      where boolIndicator is a variable I initialized at the start of the strategy.

      So, is it necessary to create a new instance of the indicator each time in OnBarUpdate?

      Comment


        #4
        Hello calebsandfort,

        Thank you for the reply.

        You can set up the indicator at the class level to make one instance of it. I have attached the modified example.

        Please let me know if you have any questions.
        Attached Files
        Chris L.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by CortexZenUSA, Today, 12:53 AM
        0 responses
        1 view
        0 likes
        Last Post CortexZenUSA  
        Started by CortexZenUSA, Today, 12:46 AM
        0 responses
        1 view
        0 likes
        Last Post CortexZenUSA  
        Started by usazencortex, Today, 12:43 AM
        0 responses
        5 views
        0 likes
        Last Post usazencortex  
        Started by sidlercom80, 10-28-2023, 08:49 AM
        168 responses
        2,266 views
        0 likes
        Last Post sidlercom80  
        Started by Barry Milan, Yesterday, 10:35 PM
        3 responses
        13 views
        0 likes
        Last Post NinjaTrader_Manfred  
        Working...
        X