Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Using exponential for ATR

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

    Using exponential for ATR

    Hi...when using ATR, I want the average to be calculated exponentially....I do not see that option in properties, is this something that would need to be done in NS?

    #2
    Hello Stok,

    Yes, if you would like to change the way the ATR is calculated you would have to create a new indicator using NinjaScript.

    You may view the link below for more information about the ATR Indicator.
    http://www.ninjatrader.com/support/h..._range_atr.htm

    Note that you can view this indicator method source code by selecting the menu Tools > Edit NinjaScript > Indicator within the NinjaTrader Control Center window and double click on the indicator.

    Let us know if we can be of further assistance.
    JCNinjaTrader Customer Service

    Comment


      #3
      I am just now coming back around to getting this programmed. I have looked at the NS for ATR, but I cannot figure out what to do to make it calculate the MA of ATR exponentially. Any help/direction?

      Comment


        #4
        Hello Stok,

        I am not quite sure what you have having trouble with but please note that you may view the code of our EMA ( Exponential Moving Average ) indicator as well.

        Happy to be of further assistance.
        JCNinjaTrader Customer Service

        Comment


          #5
          I do not know NS very well (I do know Easy Language), and would have to learn it at some point. It seems to me if I want a EMA of the ATR, there is no place in the ATR NS to do that.....it looks like it would take a whole other custom indicator. Honestly, I am looking for some simple help to modifying a few canned indicators, not building brand new ones.

          Comment


            #6
            Hello Stok,

            If you are new to NinjaScript you may view the following thread that has some great links to help you get started with NinjaScript.


            While, yes it would require a New NinjaScript file in order for it to be calculated you may use the Indicators that are already prebuilt for the calculations. For Example:

            Code:
            #region Variables
                   private int aTRPeriod = 14; // Default setting for ATRPeriod
                   private int eMAPeriod = 7; // Default setting for EMAPeriod
            #endregion
            
               
            protected override void Initialize()
            {
                  Add(new Plot(Color.FromKnownColor(KnownColor.Orange), PlotStyle.Line, "Plot0"));
                  Overlay				= false;
            }
            
            protected override void OnBarUpdate()
            {
                 Plot0.Set(EMA(ATR(ATRPeriod),EMAPeriod)[0]);
            }
            JCNinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Shansen, 08-30-2019, 10:18 PM
            24 responses
            938 views
            0 likes
            Last Post spwizard  
            Started by Max238, Today, 01:28 AM
            0 responses
            3 views
            0 likes
            Last Post Max238
            by Max238
             
            Started by rocketman7, Today, 01:00 AM
            0 responses
            2 views
            0 likes
            Last Post rocketman7  
            Started by wzgy0920, 04-20-2024, 06:09 PM
            2 responses
            27 views
            0 likes
            Last Post wzgy0920  
            Started by wzgy0920, 02-22-2024, 01:11 AM
            5 responses
            32 views
            0 likes
            Last Post wzgy0920  
            Working...
            X