Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Range Indicator Modification

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

    Range Indicator Modification

    Hey guys, I'm trying to modify this NT range indicator to read the range of the last 3 bars from the 3 minute chart. Having some issues with the bars array to read the period type as well as the 3 bar period lookback.

    {
    Add(new Plot(Color.Firebrick, PlotStyle.Bar, "RangeValue"));
    Add(PeriodType.Minute, 3);


    }

    /// <summary>
    /// Called on each bar update event (incoming tick)
    /// </summary>
    protected override void OnBarUpdate()
    {
    Value.Set(High[0] - Low[0]);

    }

    #2
    Try

    Code:
    protected override void OnBarUpdate()
    {            
        Value.Set(MAX(High,3)[0] - MIN(Low,3)[0]);
    }

    Comment


      #3
      Need it to read from the 3 minute chart but this is giving me an error, says High, Low does not exist in current context https://gyazo.com/165f46bc51e41011f8544a5b49146d50


      Value.Set(MAX(High(BarsArray[1],3)[0] - MIN(Low(BarsArray[1],3)[0])));

      Comment


        #4
        Originally posted by brucelevy View Post
        Need it to read from the 3 minute chart but this is giving me an error, says High, Low does not exist in current context https://gyazo.com/165f46bc51e41011f8544a5b49146d50


        Value.Set(MAX(High(BarsArray[1],3)[0] - MIN(Low(BarsArray[1],3)[0])));
        You parenthesis appear to be very misplaced.

        Comment


          #5
          Originally posted by brucelevy View Post
          Need it to read from the 3 minute chart but this is giving me an error, says High, Low does not exist in current context https://gyazo.com/165f46bc51e41011f8544a5b49146d50


          Value.Set(MAX(High(BarsArray[1],3)[0] - MIN(Low(BarsArray[1],3)[0])));
          Value.Set(MAX(High(BarsArray[1],3)[0 ]) - MIN(Low(BarsArray[1],3)[0])));

          try that one in bold.

          Comment


            #6
            Originally posted by brucelevy View Post
            Need it to read from the 3 minute chart but this is giving me an error, says High, Low does not exist in current context https://gyazo.com/165f46bc51e41011f8544a5b49146d50


            Value.Set(MAX(High(BarsArray[1],3)[0] - MIN(Low(BarsArray[1],3)[0])));
            The first problem are the false brackets. The second problem is created because you reference BarsArray[1]. BarsArray[1] is the second BarsArray and would only exist in a multi-timeframe indicator with an added DataSeries.

            Please use the code as I had suggested below. Then apply the indicator to the chart series as needed via indicator dialogue box.
            Last edited by Harry; 11-06-2015, 07:21 AM.

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by georgeinharmony, Today, 12:06 AM
            2 responses
            12 views
            0 likes
            Last Post NinjaTrader_Jason  
            Started by Prisalice, Yesterday, 07:07 AM
            2 responses
            16 views
            0 likes
            Last Post NinjaTrader_ChelseaB  
            Started by Futurestrader00, Yesterday, 12:04 AM
            1 response
            10 views
            0 likes
            Last Post NinjaTrader_ChelseaB  
            Started by Blairski, Yesterday, 11:26 PM
            0 responses
            9 views
            0 likes
            Last Post Blairski  
            Started by aligator, Yesterday, 02:38 PM
            0 responses
            10 views
            0 likes
            Last Post aligator  
            Working...
            X