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 ATR within BarsType code

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

    Access ATR within BarsType code

    I'm trying to develop a custom volatility-based bar type for myself but it seems I'm unable to call the ATR indicator from a BarsType class. Is there any way I can get around this? Preferably I'd just like to call the ATR() function but if it's possible to calculate it myself with the local bars array, that would work too.

    Thanks

    #2
    Hello brohnhdon,

    Unfortunately, indicators can only be called from scripts that have an internal primary series.

    i.e. Indicators and Strategies

    This means that you would have to explicitly re-code the logic for the ATR into your custom bar type script.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Originally posted by brohnhdon View Post
      I'm trying to develop a custom volatility-based bar type for myself but it seems I'm unable to call the ATR indicator from a BarsType class. Is there any way I can get around this? Preferably I'd just like to call the ATR() function but if it's possible to calculate it myself with the local bars array, that would work too.

      Thanks
      In NT7, I coded renko bar length = ATR(10). Note: somehow ninja doesn't read ATR value thru parm setting so if you want to change ATR value you have to modify the code. It should be easy to adapt it to NT8 since there is NT8 renko bar already.
      Attached Files

      Comment


        #4
        Originally posted by nkhoi View Post

        In NT7, I coded renko bar length = ATR(10). Note: somehow ninja doesn't read ATR value thru parm setting so if you want to change ATR value you have to modify the code. It should be easy to adapt it to NT8 since there is NT8 renko bar already.
        Has anybody updated this for NT8?

        Comment


          #5
          Hello mase2005, thanks for your post.

          We will be making a NinjaTrader 8 version of the BetterRenkoATR bar type as time allows. If you would like the conversion out faster a NinjaScript consultant may be hired from the NinjaTrader Ecosystem.

          Thanks in advance for your patience.
          Chris L.NinjaTrader Customer Service

          Comment


            #6
            Hello, all.

            I have attached a version of the ATR Renko bars to this post.

            Kind regards,
            -ChrisL
            Attached Files
            Chris L.NinjaTrader Customer Service

            Comment


              #7
              NinjaTrader_ChrisL OR anyone. I have been trying for years to figure out a MTF ATR to be used with non-time based charts like Renkos. I tried to see where I could extract the pieces of code from here that are using an alternate timed ATR but it is too complex for my ken. May I request someone square this down to a MTF ATR indicator? Thank you in advane.

              Comment


                #8
                Hi JMont1, thanks for posting.

                The samples we provide come "as is". A member of the forum will need to fulfill the request for a multi time frame ATR indicator.

                Best regards,
                -ChrisL
                Chris L.NinjaTrader Customer Service

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by firefoxforum12, Yesterday, 08:53 PM
                1 response
                13 views
                0 likes
                Last Post NinjaTrader_BrandonH  
                Started by kmunroe478, Yesterday, 05:39 PM
                2 responses
                14 views
                0 likes
                Last Post NinjaTrader_Jesse  
                Started by kevinenergy, 02-17-2023, 12:42 PM
                115 responses
                2,699 views
                1 like
                Last Post kevinenergy  
                Started by prdecast, Today, 06:07 AM
                1 response
                4 views
                0 likes
                Last Post NinjaTrader_LuisH  
                Started by Christopher_R, Today, 12:29 AM
                1 response
                14 views
                0 likes
                Last Post NinjaTrader_LuisH  
                Working...
                X