Indicator - Pivot Point High Low

Back

Hey everyone,

Has anyone had any experience trying to code in Pivot Point High Low in python? I'm really struggling with tryna get a working PPHiLo, has anyone had any experience with this? Any tips etc...

 

Just for info here is a link explaining PPHiLo:

https://www.fidelity.com/learning-center/trading-investing/technical-analysis/technical-indicator-guide/pivot-points-high-low

Update Backtest







 
0

The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.


Hi Tomer,

Although Lean does not have a built-in pivot point high/low indicator, you can implement it yourself. Let's say we want to create a 5 period pivot point high indicator. We can accomplish this using a rolling window of size 11, which will let us analyze the previous 11 bars.

self.window = RollingWindow[TradeBar](11)

Then we can use our window to calculate if the middle bar is a pivot point.

middleBar = self.window[5]
middleHigh = middleBar.High

for i in range(5):
if self.window[i].High > middleHigh:
return False
for i in range(6, 11):
if self.window[i].High > middleHigh:
return False return True

Best
Rahul

2

The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.


Update Backtest





0

The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.


Loading...

This discussion is closed