Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

High of last N bars , excluding currentbar.

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

    High of last N bars , excluding currentbar.

    Hi ,
    I want to calculate High of last N bars , excluding the latest bar , please help.

    I am using the below code but it's including the last bar.


    var periodHigh = MAX(High,period)[0];


    #2
    Hello shishir_nse,

    Thanks for your post.

    To exclude the current bar, change the barsago from 0 to 1.

    var periodHigh = MAX(High,period)[1];
    Paul H.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by xxzbill, Today, 06:59 PM
    0 responses
    3 views
    0 likes
    Last Post xxzbill
    by xxzbill
     
    Started by trader1976, Today, 06:18 PM
    1 response
    5 views
    0 likes
    Last Post NinjaTrader_ShawnB  
    Started by jonnhl, Today, 06:34 PM
    0 responses
    4 views
    0 likes
    Last Post jonnhl
    by jonnhl
     
    Started by ErikY, Today, 06:17 PM
    1 response
    9 views
    0 likes
    Last Post NinjaTrader_ShawnB  
    Started by kangethe, Today, 06:24 PM
    0 responses
    4 views
    0 likes
    Last Post kangethe  
    Working...
    X