Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

indicator formulas

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

    indicator formulas

    Hi,

    I would like to understand the calculations behind the indicators so that i can logically create strategies.
    how can i find out how indicators are being calculated in ninjatrader?
    for example the keltner channel?

    thanks
    alex

    #2
    Alex, you can just open them up via Tools > Edit NinjaScript > Indicator...then point to the one you're interested in, this will show you the source code.
    BertrandNinjaTrader Customer Service

    Comment


      #3
      indicator definition

      hi,

      Thanks for your reply.
      I have one other question, when I looked at the way the keltner channel is calculated
      I noticed that the SMA is calculated as typical:

      SMA(Typical, Period)[
      0];

      does the "Typical" stand for the way the SMA is calculated?
      and if yes, how is it calculated?

      Also, there is another part of code i don't quiet understand:

      double offset = SMA(diff, Period)[0] * offsetMultiplier;

      I understand the SMA and offset multiplier, but what is meant by diff?

      thanks for your help,
      alex

      Comment


        #4
        Alex, the SMA midline serving as Keltner basis is calculated using the Typical price (H + L + C divided by 3) as input then, not for example the Close value.

        'diff' signifies the High / Low range of the bar, it's just a substraction used later to arrive at the upper lower band values.
        BertrandNinjaTrader Customer Service

        Comment


          #5
          Thanks for the quick reply.

          so the way i understand the calculation of the SMA using the typical price is that
          if we had for example a period of 10, then we would calculate the typical price for every candle within the 10 candle period and then divide the total by 10. is my logic correct?

          and for the difference of the high and low, would we calculate the difference of the high and low of all 10 individual candles and then divide the total by 10?

          or did i misunderstand the way these two are calculated?

          thanks
          alex

          Comment


            #6
            For the SMA, you would sun the individual tpyical price of each candle within the lookback period (10 in this case) and then divide this sum by this period to arrive at your current SMA value.

            The diff is doing the same, however it would take the average per above of the High - Low results.

            You can review the SMA indicator code, too if interested.
            BertrandNinjaTrader Customer Service

            Comment


              #7
              alright, i get it now.

              thanks for going through this with me.

              alex

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by Johnny Santiago, 10-11-2019, 09:21 AM
              95 responses
              6,193 views
              0 likes
              Last Post xiinteractive  
              Started by xiinteractive, 04-09-2024, 08:08 AM
              2 responses
              11 views
              0 likes
              Last Post xiinteractive  
              Started by Irukandji, Today, 09:34 AM
              1 response
              3 views
              0 likes
              Last Post NinjaTrader_Clayton  
              Started by RubenCazorla, Today, 09:07 AM
              1 response
              5 views
              0 likes
              Last Post RubenCazorla  
              Started by TraderBCL, Today, 04:38 AM
              3 responses
              25 views
              0 likes
              Last Post NinjaTrader_Jesse  
              Working...
              X