PINE LIBRARY
PINEOSCore

Library "PINEOSCore"
newEngine()
Create a fresh structure engine.
marketText(trend)
Trend label from structure state.
Parameters:
trend (int)
step(engine, swingLen, breakByClose, hi, lo, cls, bix, confirmed)
Advance swing + structure engines by one bar. Mutates `engine`.
Parameters:
engine (Engine): Persistent engine state (`var` in consumer).
swingLen (simple int): Pivot confirmation length (both sides).
breakByClose (simple bool): When true, BOS requires close beyond swing.
hi (float)
lo (float)
cls (float)
bix (int)
confirmed (bool)
Returns: Snapshot of events and levels for the current bar.
Engine
Mutable structure engine state (persist with `var` in consumer scripts).
Fields:
lastSwingHigh (series float)
lastSwingLow (series float)
prevSwingHigh (series float)
prevSwingLow (series float)
lastSwingHighBar (series int)
lastSwingLowBar (series int)
structureTrend (series int)
lastStructureEvent (series string)
Snapshot
Per-bar output from `step()` — read-only snapshot for products.
Fields:
bullBOS (series bool)
bullCHOCH (series bool)
bearBOS (series bool)
bearCHOCH (series bool)
rawBullBreak (series bool)
rawBearBreak (series bool)
newPivotHigh (series bool)
newPivotLow (series bool)
lastSwingHigh (series float)
lastSwingLow (series float)
prevSwingHigh (series float)
prevSwingLow (series float)
lastSwingHighBar (series int)
lastSwingLowBar (series int)
structureTrend (series int)
lastStructureEvent (series string)
newEngine()
Create a fresh structure engine.
marketText(trend)
Trend label from structure state.
Parameters:
trend (int)
step(engine, swingLen, breakByClose, hi, lo, cls, bix, confirmed)
Advance swing + structure engines by one bar. Mutates `engine`.
Parameters:
engine (Engine): Persistent engine state (`var` in consumer).
swingLen (simple int): Pivot confirmation length (both sides).
breakByClose (simple bool): When true, BOS requires close beyond swing.
hi (float)
lo (float)
cls (float)
bix (int)
confirmed (bool)
Returns: Snapshot of events and levels for the current bar.
Engine
Mutable structure engine state (persist with `var` in consumer scripts).
Fields:
lastSwingHigh (series float)
lastSwingLow (series float)
prevSwingHigh (series float)
prevSwingLow (series float)
lastSwingHighBar (series int)
lastSwingLowBar (series int)
structureTrend (series int)
lastStructureEvent (series string)
Snapshot
Per-bar output from `step()` — read-only snapshot for products.
Fields:
bullBOS (series bool)
bullCHOCH (series bool)
bearBOS (series bool)
bearCHOCH (series bool)
rawBullBreak (series bool)
rawBearBreak (series bool)
newPivotHigh (series bool)
newPivotLow (series bool)
lastSwingHigh (series float)
lastSwingLow (series float)
prevSwingHigh (series float)
prevSwingLow (series float)
lastSwingHighBar (series int)
lastSwingLowBar (series int)
structureTrend (series int)
lastStructureEvent (series string)
Pine library
In true PulseWire spirit, the author has published this Pine code as an open-source library so that other Pine programmers from our community can reuse it. Cheers to the author! You may use this library privately or in other open-source publications, but reuse of this code in publications is governed by House Rules.
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by PulseWire. Read more in the Terms of Use.
Pine library
In true PulseWire spirit, the author has published this Pine code as an open-source library so that other Pine programmers from our community can reuse it. Cheers to the author! You may use this library privately or in other open-source publications, but reuse of this code in publications is governed by House Rules.
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by PulseWire. Read more in the Terms of Use.
