Skip to main content
Skip to main content
Version: 1.0 (Current)

Momentum Indicators

Momentum indicators measure the speed and strength of price movements, helping traders identify overbought/oversold conditions, divergences, and potential reversals.

Relative Strength Index (RSI)

Calculation

RSI measures the magnitude of recent price changes to evaluate overbought or oversold conditions.

Formula:

RSI = 100 - (100 / (1 + RS))

Where:
RS = Average Gain / Average Loss

Average Gain = Sum of Gains over n periods / n
Average Loss = Sum of Losses over n periods / n

Step-by-Step Example (14-period RSI):

Day 1-14: Calculate initial averages
Gains: 2, 0, 1, 3, 0, 2, 1, 0, 0, 1, 2, 0, 1, 0
Losses: 0, 1, 0, 0, 2, 0, 0, 1, 1, 0, 0, 1, 0, 1

Avg Gain = 13 / 14 = 0.93
Avg Loss = 7 / 14 = 0.50

RS = 0.93 / 0.50 = 1.86
RSI = 100 - (100 / (1 + 1.86)) = 65.03

Day 15+: Use smoothed averages
Avg Gain = ((Previous Avg Gain × 13) + Current Gain) / 14
Avg Loss = ((Previous Avg Loss × 13) + Current Loss) / 14

Characteristics

  • Range: 0 to 100
  • Overbought: > 70 (traditional), > 80 (conservative)
  • Oversold: < 30 (traditional), < 20 (conservative)
  • Neutral: 40-60
  • Period: 14 (standard), 7 (fast), 21 (slow)

Interpretation Levels

RSI ValueConditionAction
0-20Extremely OversoldStrong buy signal
20-30OversoldBuy signal
30-40WeakCaution
40-60NeutralNo clear signal
60-70StrongCaution
70-80OverboughtSell signal
80-100Extremely OverboughtStrong sell signal

Usage Examples

Oversold Condition:

{
"type": "indicator_value",
"indicator": "rsi",
"period": 14,
"comparison": "below",
"value": 30
}
// RSI < 30 = oversold, potential buy

Overbought Condition:

{
"type": "indicator_value",
"indicator": "rsi",
"period": 14,
"comparison": "above",
"value": 70
}
// RSI > 70 = overbought, potential sell

RSI Crosses Above 50 (Bullish):

{
"type": "indicator_value",
"indicator": "rsi",
"period": 14,
"comparison": "crosses_above",
"value": 50
}
// RSI crosses above 50 = momentum shift to bullish

RSI Divergence

Bullish Divergence:

  • Price makes lower low
  • RSI makes higher low
  • Signal: Potential reversal to upside

Bearish Divergence:

  • Price makes higher high
  • RSI makes lower high
  • Signal: Potential reversal to downside

Example Strategy:

{
"entryConditions": {
"long": {
"logicalOperator": "AND",
"conditions": [
{
"type": "indicator_value",
"indicator": "rsi",
"period": 14,
"comparison": "below",
"value": 30
},
{
"type": "indicator_value",
"indicator": "rsi",
"period": 14,
"comparison": "crosses_above",
"value": 30
}
]
}
}
}
// Enter when RSI crosses back above 30 from oversold

Stochastic Oscillator

Calculation

Stochastic compares the closing price to the price range over a period, showing where the close is relative to the high-low range.

Formula:

%K = ((Close - Lowest Low) / (Highest High - Lowest Low)) × 100

%D = SMA of %K (typically 3-period)

Where:
- Close = Current closing price
- Lowest Low = Lowest price over n periods
- Highest High = Highest price over n periods

Example (14-period Stochastic):

Period: 14 days
Highest High: 120
Lowest Low: 100
Current Close: 115

%K = ((115 - 100) / (120 - 100)) × 100
= (15 / 20) × 100
= 75

%D = 3-period SMA of %K values

Characteristics

  • Range: 0 to 100
  • Overbought: > 80
  • Oversold: < 20
  • Standard Settings: 14, 3, 3 (K period, K slowing, D period)
  • Fast Stochastic: No smoothing
  • Slow Stochastic: Smoothed %K

