移动平均线(SMA/EMA)计算器

分类: Uncategorized

Calculate Simple and Exponential Moving Averages to identify trends, potential support/resistance levels, and generate trading signals

价格数据输入

每行输入一个价格,最新数据置顶
选择市场以载入示例数据
用于计算的价格数据类型

Moving Average Parameters

Type of moving average to calculate
Number of periods for primary MA calculation
Number of periods for secondary MA
Number of periods for tertiary MA

Understanding Moving Averages

Moving averages are one of the most versatile and widely used technical indicators in financial markets. They smooth out price data to identify trends and potential trading opportunities.

简单移动平均(SMA)

The Simple Moving Average (SMA) is calculated by taking the arithmetic mean of a given set of prices over a specific number of periods:

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

Where P represents prices and n is the number of periods.

  • Advantages: Simple to calculate and understand; gives equal weight to all prices in the calculation period
  • Disadvantages: Slower to react to price changes; older prices affect the average as much as recent prices
  • Common Uses: Identifying trends, support/resistance levels, and trade signals when prices cross the SMA

指数移动平均(EMA)

The Exponential Moving Average (EMA) gives more weight to recent prices, making it more responsive to new information:

EMA = Price × k + EMA(previous) × (1 - k)

Where k = 2/(n+1), and n is the number of periods.

  • Advantages: More responsive to recent price changes; reduces lag in trend identification
  • Disadvantages: More complex to calculate; can generate more false signals in choppy markets
  • Common Uses: Short-term trading strategies, identifying trend changes more quickly

Trading Strategies Using Moving Averages

MA Crossover Strategy

A bullish signal occurs when a shorter-period MA crosses above a longer-period MA. Conversely, a bearish signal occurs when a shorter-period MA crosses below a longer-period MA.

Example: Golden Cross (50-day SMA crosses above 200-day SMA) and Death Cross (50-day SMA crosses below 200-day SMA)

Price Crossover Strategy

A bullish signal occurs when price crosses above the MA. A bearish signal occurs when price crosses below the MA.

Example: Buy when price closes above the 20-day SMA; sell when price closes below the 20-day SMA

Support and Resistance

Moving averages often act as dynamic support (in uptrends) or resistance (in downtrends). Traders look for price reactions when approaching these levels.

Example: In an uptrend, buying when price pulls back to the 50-day MA and shows signs of bouncing

Trend Filter

Using MAs to determine the market direction before applying other trading strategies. Only take long positions when price is above the MA, and short positions when price is below the MA.

Example: Only considering long trades when price is above the 200-day MA

Tips for Using Moving Averages Effectively

  • Choose appropriate periods - Shorter periods (5-20) are more suitable for short-term trading, while longer periods (50-200) are better for long-term trend identification
  • Combine multiple MAs - Using multiple MAs with different periods can provide more reliable signals and filter out false ones
  • Use with other indicators - Combine MAs with momentum indicators (RSI, MACD) or volume indicators for confirmation
  • Understand market context - MAs work better in trending markets and may generate false signals in ranging or choppy markets
  • 注意滞后 - All MAs have some degree of lag; EMAs reduce lag but may be more prone to whipsaws

本工具计算什么

计算价格序列的简单移动平均线(SMA)及指数移动平均线(EMA)。

公式
SMA = 最近 N 个收盘价总和 ÷ N;EMA = 现价 × k + 前一日 EMA ×(1 − k),其中 k = 2 ÷(N + 1)
计算示例
10 日 SMA 即最近 10 个收盘价相加除以 10。10 日 EMA 的权重 k = 2 ÷ 11 = 0.182,即最新收盘价占 18.2%。
何时使用
用以平滑价格波动,观察底层趋势方向。
常见错误
移动平均线必然滞后。周期越长,转向越迟,它只能确认走势,不能预测走势。