P
PipsGrowth

KAMA (Kaufman Adaptive Moving Average)

#02 · Trend / Adaptive غير معاد الرسم EA Readable لوحة تنبيهات

KAMA is an adaptive moving average developed by Perry Kaufman. It automatically adjusts its smoothing constant based on the Market Efficiency Ratio (ER): when the market is trending strongly (ER near 1), KAMA speeds up to follow price closely; when the market is choppy (ER near 0), KAMA slows down to filter out noise. This self-adapting behavior eliminates the need to manually switch between fast and slow moving averages.

كيف يعمل

KAMA calculates the Efficiency Ratio (ER) as the absolute direction divided by the sum of individual bar movements (volatility). The smoothing constant is derived from ER, blending between a fast SC (2/3) and slow SC (2/31). KAMA[i] = KAMA[i-1] + SC × (Close[i] - KAMA[i-1]). Entry signals fire when KAMA slope turns positive (BUY) or negative (SELL) for Slope_Bars consecutive bars, confirmed by price closing above/below KAMA.

إشارات الدخول

  • BUY: KAMA slope turns positive for Slope_Bars bars AND price closes above KAMA
  • SELL: KAMA slope turns negative for Slope_Bars bars AND price closes below KAMA
  • No-Trade: KAMA is flat (slope < threshold) → choppy market
  • Confidence = ER × 100 (directly maps efficiency to confidence)

إشارات الخروج

  • TP: Price reaches entry ± (TP_ATR_Mult × ATR)
  • Reversal: KAMA slope flips opposite direction
  • Expiry: Signal_Expiry_Bars passed

مرشحات التداول

  • KAMA Flatness: abs(slope) < threshold → no signal (choppy)
  • Session: Outside session hours → no signal
  • Spread: Spread > Max_Spread_Points → no signal
  • Cooldown: Last signal < Cooldown_Bars ago → no signal
  • ATR Regime: Extreme volatility → no signal

معاينة الكود المصدري

أول 50 سطر من 1054
PG_02_KAMA_AdaptiveMA.mq5
MQL5
//+------------------------------------------------------------------+
//| PipsGrowth_KAMA_AdaptiveMA_Indicator_v1.mq5 |
//| Copyright 2025, Pipsgrowth.com |
//| https://www.pipsgrowth.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2025, Pipsgrowth.com"
#property link "https://www.pipsgrowth.com"
#property version "1.00"
#property indicator_chart_window
#property indicator_buffers 14
#property indicator_plots 5
// Plot 0: BUY Entry (up triangle, green)
#property indicator_label1 "BUY Entry"
#property indicator_type1 DRAW_COLOR_ARROW
#property indicator_color1 clrLime
#property indicator_width1 2
// Plot 1: SELL Entry (down triangle, red)
#property indicator_label2 "SELL Entry"
#property indicator_type2 DRAW_COLOR_ARROW
#property indicator_color2 clrRed
#property indicator_width2 2
// Plot 2: Exit Signal (color arrow: aqua=TP, orange=reversal, gray=expired)
#property indicator_label3 "Exit"
#property indicator_type3 DRAW_COLOR_ARROW
#property indicator_color3 clrAqua,clrOrange,clrGray
#property indicator_width3 2
// Plot 3: KAMA (color line: green=rising, red=falling, gray=flat)
#property indicator_label4 "KAMA"
#property indicator_type4 DRAW_COLOR_LINE
#property indicator_color4 clrLime,clrRed,clrGray
#property indicator_width4 2
// Plot 4: KAMA Slope (histogram)
#property indicator_label5 "Slope"
#property indicator_type5 DRAW_HISTOGRAM
#property indicator_color5 clrDimGray
#property indicator_width5 1
//--- Input Parameters
input group "Core"
input int KAMA_Period = 10; // Efficiency Ratio lookback
input int Fast_SC_Period = 2; // Fast smoothing constant period
input int Slow_SC_Period = 30; // Slow smoothing constant period
input int Slope_Bars = 3; // Bars to measure KAMA slope
input int ATR_MA_Period = 50; // ATR MA period for regime filter

