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:

    https://ninjatrader.com/support/help...alues_that.htm

    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 SharkTankValue, Today, 03:19 AM
        0 responses
        2 views
        0 likes
        Last Post SharkTankValue  
        Started by Sheridan, Yesterday, 11:06 AM
        1 response
        26 views
        0 likes
        Last Post NinjaTrader_Jason  
        Started by JasmneGardne, Today, 01:07 AM
        0 responses
        22 views
        0 likes
        Last Post JasmneGardne  
        Started by ttodua, 01-28-2018, 04:24 PM
        6 responses
        975 views
        0 likes
        Last Post Heart
        by Heart
         
        Started by jeronymite, Yesterday, 10:22 PM
        0 responses
        31 views
        0 likes
        Last Post jeronymite  
        Working...
        X