Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Add(PeriodType.Range) question

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

    Add(PeriodType.Range) question

    Hello,
    I'm trying to create an indicator to use on an 8 range chart with data from a 30 range chart in NT7. I know it can be done as I've seen 3rd party indicators that will do this. I've tried to use Add(PeriodType.Range, 30). Doing this does change the appearance of the indicator on an 8 range chart, but nothing like what it looks like on an actual 30 range chart. Can someone give me an idea of how to do this?
    I fiddled around with it in NT8 with AddDataSeries(BarsPeriodType.Range,30); and the results were similar. The indicator looks more like the period was simply increased. Any help is greatly appreciated.

    #2
    Hello CaptainAmericaXX,

    Thanks for your post.

    Plotting data based on a higher time frame generally would result in a stair step type effect in the lower time frame. This is because the data on the higher time frame does not change as fast as it does on the lower time time frame and this is even more pronounced in non time based bars (in this case range bars) because the number of bars can vary. However, despite the stair step, the indicator value should match when looking at the same time from the same indicator plotted on the lower to the same indicator plotted on the higher and considering which calculate mode is used.

    To illustrate please see the attached plot display and code example. Two 10 period SMAs are plotted, one from the chart bars and one from an added 30 range data series. On each bar update of the primary series, both plots are updated with the with their value at the time of the plot.
    Attached Files

    Comment


      #3
      Paul,
      Thank you for providing that code example it was very helpful. I'm still working primarily in NT 7 and I'm still having an issue adding a different PeriodType to my chart.
      protected override void Initialize()
      {
      Add(PeriodType.Range, 2);
      {
      This is all I've done to the indicator and it works ok most of the time, but occasionally it won't plot and I get the error "You are accessing an index with a value that is invalid since its out of range". I studied the BarsInProgress info, but I'm not comprehending how to make it work. Could you give me an example of how to add this properly?
      Thanks

      Comment


        #4
        Hello CaptainAmericaXX,

        Thanks for your reply.

        I understand you are looking for an NT7 example and have added a 2 range data series to the indicator. Do you have any plots in the indicator? What are you doing or wanting to do with the 2 range data? What is the chart's data series?

        Comment


          #5
          Hello Paul,
          I downloaded the RMI indicator.
          I like to see a 2 range when I'm working with a 4 range. I have a variety of instruments that I use the indicator on. Mainly I just want to understand how to use indicators with range bars different than the primary bar on the chart. Thank you for helping me with this.
          Attached Files

          Comment


            #6
            Hello CaptainAmericaXX,

            Thanks for your reply.

            I've modified the example you provided to show what changes need to be made to draw the RMI 2 range on a different time frame chart. In addition to isolating by using the BarsInProgress and CurrentBars[], the added dataseries of avgUp and avgDown need to be synchronized to the added 2 range data series so that these dataseries have the same number of slots/bars that match the 2range series, otherwise the calculation values would be incorrect. To read more on synchronizing please see an example here: http://ninjatrader.com/support/forum...ead.php?t=3572

            In the chart example provided below, the left chart shows a 2 range data series with the typical RMI indicator. The right chart shows 4 range data, typical 4 range RMI then the added modified 2 range RMI2rangeb.

            Please help us keep the forums organized by posting NT7 in the NT7 forum.
            Attached Files

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Geovanny Suaza, 02-11-2026, 06:32 PM
            0 responses
            637 views
            0 likes
            Last Post Geovanny Suaza  
            Started by Geovanny Suaza, 02-11-2026, 05:51 PM
            0 responses
            366 views
            1 like
            Last Post Geovanny Suaza  
            Started by Mindset, 02-09-2026, 11:44 AM
            0 responses
            107 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Started by Geovanny Suaza, 02-02-2026, 12:30 PM
            0 responses
            569 views
            1 like
            Last Post Geovanny Suaza  
            Started by RFrosty, 01-28-2026, 06:49 PM
            0 responses
            571 views
            1 like
            Last Post RFrosty
            by RFrosty
             
            Working...
            X