Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

# of bars to look back (Market analyzer) vs. Period vs. Maximum bars look back

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

    # of bars to look back (Market analyzer) vs. Period vs. Maximum bars look back

    ‘# of bars to look back’ (Market analyzer) vs. ‘Period’ (Indicator parameter) vs. ‘Maximum bars look back’ (Indicator data)

    Please describe in an easy to understand manner what is the purpose of the ‘Maximum bars look back’ setting in indicators data within a Chart.
    Indicators usually have a Period (e.g. RSI has 14)... so why is there maximum look back? If I set period to 14, doesn’t it mean a 14 look back?

    The other thing I don’t understand why is there a similar setting (# of bars to look back) in Market analyzer, if I can set the same thing (‘Maximum bars look back’) in the indicator data window?

    #2
    "Maximum bars look back" is a concept that governs how many historical data points the indicator will store in memory for use by code for itself or by other indicators. For the most part leaving it as 256 is fine. Only if you have a specific need to check out the value of your indicator older than 256 bars ago would you want to switch this to Infinite.

    "Period" of an indicator depends on the indicator, but for the most part is just the number of bars the indicator itself uses to calculate some values.

    "# of bars to look back" in the Market Analyzer is the number of bars to load for your indicator to run off of. Consider it like it being a chart and choosing how many bars on the chart you want the indicator to be running on. Do you want to be running on a chart with 100 historical bars or 1000 historical bars? This makes a difference for indicators whose values are derived from previous values. If the derivative begins 100 bars ago it would be a vastly different calculated value than if the derivative began 1000 bars ago.
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      I can’t see the difference.
      If I use a 200 day moving average, I need a period of 200. And for me, it means that I need a look back of 200, not less and not more.
      If I use RSI with a period value of 14, why would I need a look back of more than 14? The calculation of the RSI is based on the previous 14 bars, isn’t it? Hence the period 14.

      So I really don’t understand what is the difference between the indicators ‘period’ and the ‘# of bars to look back’ in market analyzer.

      Do you want to be running on a chart with 100 historical bars or 1000 historical bars? This makes a difference for indicators whose values are derived from previous values. If the derivative begins 100 bars ago it would be a vastly different calculated value than if the derivative began 1000 bars ago.


      Why?
      For example, calculation of a 100 day moving average is based on the previous 100 bars, isn’t it?
      So why would one need more than 100 bars to look back?
      Or more than 14 bars to look back in case of RSI?

      Comment


        #4
        Hello Arpad,

        'Maximum bars look back' will save the amount of historical data points in memory. The 'Period' setting will set the amount of bars that will be used to calculate the indicator value.

        For example, if you apply the RSI (14, 3) in a chart that contains 50 bars and one chart that contains 500 bars, the RSI values will be different.

        The RSI indicator is applied on more data in the 500 bar chart than the 50 bar chart, which can result in differences.
        JasonNinjaTrader Customer Service

        Comment


          #5
          Two things. I’d like to get 2 answers.

          1)
          RSI indicator Formula
          RSI = 100 - 100 / (RS + 1)
          where:
          RS = Average Upward Price Change / Average Downward Price Change
          Average Upward Price Change = [(previous Average Upward Price Change) x 13 + current Upward Change] / 14
          First Average Upward Change = Total of Upward Changes during past 14 periods / 14
          Average Downward Price Change = [(previous Average Downward Price Change) x 13 + current Downward Change] / 14
          First Average Downward Change = Total of Upward Changes during past 14 periods / 14

          I still don’t understand why would the values of the RSI (14, 3) be different in a 50 bar chart than a 500 bar chart, since the RSI period is 14.
          Calculation always starts from the most recent bar, and goes back as much bars as I set as period. Am I wrong?
          Could you please explain it in a manner that even someone with a knowledge can be read here in this topic would understand it?

          So Q1 is: why would the values of the RSI (14, 3) be different in a 50 bar chart than a 500 bar chart, since the RSI period is 14?
          Don’t take for granted any more knowledge from me. I only know things about this issue that you can read in this thread. Please answer considering this. Thank you.


          2)
          What is the difference between the indicators ‘period’ and the ‘# of bars to look back’ in market analyzer?

          Comment


            #6
            1. The RSI indicator does not only provide you with a RSI value. It provides you with RSI Average values. This averaging is a smoothed average of the RSI values. Historical RSI values will always ever so slightly impact this average calculation. If your history only went back 50 bars you would generate an average from that data set. If your history went back 500 bars, even though those old bars have a very very very small weight, they still impact the values.

            I suggest you open the RSI indicator to examine the code. This is how the average is calculated:

            Code:
            double rsiAvg = (2.0 / (1 + Smooth)) * rsi + (1 - (2.0 / (1 + Smooth))) * Avg[1];
            Now you can argue that this is such negligent factor which can be the case for this particular indicator, but there are many other indicators out there where it would not be a negligent factor. # of bars loaded plays a critical part in determining the calculated values depending on the exact logic the indicator employs.

            2. I suggest you review the code of the indicators to understand the difference. Every indicator uses "Period" differently. "# of bars lookback" is the number of bars to load for the indicator. The total number of bars to run the indicator on. This goes back to the explanation in #1. "Period" in the RSI impacts the RSI value calculation. "# of bars lookback" impacts the averaging calculations.

            If you feel you only want an SMA of 200 or something like that, since it is such a simple example, you can for sure make do with 200 as the "Period" and 200 as the "# of bars lookback". The differences comes in more complicated indicators. Everything is on a case by case basis dependent on the exact indicator logic.
            Josh P.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by fx.practic, 10-15-2013, 12:53 AM
            5 responses
            5,403 views
            0 likes
            Last Post Bidder
            by Bidder
             
            Started by Shai Samuel, 07-02-2022, 02:46 PM
            4 responses
            94 views
            0 likes
            Last Post Bidder
            by Bidder
             
            Started by DJ888, Yesterday, 10:57 PM
            0 responses
            6 views
            0 likes
            Last Post DJ888
            by DJ888
             
            Started by MacDad, 02-25-2024, 11:48 PM
            7 responses
            158 views
            0 likes
            Last Post loganjarosz123  
            Started by Belfortbucks, Yesterday, 09:29 PM
            0 responses
            8 views
            0 likes
            Last Post Belfortbucks  
            Working...
            X