Interpretation

Stochastic ValueConditionSignal
0-20OversoldPotential buy
20-80NeutralNo clear signal
80-100OverboughtPotential sell

Usage Examples

Oversold Crossover (Bullish):

{
"type": "indicator_value",
"indicator": "stochastic_k",
"period": 14,
"comparison": "crosses_above",
"value": 20
}
// %K crosses above 20 from oversold = buy signal

Overbought Crossover (Bearish):

{
"type": "indicator_value",
"indicator": "stochastic_k",
"period": 14,
"comparison": "crosses_below",
"value": 80
}
// %K crosses below 80 from overbought = sell signal

%K Crosses %D (Signal Line Crossover):

{
"indicator1": "stochastic_k",
"period1": 14,
"indicator2": "stochastic_d",
"period2": 3,
"comparison": "crosses_above"
}
// %K crosses above %D = bullish signal

Stochastic Strategies

1. Oversold Bounce:

{
"entryConditions": {
"long": {
"logicalOperator": "AND",
"conditions": [
{
"type": "indicator_value",
"indicator": "stochastic_k",
"period": 14,
"comparison": "below",
"value": 20
},
{
"indicator1": "stochastic_k",
"period1": 14,
"indicator2": "stochastic_d",
"period2": 3,
"comparison": "crosses_above"
}
]
}
}
}
// Enter when %K crosses above %D in oversold zone

2. Trend Following with Stochastic:

{
"entryConditions": {
"long": {
"logicalOperator": "AND",
"conditions": [
{
"type": "price_indicator",
"price": "close",
"indicator": "ema",
"period": 50,
"comparison": "above"
},
{
"type": "indicator_value",
"indicator": "stochastic_k",
"period": 14,
"comparison": "crosses_above",
"value": 50
}
]
}
}
}
// Uptrend + Stochastic crosses above 50

Commodity Channel Index (CCI)

Calculation

CCI measures the deviation of price from its statistical average, identifying cyclical trends.

Formula:

CCI = (Typical Price - SMA of Typical Price) / (0.015 × Mean Deviation)

Where:
Typical Price = (High + Low + Close) / 3
Mean Deviation = Average of |Typical Price - SMA|

Example (20-period CCI):

Day 1: TP = (110 + 105 + 108) / 3 = 107.67
Day 2: TP = (112 + 107 + 110) / 3 = 109.67
...
Day 20: TP = (115 + 110 + 113) / 3 = 112.67

SMA of TP (20 periods) = 108.50
Current TP = 112.67

Mean Deviation = 2.30

CCI = (112.67 - 108.50) / (0.015 × 2.30)
= 4.17 / 0.0345
= 120.87

Characteristics

  • Range: Unbounded (typically -300 to +300)
  • Overbought: > +100
  • Oversold: < -100
  • Extreme Overbought: > +200
  • Extreme Oversold: < -200
  • Period: 20 (standard), 14 (faster)

Interpretation

CCI ValueConditionSignal
< -200Extremely OversoldStrong buy
-200 to -100OversoldBuy signal
-100 to +100NeutralNo clear signal
+100 to +200OverboughtSell signal
> +200Extremely OverboughtStrong sell

Usage Examples

Oversold Reversal:

{
"type": "indicator_value",
"indicator": "cci",
"period": 20,
"comparison": "crosses_above",
"value": -100
}
// CCI crosses above -100 = oversold reversal

Overbought Reversal:

{
"type": "indicator_value",
"indicator": "cci",
"period": 20,
"comparison": "crosses_below",
"value": 100
}
// CCI crosses below 100 = overbought reversal

Trend Strength:

{
"type": "indicator_value",
"indicator": "cci",
"period": 20,
"comparison": "above",
"value": 100
}
// CCI > 100 = strong uptrend

CCI Strategies

1. CCI Reversal:

{
"entryConditions": {
"long": {
"logicalOperator": "AND",
"conditions": [
{
"type": "indicator_value",
"indicator": "cci",
"period": 20,
"comparison": "below",
"value": -100
},
{
"type": "indicator_value",
"indicator": "cci",
"period": 20,
"comparison": "crosses_above",
"value": -100
}
]
}
}
}
// Enter when CCI crosses back above -100

