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.

    BertrandNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by SantoshXX, Today, 03:09 AM
    0 responses
    3 views
    0 likes
    Last Post SantoshXX  
    Started by DanielTynera, Today, 01:14 AM
    0 responses
    2 views
    0 likes
    Last Post DanielTynera  
    Started by yertle, 04-18-2024, 08:38 AM
    9 responses
    41 views
    0 likes
    Last Post yertle
    by yertle
     
    Started by techgetgame, Yesterday, 11:42 PM
    0 responses
    12 views
    0 likes
    Last Post techgetgame  
    Started by sephichapdson, Yesterday, 11:36 PM
    0 responses
    2 views
    0 likes
    Last Post sephichapdson  
    Working...
    X