OPEN-SOURCE SCRIPT
Protection Price (Wenhua / TDX)

A short-term support and stop-loss reference line adapted from the Wenhua/TDX trading platform community formula.
— FORMULA —
Protection Price = ( Close[2] + Close[1] + Open ) / 3
That is, the average of the two prior bars' closes and the current bar's open.
— INTERPRETATION —
• When price holds above the line, short-term structure favors continuation of the prevailing trend.
• A clean break below the line, particularly with expanding range or volume, often precedes a deeper pullback.
• Useful as a soft stop-loss anchor for swing positions.
— TIMEFRAME NOTE —
This indicator was designed for daily charts, where the three input bars span three trading sessions and carry meaningful overnight gap information. On lower intraday timeframes (5m, 15m) the line will naturally track close to price, behaving like a three-bar smoothing — this is expected, not a bug. For a true daily-level Protection Price displayed on an intraday chart, request the daily series via request.security().
— BEST PAIRED WITH —
"D/K Strength + Smart Money Accumulation" sub-chart indicator for complete entry and exit context.
A faithful Pine v6 port of the original community formula.
— FORMULA —
Protection Price = ( Close[2] + Close[1] + Open ) / 3
That is, the average of the two prior bars' closes and the current bar's open.
— INTERPRETATION —
• When price holds above the line, short-term structure favors continuation of the prevailing trend.
• A clean break below the line, particularly with expanding range or volume, often precedes a deeper pullback.
• Useful as a soft stop-loss anchor for swing positions.
— TIMEFRAME NOTE —
This indicator was designed for daily charts, where the three input bars span three trading sessions and carry meaningful overnight gap information. On lower intraday timeframes (5m, 15m) the line will naturally track close to price, behaving like a three-bar smoothing — this is expected, not a bug. For a true daily-level Protection Price displayed on an intraday chart, request the daily series via request.security().
— BEST PAIRED WITH —
"D/K Strength + Smart Money Accumulation" sub-chart indicator for complete entry and exit context.
A faithful Pine v6 port of the original community formula.
סקריפט קוד פתוח
ברוח האמיתית של TradingView, יוצר הסקריפט הזה הפך אותו לקוד פתוח, כך שסוחרים יוכלו לעיין בו ולאמת את פעולתו. כל הכבוד למחבר! אמנם ניתן להשתמש בו בחינם, אך זכור כי פרסום חוזר של הקוד כפוף ל־כללי הבית שלנו.
כתב ויתור
המידע והפרסומים אינם מיועדים להיות, ואינם מהווים, ייעוץ או המלצה פיננסית, השקעתית, מסחרית או מכל סוג אחר המסופקת או מאושרת על ידי TradingView. קרא עוד ב־תנאי השימוש.
סקריפט קוד פתוח
ברוח האמיתית של TradingView, יוצר הסקריפט הזה הפך אותו לקוד פתוח, כך שסוחרים יוכלו לעיין בו ולאמת את פעולתו. כל הכבוד למחבר! אמנם ניתן להשתמש בו בחינם, אך זכור כי פרסום חוזר של הקוד כפוף ל־כללי הבית שלנו.
כתב ויתור
המידע והפרסומים אינם מיועדים להיות, ואינם מהווים, ייעוץ או המלצה פיננסית, השקעתית, מסחרית או מכל סוג אחר המסופקת או מאושרת על ידי TradingView. קרא עוד ב־תנאי השימוש.