2. CCI Trend Following:

{
"entryConditions": {
"long": {
"conditions": [
{
"type": "indicator_value",
"indicator": "cci",
"period": 20,
"comparison": "crosses_above",
"value": 0
}
]
}
},
"exitConditions": {
"stopLoss": {
"type": "percentage",
"value": 2
},
"takeProfit": {
"type": "indicator",
"indicator": "cci",
"period": 20,
"comparison": "crosses_below",
"value": 0
}
}
}
// Enter when CCI > 0, exit when CCI < 0

Comparison: RSI vs Stochastic vs CCI

FeatureRSIStochasticCCI
Range0-1000-100Unbounded
CalculationRelative strengthPrice position in rangeDeviation from average
SensitivityMediumHighMedium
Best ForDivergences, reversalsOverbought/oversoldTrend strength
LagLowLowLow
False SignalsMediumHighMedium

Momentum Indicator Combinations

1. RSI + Stochastic Confirmation

Setup:

  • RSI(14) for trend
  • Stochastic(14,3,3) for timing

Entry (Long):

  • RSI > 50 (bullish momentum)
  • Stochastic %K crosses above %D
  • Stochastic in oversold zone (<20)
{
"entryConditions": {
"long": {
"logicalOperator": "AND",
"conditions": [
{
"type": "indicator_value",
"indicator": "rsi",
"period": 14,
"comparison": "above",
"value": 50
},
{
"type": "indicator_value",
"indicator": "stochastic_k",
"period": 14,
"comparison": "below",
"value": 20
},
{
"indicator1": "stochastic_k",
"period1": 14,
"indicator2": "stochastic_d",
"period2": 3,
"comparison": "crosses_above"
}
]
}
}
}

2. RSI + CCI Double Confirmation

Setup:

  • RSI(14) for momentum
  • CCI(20) for trend strength

Entry (Long):

  • RSI crosses above 50
  • CCI > 0
{
"entryConditions": {
"long": {
"logicalOperator": "AND",
"conditions": [
{
"type": "indicator_value",
"indicator": "rsi",
"period": 14,
"comparison": "crosses_above",
"value": 50
},
{
"type": "indicator_value",
"indicator": "cci",
"period": 20,
"comparison": "above",
"value": 0
}
]
}
}
}

Divergence Detection

Bullish Divergence (All Indicators)

Pattern:

  1. Price makes lower low
  2. Indicator makes higher low
  3. Signal: Potential reversal to upside

How to Identify:

  • Compare last 2-3 swing lows
  • Price: Lower low
  • RSI/Stochastic/CCI: Higher low

Bearish Divergence (All Indicators)

Pattern:

  1. Price makes higher high
  2. Indicator makes lower high
  3. Signal: Potential reversal to downside

How to Identify:

  • Compare last 2-3 swing highs
  • Price: Higher high
  • RSI/Stochastic/CCI: Lower high

Best Practices

Do's

  • ✅ Use RSI for divergence detection
  • ✅ Use Stochastic for precise entry timing
  • ✅ Use CCI for trend strength confirmation
  • ✅ Combine with trend indicators (EMA, MACD)
  • ✅ Wait for confirmation before entering
  • ✅ Adjust overbought/oversold levels for trending markets

Don'ts

  • ❌ Trade against strong trends based on overbought/oversold alone
  • ❌ Use momentum indicators as sole entry criteria
  • ❌ Ignore price action in favor of indicators
  • ❌ Over-optimize indicator periods
  • ❌ Use all three momentum indicators together (redundant)

Common Pitfalls

1. Overbought Can Stay Overbought

Problem: RSI > 70 doesn't mean immediate reversal Solution: Wait for RSI to cross back below 70 or use trend filter

Problem: Oversold signals in downtrends lead to losses Solution: Only trade with the trend (RSI > 50 for longs)

3. Whipsaws in Ranging Markets

Problem: Multiple false crossovers Solution: Use ADX to confirm trend strength before trading