Author: Copyright � 2005, Taylor Stockwell
Mom Cross

This tool is designed to provide traders with a visual representation of market velocity by tracking "Momentum." In simple terms, momentum measures the speed and strength of price movements over specific periods. This script calculates two different types of momentum simultaneously to help identify shifts in market trends.

How the Logic Works

The indicator operates by creating two distinct lines on a separate window of your trading chart:

1. The Fast Momentum (Blue Line) This line tracks short-term price changes using a smaller timeframe (defaulting to 5 periods). Because it reacts quickly to new information, it serves as a "high-sensitivity" indicator. It shows you what the market is doing right now in the immediate moment.

2. The Slow Momentum (Red Line) This line tracks price changes over a longer timeframe (defaulting to 14 periods). By looking at a broader window of time, it filters out minor "noise" and provides a smoother view of the prevailing trend. It represents the underlying direction of the market.

How to Interpret the Results

The primary purpose of this script is to show the relationship between these two speeds:

  • Trend Identification: When both lines are moving in the same direction, it confirms the strength of the current trend.
  • Momentum Shifts: Traders often look for points where the Fast (Blue) line crosses over the Slow (Red) line. A crossover can signal that the short-term price action is beginning to accelerate or decelerate relative to the long-term average.
  • Visual Comparison: By displaying both lines at once, the script allows you to see at a glance whether the current market "burst" of speed is sustainable or if it is losing energy compared to recent history.

In summary, this tool helps you visualize whether the market is gaining heat or cooling down by comparing rapid, short-term movements against steady, long-term trends.

Indicators Used
Momentum indicator
Miscellaneous
Implements a curve of type %1
14 Views
0 Downloads
0 Favorites
Mom Cross
//+------------------------------------------------------------------+
//|                                                    Mom Cross.mq4 |
//|                               Copyright © 2005, Taylor Stockwell |
//|                                        mailto:stockwet@yahoo.com |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2005, Taylor Stockwell"
#property link      "mailto:stockwet@yahoo.com"
//----
#property  indicator_separate_window
#property indicator_buffers 2
#property indicator_color1 Blue
#property indicator_color2 Red
//---- input parameters
extern int FastMom=5;
extern int SlowMom=14;
//---- buffers
double FastMomBuffer[];
double SlowMomBuffer[];
//---- variables
int indexbegin=0;
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
//---- indicators
   SetIndexStyle(0, DRAW_LINE);
   SetIndexBuffer(0, FastMomBuffer);
   SetIndexLabel(0, "Fast Momemtum");
   SetIndexEmptyValue(0, 0.0);
   //
   SetIndexStyle(1, DRAW_LINE);
   SetIndexBuffer(1, SlowMomBuffer);
   SetIndexLabel(1, "Slow Momentum");
   SetIndexEmptyValue(1, 0.0);
//----
   indexbegin=Bars - 20;
   if (indexbegin < 0)
      indexbegin=0;
   return(0);
  }
//+------------------------------------------------------------------+
//| Custor indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
//---- TODO: add your code here
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
  {
   int i;
   int counted_bars=IndicatorCounted();
//---- check for possible errors
   if (counted_bars < 0) counted_bars=0;
//---- last counted bar will be recounted
   if (counted_bars > 0) counted_bars--;
   if (counted_bars > indexbegin) counted_bars=indexbegin;
   for(i=indexbegin-counted_bars; i>=0; i--)
     {
      FastMomBuffer[i]=iMomentum(NULL,0,FastMom,PRICE_CLOSE,i);
      SlowMomBuffer[i]=iMomentum(NULL,0,SlowMom,PRICE_CLOSE,i);
     }
   return(0);
  }
//+------------------------------------------------------------------+

Comments