OPEN-SOURCE SCRIPT
업데이트됨 Sentry Mode: Dynamic Trend & Exit System

Sentry Mode is designed for traders who prioritize risk management and structural trend alignment. It eliminates the guesswork of "How much should I buy?" by calculating your exact share count based on a live-tracking stop loss.
Core Features
1. The Sentry Position Manager (Quantitative Table)
The centerpiece of this script is a real-time data table that calculates:
Target vs. Actual Risk: Sees the gap between your desired equity risk and the actual dollar amount at stake after share rounding.
Dynamic Stop (Ribbon Top): The stop loss isn't a fixed percentage; it tracks the Low of the leading Moving Average in the ribbon, providing a "trailing floor."
Position Sizing: Automatically calculates shares based on your Account Size and Max Position % cap.
Invalid Price Filter: The Sentry will reject trade calculations (showing "PRICE BELOW STOP") if the asset is currently trading below the structural floor.
2. Structural Trend Ribbon
5-MA Cluster: Uses up to five user-selectable Moving Averages (SMA, EMA, WMA, etc.) to visualize trend strength.
Ribbon Top Analysis: Automatically identifies the "Fastest" MA to set the current trend boundary.
3rd MA Floor: Identifies the "meat" of the trend, serving as a secondary structural exit for trailing stops.
3. Multi-Timeframe Pivot Analysis
The script identifies and draws institutional-grade levels:
52-Week Highs: Tracks and extends 52-week highs with automated "Broken Line" logic when price clears the level.
Multi-Day Pivots: Visualizes 5-day, 9-day, 19-day, and 90-day pivot highs to identify supply zones and breakout entries.
Downtrend Resistance: Automatically plots 19-bar downward trendlines to identify "Cheat" entries and downtrend breaks.
4. SPY Market Context Filter
Broad Market Alignment: Includes a background color filter based on SPY (S&P 500) trend health.
ATR Volatility Scaling: The background changes intensity (L1, L2, L3) based on SPY’s ATR, warning you when the broad market is undergoing a "normal pullback" versus a "high-volatility breakdown."
4. How to Use
Define your Bankroll: In the settings, input your total Account Size and the percentage of equity you are willing to risk per trade (e.g., 0.25%).
Confirm the Trend: Look for price to be above the Ribbon Top. Ensure the SPY Context background is green.
Execute via Sentry Table: Read the "Shares" and "Pos Size" directly from the on-screen table.
Manage the Exit: The red dashed Sentry Line shows your floor. If price closes below this line (or the 3rd MA), the trend structure is broken.
5. Technical Details (For the Sidebar)
Signal Type: Trend-Following / Momentum.
Core Features
1. The Sentry Position Manager (Quantitative Table)
The centerpiece of this script is a real-time data table that calculates:
Target vs. Actual Risk: Sees the gap between your desired equity risk and the actual dollar amount at stake after share rounding.
Dynamic Stop (Ribbon Top): The stop loss isn't a fixed percentage; it tracks the Low of the leading Moving Average in the ribbon, providing a "trailing floor."
Position Sizing: Automatically calculates shares based on your Account Size and Max Position % cap.
Invalid Price Filter: The Sentry will reject trade calculations (showing "PRICE BELOW STOP") if the asset is currently trading below the structural floor.
2. Structural Trend Ribbon
5-MA Cluster: Uses up to five user-selectable Moving Averages (SMA, EMA, WMA, etc.) to visualize trend strength.
Ribbon Top Analysis: Automatically identifies the "Fastest" MA to set the current trend boundary.
3rd MA Floor: Identifies the "meat" of the trend, serving as a secondary structural exit for trailing stops.
3. Multi-Timeframe Pivot Analysis
The script identifies and draws institutional-grade levels:
52-Week Highs: Tracks and extends 52-week highs with automated "Broken Line" logic when price clears the level.
Multi-Day Pivots: Visualizes 5-day, 9-day, 19-day, and 90-day pivot highs to identify supply zones and breakout entries.
Downtrend Resistance: Automatically plots 19-bar downward trendlines to identify "Cheat" entries and downtrend breaks.
4. SPY Market Context Filter
Broad Market Alignment: Includes a background color filter based on SPY (S&P 500) trend health.
ATR Volatility Scaling: The background changes intensity (L1, L2, L3) based on SPY’s ATR, warning you when the broad market is undergoing a "normal pullback" versus a "high-volatility breakdown."
4. How to Use
Define your Bankroll: In the settings, input your total Account Size and the percentage of equity you are willing to risk per trade (e.g., 0.25%).
Confirm the Trend: Look for price to be above the Ribbon Top. Ensure the SPY Context background is green.
Execute via Sentry Table: Read the "Shares" and "Pos Size" directly from the on-screen table.
Manage the Exit: The red dashed Sentry Line shows your floor. If price closes below this line (or the 3rd MA), the trend structure is broken.
5. Technical Details (For the Sidebar)
Signal Type: Trend-Following / Momentum.
릴리즈 노트
Added Alerts for different conditionsAdded Reference stop and target levels with price and % for better visuals of risk reward from Buy alert
It will work on Pine screener
릴리즈 노트
Updated to remove extra plots, improvements to use pine screener export for portfolio approach. like, if you use sma50 for stop loss, then screen your portfolio watchlist and export the results for position size dollar risk and other parameters to excel and check how much are you invested if you are using this risk management approach and open portfolio heat.릴리즈 노트
Added Two AlertsIf used on pine screener you stocks which are strong in strong market and strong in week market.
Sentry: Trend Strong With Market
Sentry: Trend Strong Against Market
릴리즈 노트
Priming Bars Breaking up and Breaking Down label added. 릴리즈 노트
Position Management table updated to reflect stat of current bar릴리즈 노트
Few updates for better code릴리즈 노트
Updated few things릴리즈 노트
Mini Coil update릴리즈 노트
Coil logic update릴리즈 노트
Addition of 19 Day Low Pivot Line릴리즈 노트
Fixed typo 19 , earlier it was 9 for 19 day pivot low.릴리즈 노트
Added Base Pivots오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.