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 Market1337, Today, 08:54 AM
        0 responses
        11 views
        0 likes
        Last Post Market1337  
        Started by Bobin, Today, 04:29 AM
        1 response
        13 views
        0 likes
        Last Post bltdavid  
        Started by Lyubomir Kratinov, Today, 06:36 AM
        2 responses
        13 views
        0 likes
        Last Post Lyubomir Kratinov  
        Started by joostb, Today, 12:59 AM
        2 responses
        12 views
        0 likes
        Last Post joostb
        by joostb
         
        Started by Shai Samuel, Today, 02:35 AM
        0 responses
        12 views
        0 likes
        Last Post Shai Samuel  
        Working...
        X