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

Other indicator values

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

    Other indicator values

    In OnBarUpdate(), how can I use a call to a different indicator (ie ZigZag(DeviationType.Percent, 1, false) to get the value of that indicator at a specific time/BarsAgo.

    I'm trying to determine if the CurrentBar is an new high/low point. My plan is to get three sequential days and see if the middle one is the greatest/least of the three values. I know that if I do this it will lag by one day but that's ok.

    If there is a better way please let me know.

    #2
    LorneCash, you would just call that indicator method with your parameters and the appropriate index then (bars back you want to access).

    For the ZigZag and Swing indicator in specific you have dedicated methods available to access the bars ago the High / Low points occurred and their values -

    BertrandNinjaTrader Customer Service

    Comment


      #3
      And what if I wanted to display the whole indicator as part of another indicator. I'm sure there's an easy way to do that but could you point me to an example? I tried looking at the MACD thinking that it would use something like that with the EMA but it appears that the code is simple enough that it's been duplicated in the MACD itself rather than referencing the EMA indicator.

      Comment


        #4
        Hi LorneCash,

        That is the case. You will need to duplicate the code of the indicator in your indicator as there is not a way to add an indicator for display purposes to another indicator the way that you can do this for strategies.

        You could, alternatively, create extra plots in your indicator and then set these plots to the values of the other indicator.

        Plot Class - http://www.ninjatrader.com/support/h...plot_class.htm

        Setting the plot Value - http://www.ninjatrader.com/support/h.../nt7/value.htm
        Chelsea B.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Waxavi, Today, 02:00 AM
        0 responses
        1 view
        0 likes
        Last Post Waxavi
        by Waxavi
         
        Started by elirion, Today, 01:36 AM
        0 responses
        3 views
        0 likes
        Last Post elirion
        by elirion
         
        Started by gentlebenthebear, Today, 01:30 AM
        0 responses
        4 views
        0 likes
        Last Post gentlebenthebear  
        Started by samish18, Yesterday, 08:31 AM
        2 responses
        9 views
        0 likes
        Last Post elirion
        by elirion
         
        Started by Mestor, 03-10-2023, 01:50 AM
        16 responses
        391 views
        0 likes
        Last Post z.franck  
        Working...
        X