Announcement

Collapse
No announcement yet.

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.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by futurenow, 12-06-2021, 05:49 PM
    19 responses
    997 views
    0 likes
    Last Post Redders
    by Redders
     
    Started by mathfrick2023, 05-08-2025, 12:51 PM
    8 responses
    104 views
    0 likes
    Last Post Yogaman
    by Yogaman
     
    Started by several, 04-22-2025, 05:21 AM
    2 responses
    275 views
    0 likes
    Last Post Lukasxgtx  
    Started by NTEducationTeam, 06-12-2025, 02:30 PM
    0 responses
    40 views
    0 likes
    Last Post NTEducationTeam  
    Started by NTEducationTeam, 06-05-2025, 09:43 AM
    0 responses
    122 views
    0 likes
    Last Post NTEducationTeam  
    Working...
    X