P
PipsGrowth

النقاط الرئيسية

الصعوبة:مبتدئ
الموثوقية:عالية
الفئة:اتجاه
الأطر الزمنية:1 ساعة، 4 ساعات، يومي

المتوسط المتحرك البسيط (SMA)

اتجاه📊 1 ساعة، 4 ساعات، يومي، أسبوعي

يحسب SMA متوسط السعر لعدد محدد من الفترات، مما يُنعّم بيانات السعر لتحديد اتجاه الترند.

المعادلة

Code
SMA = (P₁ + P₂ + P₃ + ... + Pₙ) / n

شرح تفصيلي

The Simple Moving Average (SMA) is one of the most fundamental technical indicators in trading. It calculates the arithmetic mean of prices over a specified period, creating a smoothed line that helps traders identify the overall trend direction.

How It Works:
The SMA adds up the closing prices for a set number of periods and divides by that number. For example, a 20-period SMA adds the last 20 closing prices and divides by 20.

Key Concepts:
- Trend Direction: Price above SMA = bullish, below = bearish
- Dynamic Support/Resistance: SMAs often act as support in uptrends and resistance in downtrends
- Crossover Signals: When a faster SMA crosses a slower SMA, it generates trading signals

Popular SMA Periods:
- 20 SMA: Short-term trend
- 50 SMA: Medium-term trend
- 200 SMA: Long-term trend (institutional level)

مثال على إعداد التداول

نقاط الدخول ووقف الخسارة وجني الأرباح.

📈 Buy Setup
Simple Moving Average (SMA)CrossEntryTake ProfitStop LossCandlesMACrossBUY
📉 Sell Setup
Simple Moving Average (SMA)CrossEntryTake ProfitStop LossCandlesMACrossSELL

انتظر دائمًا تأكيد الإشارة قبل الدخول في صفقة.

أين يعمل هذا المؤشر بشكل أفضل

سياق الاتجاه ووضع السوق.

📈 Bullish Context
SMAStrong Uptrend ↑Best Fit ✓Continues →
📉 Bearish Context
SMAStrong Downtrend ↓Best Fit ✓Continues →

يعمل بشكل أفضل في الأسواق ذات الاتجاه القوي.

رسم بياني مباشرSimple Moving Average (SMA)

شاهد Simple Moving Average (SMA) يعمل مباشرة على الرسم البياني. جرّب تغيير الإعدادات والإطار الزمني.

الرسوم البيانية مقدمة من TradingViewاحصل على TradingView Pro ←

المعاملات

Period
الافتراضي: 20
Number of bars to average
Source
الافتراضي: Close
Price data to use (Open, High, Low, Close)

📈 إشارات صعودية

السعر يعبر فوق SMA أو SMA السريع يعبر فوق SMA البطيء

📉 إشارات هبوطية

السعر يعبر تحت SMA أو SMA السريع يعبر تحت SMA البطيء

تطبيق بايثون

Using pandas-ta for SMA calculation with crossover detection

Python
import pandas_ta as ta
# Calculate SMA
df['SMA_20'] = ta.sma(df['close'], length=20)
df['SMA_50'] = ta.sma(df['close'], length=50)
df['SMA_200'] = ta.sma(df['close'], length=200)
# Generate crossover signals
df['golden_cross'] = (df['SMA_50'] > df['SMA_200']) & (df['SMA_50'].shift(1) <= df['SMA_200'].shift(1))
df['death_cross'] = (df['SMA_50'] < df['SMA_200']) & (df['SMA_50'].shift(1) >= df['SMA_200'].shift(1))

كود TradingView

JavaScript
//@version=5
indicator("SMA Strategy", overlay=true)
// Input parameters
fast_len = input.int(20, "Fast SMA")
slow_len = input.int(50, "Slow SMA")
// Calculate SMAs
fast_sma = ta.sma(close, fast_len)
slow_sma = ta.sma(close, slow_len)
// Plot
plot(fast_sma, "Fast SMA", color=color.blue)
plot(slow_sma, "Slow SMA", color=color.red)
// Crossover signals
bullish = ta.crossover(fast_sma, slow_sma)
bearish = ta.crossunder(fast_sma, slow_sma)
plotshape(bullish, style=shape.triangleup, location=location.belowbar, color=color.green)
plotshape(bearish, style=shape.triangledown, location=location.abovebar, color=color.red)
📊 استخدم TradingView للرسوم البيانية المتقدمة
أدوات تحليل احترافية مع أكثر من 100 مؤشر فني
احصل على TradingView Pro

كود MT5

C++
// MQL5 SMA Indicator Access
int sma_handle = iMA(_Symbol, _Period, 50, 0, MODE_SMA, PRICE_CLOSE);
double sma[];
ArraySetAsSeries(sma, true);
CopyBuffer(sma_handle, 0, 0, 3, sma);
// Current SMA value
double current_sma = sma[0];
// Check price vs SMA
bool above_sma = iClose(_Symbol, _Period, 0) > current_sma;

أخطاء شائعة

Using SMA in ranging/choppy markets leads to whipsaws
Relying solely on SMA without confirmation from other indicators
Using too short periods in volatile markets
Ignoring the lag inherent in moving averages

إشارات التأكيد

Volume spike on crossover
RSI confirming momentum direction
Price breaking key support/resistance
Multiple timeframe alignment

الأفضل لـ

Trend identificationSupport/resistance levelsCrossover strategies

💡 نصائح احترافية

  • SMA lags price action - better for confirming trends than predicting them
  • Use multiple SMAs (e.g., 20, 50, 200) for stronger confirmation
  • Works best in trending markets, generates false signals in ranging markets
آخر تحديث: ٨ فبراير ٢٠٢٦

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

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

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

Simple Moving Average (SMA) - دليل كامل مع كود Python و TradingView