لأغراض تعليمية فقط. لا تستخدمه بأموال حقيقية. اختبر على حساب تجريبي فقط.

المميزات الرئيسية

Self-adapting smoothing via Efficiency Ratio
Choppy market detector (ER < 0.3 = no signals)
Slope-based entry with confirmation
Confidence directly maps to ER (ER × 100)
Color-coded KAMA line (green/red/gray)
Slope histogram in subwindow
Full alert system with ER in messages

معاملات الإدخال

KAMA_Period
الافتراضي: 10
Efficiency Ratio lookback
Fast_SC_Period
الافتراضي: 2
Fast smoothing constant period
Slow_SC_Period
الافتراضي: 30
Slow smoothing constant period
Slope_Bars
الافتراضي: 3
Bars to measure KAMA slope
SL_ATR_Mult
الافتراضي: 1.0
Stop loss in ATR multiples
TP_ATR_Mult
الافتراضي: 1.5
TP in ATR multiples
Min_Confidence
الافتراضي: 50
Minimum confidence for entry
Cooldown_Bars
الافتراضي: 3
Bars between signals

تعليمات التثبيت

1حمّل ملف .mq5 من زر التحميل
2افتح MetaTrader 5 ← File ← Open Data Folder
3اذهب إلى MQL5 ← Indicators
4انسخ ملف .mq5 إلى مجلد Indicators
5افتح MetaEditor (F4) واضغط F5 للترجمة
6المؤشر سيظهر في Navigator تحت Indicators
7اسحب المؤشر إلى الرسم البياني
8اختبر على حساب تجريبي أولاً

تحذير صريح: لأغراض تعليمية فقط

هذا المؤشر مخصص للأغراض التعليمية والاختبارية فقط. لا تستخدمه بأموال حقيقية. اختبره فقط على حساب تجريبي. التداول بأموال حقيقية ينطوي على مخاطر فقدان رأس المال. لا تشكل هذه الأداة نصيحة استثمارية.

مجتمع المستخدمين

سجّل دخولك للمشاركةتسجيل الدخول

الأسئلة الشائعة

هذا يحدث عندما يكون Slope_Bars منخفضًا جدًا (مثل الافتراضي 3). حتى في الأسواق المتقلبة، قد تتخذ عدة شموع متتالية ميلاً في اتجاه واحد случайًا. ارفع Slope_Bars إلى 5 وتحقق أيضًا من أن Min_Confidence عند 60+. إذا كان KAMA لا يزال يُطلق إشارات في النطاقات بهذه الإعدادات، فالمشكلة في الزوج نفسه — GBP/JPY و GBP/AUD معروفان بتقلباتهما في النطاق وستهزاما معظم إعدادات MA التكيفية. انتقل إلى EUR/USD أو XAUUSD لنتائج أنظف.
آخر تحديث: ١١ يوليو ٢٠٢٦

إخلاء مسؤولية تعليمي

هذا المحتوى للأغراض التعليمية فقط ولا يُعد نصيحة مالية أو استثمارية. التداول ينطوي على مخاطر كبيرة وقد تفقد رأس مالك. استشر مستشارًا ماليًا مرخصًا قبل اتخاذ أي قرارات استثمارية.

سجّل دخولك للتحميل

التحميل متاح للأعضاء المسجلين. سجّل الدخول أو أنشئ حساباً مجانياً للوصول إلى الكود المصدري الكامل.

المواصفات

الفئةTrend / Adaptive
الصعوبةIntermediate
الإصدارv1.0
الإطاراتM1, M5, M15, M30
إعادة الرسملا
EAقابل

الأفضل لـ

Trend filteringAdaptive entriesChoppy market avoidanceM5-M15 timeframes
KAMA (Kaufman Adaptive Moving Average) | مؤشر MT5 مجاني