INVITE-ONLY SCRIPT

ST – Price Guard [Soothing Trades]

37
Simple description
ST – Price Guard tracks prior days Highs and Lows, marks whether each level is Not Taken or Taken, and manages how long they stay on your chart.
Strong untouched levels become visually thicker and get "Strong" tags, while old or spent levels auto-expire based on clear rules.
Built for futures/FX and indices where correct session highs/lows actually matter.

Advanced description
This indicator turns "prior days Highs and Lows2, into a fully-managed system with state, age, and expiry instead of just two static lines.
What it does
Draws previous day's High and Low from raw price.
Lets you choose between:
• Calendar daily (D), or
• A custom trading day defined by session hours + time zone (ideal for futures/FX).
Stores each level with:
• Price
• High vs Low
• Birth day index
• Taken day index (if/when price closes beyond it)
Tracks status over time:
• NT (Not Taken) – level has not been "closed through" yet.
• Taken – level has been closed beyond; still visible for a grace period.
• Strong – untouched beyond a user-defined age threshold.
Visual features
Lines
• Separate color/width for YD High and YD Low.
• Line style: Solid/Dashed/Dotted.
• Extend: Right / Left / Both / None.
• Strong levels can get extra thickness for easy recognition.
Labels
Right-edge labels with:
• Custom text: e.g. "Price High" / "Price Low".
• Optional price appended.
• Shape: Right/Left/Circle/Diamond/Down.
• Horizontal offset in bars (park labels comfortably to the right).
• Vertical placement: Above, Below, or Auto (outside) plus adjustable offset in ticks.
Optional extra info:
• Status: NT or Taken
• Strong tag for aged, untouched levels
• Age / limit in days (e.g. age 3/10)
• Days left / grace (e.g. left 4d for NT, grace 1d after taken)
Label background tint also reflects state:
• Normal for NT,
• Slightly boosted for Strong,
• Faint for Taken.
Persistence logic
Price Guard is driven by explicit rules:
• Max keep days (not taken) – base lifetime for untouched levels.
• Strong at (days) – after this many days untouched, level becomes Strong.
• Extra keep if Strong – extends lifetime for strong levels.
• Keep after taken (extra days) – grace period to keep a Taken level visible.
A level is automatically deleted when:
• It is Not Taken and its age exceeds its allowed maximum, or
• It is Taken and the grace period is over.
No manual cleanup required – the chart maintains itself.
Inputs overview
• Price YD visibility: show/hide YD High and YD Low.
• Colors, widths, styles, and extend rules for YD lines.
• Label configuration: text, style, colors, right offset, vertical position, content toggles (NT/Taken, Strong, age, days left, price).
• Persistence rules: max keep days, strong threshold, strong bonus days, grace days after taken, extra width when strong.
• Session anchoring: custom trading day hours + time zone vs simple calendar D.
How traders use it
Build a daily playbook around YD High/Low without redrawing or guessing.
Quickly see which levels are:
• Fresh NT opportunities,
• Aged into Strong (high interest),
• Already Taken and in grace (lower priority).
Combine with:
• Reversion or breakout strategies around YD levels
• Liquidity grab concepts (sweeps around YD High/Low)
• Bias confirmation (e.g. both YD levels taken vs still intact).
Notes & disclaimer
• Works across most symbols/timeframes supported by Pine Script v6.
• Especially suited to futures/FX and indices with non-trivial sessions.
• For educational and analytical use only. This is not financial advice; always test and manage your own risk.

Clause de non-responsabilité

Les informations et publications ne sont pas destinées à être, et ne constituent pas, des conseils ou recommandations financiers, d'investissement, de trading ou autres fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.