דלגו לתוכן
פתיחת RaamTrade

PivotLow — Pivot Low

תוכן זה אינו זמין עדיין בשפה שלך.

A local low with equal numbers of higher lows on each side. Like PivotHigh it arrives late by construction — half a window after the pivot bar — and does not repaint.

Signature

PivotLow(window, on=<source>)
Argument Type Required Notes
window int Param or literal Yes Total bars in the window; use an odd number. Default 5, bounds 3–101.
on= symbol No Source symbol. Defaults to the trade symbol. Reads the low.

Formula

The centre bar of the window is strictly lower than every other bar in it.

Warmup

window bars; 0 until then.

Reading the value

pl.value
pl > 0

The flag refers to the bar (window − 1) / 2 bars ago.

Example

class PivotSupport(Strategy):
"""Buy a bounce from a confirmed pivot low."""
trade = Symbol()
sizing = FixedCapital()
def execute(self):
pl = PivotLow(5, on=self.trade)
sma = SMA(200, on=self.trade)
if pl.value > 0 and self.trade.close > sma.value and self.trade.is_flat:
self.buy(self.trade, reason="Confirmed pivot low in an uptrend")
if self.trade.close < sma.value and self.trade.is_long:
self.sell(self.trade, self.trade.position, reason="Trend lost")

Notes

  • Same lag caveat as PivotHigh.
  • Proven by an assert-via-trade run on SPY daily (matched a strategy-side five-bar reference exactly on every bar; zero alarm trades).