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.
Comment