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

How do I use AddHeikenAshi

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

    How do I use AddHeikenAshi

    In my indicator I want to have some calculation based on HeikenAshi OHLC candles, so for this I include AddHeikenAshi() in ''else if (State == State.Configure)'' but I do not know how to fill the parameters of AddHeikenAshi(). I want the same instruments and the same timeframe as whatever the timeframe and instrument my indicator is applied to. So for instance if I apply my indicator to a chart of ES with 30min candles, I want the HeikenAshi OHLC candles for ES on the 30min chart. How do I do this ?

    #2
    Hello alanlopen,

    You can see an example of using AddHeikenAshi at the bottom of its help guide page:



    This method does not have a way to inherit the primary instrument so you would need to type in the instrument like shown in the sample.

    Timeframes cannot be automatically assumed by any of the add data methods so that is something you also need to specify when adding it.

    JesseNinjaTrader Customer Service

    Comment


      #3
      so how do i get my indicator to calculate form the heikin-ashi prices? for instance the taking the official RSI, and adding a feature of choosing (with an enumeration for instance) either the real price or the H-A price ?

      Comment


        #4
        Hello alanlopen,

        To do that you would need to AddHeikenAshi so the script always adds that data. You can then make a enum property that is used from OnBarUpdate to determine which indicator value to use.

        The AddDataSeries/AddHeikenAshi methods are not dynamic and cannot use variables so if you plan to use secondary data based on a user selection you still have to always add that secondary data and then make the choice of what series is used in your OnBarUpdate logic.

        JesseNinjaTrader Customer Service

        Comment


          #5
          yes so it's not a solution. the only way is to calculte my own HA series in my script, using the real price which is always determined by the current chart.

          Comment


            #6
            Hello alanlopen,,

            You could certainly do that if you wanted. The add data methods cannot be used dynamically so if you wanted to dynamically calculate something from the price you could make your own logic to do that.

            JesseNinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by bortz, 11-06-2023, 08:04 AM
            47 responses
            1,607 views
            0 likes
            Last Post aligator  
            Started by jaybedreamin, Today, 05:56 PM
            0 responses
            9 views
            0 likes
            Last Post jaybedreamin  
            Started by DJ888, 04-16-2024, 06:09 PM
            6 responses
            19 views
            0 likes
            Last Post DJ888
            by DJ888
             
            Started by Jon17, Today, 04:33 PM
            0 responses
            6 views
            0 likes
            Last Post Jon17
            by Jon17
             
            Started by Javierw.ok, Today, 04:12 PM
            0 responses
            15 views
            0 likes
            Last Post Javierw.ok  
            Working...
            X