Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

How to obtain the highest and lowest price values within a specific period of bars

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

    How to obtain the highest and lowest price values within a specific period of bars

    Hi,
    I am trying to add an automatic fibonacci module to my auto strategy.

    For this reason I want to code the fibonacci formula inside my strategy in order to be able to draw the retracement lines dynamicall based on swing highs and lows.

    In this regard, I want to ask on what the best way it would be to get the highest and lowest price values within a certain amount of bars. I plan on adding a variable on the lookback period in order to be able to optimize.

    Shall I use the High[10] ...and will it take the highest bar over the period of the last 10 bars, or it will take the highest value of a single bar that is 10 bars back from the current one?

    or shall I use the HighestBar(DefaultInput, 0) where I change the "0" with the lookback period?

    I guess my question is, if I change the lookback period ...which function will actually return me the highest point for that whole lookback period.

    And same goes for the lowest point.

    Once I have those, I will be able to create my automatic fibonacci levels.

    Thanks.

    #2
    nikolaalx, you could use HighestBar and pass that index into your High series, however the MAX would be directly accomplishing that by returning you the maximum value of the series passed in over the look back period, same would exist for lowest value with MIN.

    http://www.ninjatrader.com/support/h...aximum_max.htm
    BertrandNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by cay7man, Today, 09:58 AM
    1 response
    16 views
    0 likes
    Last Post cay7man
    by cay7man
     
    Started by dween, 09-28-2023, 03:33 PM
    4 responses
    32 views
    0 likes
    Last Post dween
    by dween
     
    Started by Red_70, Today, 02:03 PM
    0 responses
    10 views
    0 likes
    Last Post Red_70
    by Red_70
     
    Started by bojim, Today, 11:09 AM
    1 response
    13 views
    0 likes
    Last Post Fbraun378  
    Started by zundradaniel, 08-04-2023, 02:18 PM
    4 responses
    93 views
    0 likes
    Last Post zundradaniel  
    Working...
    X