OPEN-SOURCE SCRIPT
تم تحديثه HMA Trend Scalper V1[wjdtks255]

[Description ]
Overview
This indicator is a high-performance trend-following system optimized for crypto futures trading. It provides clear entry signals and dynamic, real-time risk management tools to help traders stay on the right side of the market.
Key Features
Dynamic Trend Tracking: Uses a specialized HMA (Hull Moving Average) to filter market noise and identify the core trend.
Real-time TP/SL Extension: Unlike static indicators, the Take Profit (TP) and Stop Loss (SL) lines extend candle-by-candle along with the price action.
Clean Chart UI: Lines only exist from the entry point to the current candle, preventing chart clutter.
Automatic Completion: Once the price hits a target, the line stops extending and marks the result (Target Hit or Stop Out).
Trading Strategy (How to Trade)
1. Long Entry (🚀 LONG)
Condition: The price must be above the trend line, and a breakout of the recent 5-candle high must occur with significant volume.
Action: Enter a Long position when the "🚀 LONG" label appears.
Exit: Hold until the price reaches the Cyan (Aqua) TP line or hits the Yellow SL line.
2. Short Entry (💀 SHORT)
Condition: The price must be below the trend line, and a breakdown of the recent 5-candle low must occur with significant volume.
Action: Enter a Short position when the "💀 SHORT" label appears.
Exit: Hold until the price reaches the Cyan (Aqua) TP line or hits the Yellow SL line.
3. Risk Management
Stop Loss: The indicator automatically calculates the optimal SL based on recent volatility (ATR) and swing points.
Take Profit: The TP is set at a calculated ratio to ensure a positive risk-to-reward setup.
Settings
Trend Sensitivity: Adjust the HMA length to match your preferred timeframe (Scalping vs. Swing).
Volume Multiplier: Filter out weak moves by increasing the volume breakout requirement.
Custom Styles: Fully customize line colors, widths, and styles (Solid, Dashed, Dotted) in the settings menu.
Overview
This indicator is a high-performance trend-following system optimized for crypto futures trading. It provides clear entry signals and dynamic, real-time risk management tools to help traders stay on the right side of the market.
Key Features
Dynamic Trend Tracking: Uses a specialized HMA (Hull Moving Average) to filter market noise and identify the core trend.
Real-time TP/SL Extension: Unlike static indicators, the Take Profit (TP) and Stop Loss (SL) lines extend candle-by-candle along with the price action.
Clean Chart UI: Lines only exist from the entry point to the current candle, preventing chart clutter.
Automatic Completion: Once the price hits a target, the line stops extending and marks the result (Target Hit or Stop Out).
Trading Strategy (How to Trade)
1. Long Entry (🚀 LONG)
Condition: The price must be above the trend line, and a breakout of the recent 5-candle high must occur with significant volume.
Action: Enter a Long position when the "🚀 LONG" label appears.
Exit: Hold until the price reaches the Cyan (Aqua) TP line or hits the Yellow SL line.
2. Short Entry (💀 SHORT)
Condition: The price must be below the trend line, and a breakdown of the recent 5-candle low must occur with significant volume.
Action: Enter a Short position when the "💀 SHORT" label appears.
Exit: Hold until the price reaches the Cyan (Aqua) TP line or hits the Yellow SL line.
3. Risk Management
Stop Loss: The indicator automatically calculates the optimal SL based on recent volatility (ATR) and swing points.
Take Profit: The TP is set at a calculated ratio to ensure a positive risk-to-reward setup.
Settings
Trend Sensitivity: Adjust the HMA length to match your preferred timeframe (Scalping vs. Swing).
Volume Multiplier: Filter out weak moves by increasing the volume breakout requirement.
Custom Styles: Fully customize line colors, widths, and styles (Solid, Dashed, Dotted) in the settings menu.
ملاحظات الأخبار
[Update V2: English Language Support]Thanks to your feedback, I have released V2! The major update in this version is Global Language Support.
English Support: You can now choose between English and Korean in the settings menu.
All Labels Updated: Entry/Exit signals, TP/SL levels, and hit status are now displayed in your preferred language.
Thank you for your patience and suggestions! Happy trading!
ملاحظات الأخبار
[English Support & Name Update]To maintain the identity of this indicator, I have reverted the name to V1. However, this version includes the major update you've been waiting for:
Global Language Support: You can now switch between English and Korean in the settings menu!
Bug Fixes: Fixed the previous code errors (syntax/plot titles) for a smoother experience.
Improved UI: All labels (TP/SL, Entries) are now fully localized.
How to change language: Settings (Gear icon) ⚙️ -> Inputs tab -> Language / 언어 선택
Thank you for your feedback vijaybilla jayendrapatil12!
ملاحظات الأخبار
Description[Main Updates]
Restored Past Signals: Fixed the issue where past trading signals and lines disappeared. You can now review all historical trades on the chart.
Trade Result Labels: Automatically displays "🎯 TP Hit" or "⚠️ SL Hit" labels when the price reaches your target or stop-loss level.
Smart Cleaning Toggle: Added a "Hide Past Records" option. When enabled, it automatically cleans up all previous lines, entry labels, and result panels as soon as a new signal appears to keep your chart clean.
Enhanced Visualization: Fixed the line extension bug. Active TP/SL lines now extend perfectly until the trade is closed, without being cut off by new bars.
Performance Optimization: Increased max label and line counts to 500 for better backtesting visibility.
[How to Use]
Sensitivity: Adjust the HMA period for trend detection.
TP/SL Multiplier: Set your preferred Risk/Reward ratio based on ATR.
Hide Past Records: Check this in the settings if you only want to see the current active trade.
Release Notes
Integrated all visual elements (Lines, Signals, Results) into a single toggle control.
Improved real-time price tracking for more accurate TP/SL labeling.
ملاحظات الأخبار
//version=5indicator("HMA Trend Scalper V1 [Restored]", overlay=true, precision=2)
// ────────────────────────────
// 📌 0. 언어 설정 (Language Settings)
// ────────────────────────────
i_lang = input.string("Korean", "Language / 언어 선택", options=["English", "Korean"], group="Global Settings")
// 언어별 텍스트 정의
txt_tp_label = i_lang == "Korean" ? "익절: " : "TP: "
txt_sl_label = i_lang == "Korean" ? "손절: " : "SL: "
txt_tp_done = i_lang == "Korean" ? "🎯 익절완료" : "🎯 TP Hit"
txt_sl_done = i_lang == "Korean" ? "⚠️ 손절완료" : "⚠️ SL Hit"
// ────────────────────────────
// 📌 1. 설정 및 스타일 (Logic & Styles)
// ────────────────────────────
sensitivity = input.int(15, "Sensitivity / 민감도", group="Logic / 로직")
tpMult = input.float(2.0, "TP Multiplier / 익절 배수", group="Logic / 로직")
slOffset = input.float(1.2, "SL Offset / 손절 배수", group="Logic / 로직")
tpColor = input.color(color.aqua, "TP Color / 익절선 색상", group="Style / 스타일")
slColor = input.color(color.yellow, "SL Color / 손절선 색상", group="Style / 스타일")
// ────────────────────────────
// 📌 2. 핵심 신호 로직 (Signal Logic - V1 원본)
// ────────────────────────────
hma = ta.hma(close, sensitivity)
isTrendUp = close > hma
atr = ta.atr(14)
// V1 타점 로직: HMA 방향 + 5봉 최고점/최저점 돌파
longSignal = isTrendUp and ta.crossover(close, ta.highest(high, 5)[1])
shortSignal = not isTrendUp and ta.crossunder(close, ta.lowest(low, 5)[1])
var int lastSignal = 0
actualLong = longSignal and lastSignal != 1
actualShort = shortSignal and lastSignal != -1
// ────────────────────────────
// 📌 3. 동적 라인 및 라벨 (Visuals - V1 디자인)
// ────────────────────────────
var line slLine = na
var line tpLine = na
var label priceLabel = na
var float targetP = na
var float stopP = na
var bool isActive = false
var int entryBar = na
if actualLong or actualShort
lastSignal := actualLong ? 1 : -1
isActive := true
entryBar := bar_index
targetP := actualLong ? close + (atr * tpMult) : close - (atr * tpMult)
stopP := actualLong ? low - (atr * slOffset) : high + (atr * slOffset)
// A. 롱/숏 시그널 라벨
label.new(bar_index, actualLong ? low : high,
actualLong ? "🚀 LONG" : "💀 SHORT",
color=actualLong ? color.green : color.red,
style=actualLong ? label.style_label_up : label.style_label_down,
textcolor=color.white, size=size.small)
// B. 수평선 생성
slLine := line.new(entryBar, stopP, bar_index, stopP, color=slColor, width=3, style=line.style_solid)
tpLine := line.new(entryBar, targetP, bar_index, targetP, color=tpColor, width=3, style=line.style_solid)
// C. 익절/손절 가격 정보 라벨
priceLabel := label.new(bar_index, targetP,
txt_tp_label + str.tostring(targetP, "#.#") + "\n" + txt_sl_label + str.tostring(stopP, "#.#"),
color=color.new(color.black, 30), textcolor=color.white, style=label.style_label_left)
if isActive
line.set_x2(slLine, bar_index)
line.set_x2(tpLine, bar_index)
label.set_x(priceLabel, bar_index + 1)
hitTP = (lastSignal == 1 and high >= targetP) or (lastSignal == -1 and low <= targetP)
hitSL = (lastSignal == 1 and low <= stopP) or (lastSignal == -1 and high >= stopP)
if hitTP or hitSL
isActive := false
label.new(bar_index, hitTP ? targetP : stopP, hitTP ? txt_tp_done : txt_sl_done,
color=hitTP ? tpColor : slColor, style=label.style_label_center, textcolor=color.white, size=size.small)
// ────────────────────────────
// 📌 4. 배경 시각화 (Plotting)
// ────────────────────────────
barcolor(isTrendUp ? #00ff08 : #ff0055)
plot(hma, "HMA Trend Line", color=isTrendUp ? color.new(#00ff08, 80) : color.new(#ff0055, 80), linewidth=2)
ملاحظات الأخبار
Description[Main Updates]
Restored Past Signals: Fixed the issue where past trading signals and lines disappeared. You can now review all historical trades on the chart.
Trade Result Labels: Automatically displays "🎯 TP Hit" or "⚠️ SL Hit" labels when the price reaches your target or stop-loss level.
Smart Cleaning Toggle: Added a "Hide Past Records" option. When enabled, it automatically cleans up all previous lines, entry labels, and result panels as soon as a new signal appears to keep your chart clean.
Enhanced Visualization: Fixed the line extension bug. Active TP/SL lines now extend perfectly until the trade is closed, without being cut off by new bars.
Performance Optimization: Increased max label and line counts to 500 for better backtesting visibility.
[How to Use]
Sensitivity: Adjust the HMA period for trend detection.
TP/SL Multiplier: Set your preferred Risk/Reward ratio based on ATR.
Hide Past Records: Check this in the settings if you only want to see the current active trade.
Release Notes
Integrated all visual elements (Lines, Signals, Results) into a single toggle control.
Improved real-time price tracking for more accurate TP/SL labeling.
ملاحظات الأخبار
현재 업데이트 중 문제가 있어서 새로운 최적화 버전이 현재 트레이딩뷰 검토 단계에 있습니다. 승인이 완료될 때까지 이 지표를 임시로 사용하실 수 있으며, 새로운 지표 이름은 HMA Trend Scalper 로 재등록 될 것입니다.Due to an issue with the current update, a new optimized version is under review by TradingView. You can use this indicator temporarily until approval is complete, and the new indicator will be re-registered under the name HMA Trend Scalper.
ملاحظات الأخبار
Due to an issue with the current update, a new optimized version is under review. This temporary script has been disabled to ensure a secure migration. Please search for and add the new version: HMA Trend Scalper [wjdtks255].نص برمجي مفتوح المصدر
بروح TradingView الحقيقية، قام مبتكر هذا النص البرمجي بجعله مفتوح المصدر، بحيث يمكن للمتداولين مراجعة وظائفه والتحقق منها. شكرا للمؤلف! بينما يمكنك استخدامه مجانًا، تذكر أن إعادة نشر الكود يخضع لقواعد الموقع الخاصة بنا.
إخلاء المسؤولية
لا يُقصد بالمعلومات والمنشورات أن تكون، أو تشكل، أي نصيحة مالية أو استثمارية أو تجارية أو أنواع أخرى من النصائح أو التوصيات المقدمة أو المعتمدة من TradingView. اقرأ المزيد في شروط الاستخدام.
نص برمجي مفتوح المصدر
بروح TradingView الحقيقية، قام مبتكر هذا النص البرمجي بجعله مفتوح المصدر، بحيث يمكن للمتداولين مراجعة وظائفه والتحقق منها. شكرا للمؤلف! بينما يمكنك استخدامه مجانًا، تذكر أن إعادة نشر الكود يخضع لقواعد الموقع الخاصة بنا.
إخلاء المسؤولية
لا يُقصد بالمعلومات والمنشورات أن تكون، أو تشكل، أي نصيحة مالية أو استثمارية أو تجارية أو أنواع أخرى من النصائح أو التوصيات المقدمة أو المعتمدة من TradingView. اقرأ المزيد في شروط الاستخدام.