Author: Ron T
3MA03IND

This tool is designed to assist traders in identifying specific price momentum shifts and potential trend reversals by analyzing the relationship between different moving averages. Instead of relying on a single indicator, it looks for "crossovers"—moments where shorter-term price trends intersect with longer-term averages—to signal high-probability entry or exit points.

Core Logic & Mechanics

The script functions by calculating three distinct types of Linear Weighted Moving Averages (LWMA) simultaneously:

  1. Fast Average (5 periods): Tracks the immediate, short-term price movement.
  2. Slow Average (25 periods): Tracks the intermediate trend.
  3. Baseline Average (100 periods): Represents the long-term structural trend of the market.

Key Signals Explained

The tool interprets these three averages to place specific visual markers on your chart:

  • Bullish Momentum (Upward Signals): The script identifies a "buy" opportunity when the Fast Average crosses above the Slow Average from below, provided that the price is still trending generally upward relative to the 100-period Baseline. This suggests that while the overall trend is strong, short-term momentum is accelerating in favor of the buyers.

  • Bearish Momentum (Downward Signals): Conversely, a "sell" opportunity is identified when the Fast Average crosses below the Slow Average from above, specifically when the price is moving downward relative to the 100-period Baseline. This signals that short-term momentum is shifting aggressively toward the sellers.

  • Take-Profit/Reversal Markers: The script also monitors for a unique interaction where the 100-period Baseline average "intersects" with the 25-period Slow Average. When these two long-term averages cross paths, it flags a potential area of exhaustion or a significant trend shift. This serves as a visual guide to help traders identify potential take-profit zones or areas where the current trend may be losing steam.

Summary for the Trader

By filtering short-term "noise" through a 100-period baseline, this script attempts to ensure that you are only entering trades in the direction of the broader market trend. It highlights moments where momentum confirms the trend, while simultaneously marking high-level areas where the trend might be reaching a turning point.

Price Data Components
Indicators Used
Moving average indicator
Miscellaneous
Implements a curve of type %1
15 Views
0 Downloads
0 Favorites
3MA03IND
//+------------------------------------------------------------------+
//| 5 Min RSI 12-period qual INDICATOR                               |
//+------------------------------------------------------------------+
#property copyright "Ron T"
#property link      "http://www.lightpatch.com"

#property indicator_chart_window
#property indicator_buffers 8

#property indicator_color1 Red
#property indicator_color2 HotPink
#property indicator_color3 DarkGray
#property indicator_color4 Red

#property indicator_color5 White
#property indicator_color6 LightGray
#property indicator_color7 LightGreen
#property indicator_color8 White


//---- buffers
double Buffer1[];
double Buffer2[];
double Buffer3[];
double Buffer4[];
double Buffer5[];
double Buffer6[];
double Buffer7[];
double Buffer8[];


// User Input


//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//|------------------------------------------------------------------|

int init()
  {

   // 233 up arrow
   // 234 down arrow
   // 159 big dot
   // 158 little dot
   // 168 open square
   // 120 box with X
   
   SetIndexStyle(0,DRAW_ARROW);
   SetIndexBuffer(0, Buffer1);
   SetIndexArrow(0,159);  //up
   
   SetIndexStyle(1,DRAW_ARROW);
   SetIndexBuffer(1, Buffer2);
   SetIndexArrow(1,159);  //down

   SetIndexStyle(2,DRAW_ARROW);
   SetIndexBuffer(2, Buffer3);
   SetIndexArrow(2,112);

   SetIndexStyle(3,DRAW_ARROW);
   SetIndexBuffer(3, Buffer4);
   SetIndexArrow(3,120);

   SetIndexStyle(4,DRAW_ARROW);
   SetIndexBuffer(4, Buffer5);
   SetIndexArrow(4,159);

   SetIndexStyle(5,DRAW_ARROW);
   SetIndexBuffer(5, Buffer6);
   SetIndexArrow(5,159);

   SetIndexStyle(6,DRAW_ARROW);
   SetIndexBuffer(6, Buffer7);
   SetIndexArrow(6,120);

   SetIndexStyle(7,DRAW_ARROW);
   SetIndexBuffer(7, Buffer8);
   SetIndexArrow(7,120);

   return(0);
  }


//+------------------------------------------------------------------+
//| Custor indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
   int i;
   
   for( i=0; i<Bars; i++ ) Buffer1[i]=0;
   for( i=0; i<Bars; i++ ) Buffer2[i]=0;
   for( i=0; i<Bars; i++ ) Buffer3[i]=0;
   for( i=0; i<Bars; i++ ) Buffer4[i]=0;
   for( i=0; i<Bars; i++ ) Buffer5[i]=0;
   for( i=0; i<Bars; i++ ) Buffer6[i]=0;
   for( i=0; i<Bars; i++ ) Buffer7[i]=0;
   for( i=0; i<Bars; i++ ) Buffer8[i]=0;

   return(0);
  }


//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+

// Current position if 55/45 or over/under. Does any of 
// the previous 'qual' period ever fall below55/above45? (last11)
//
// If qual*2 periods have been above55/below45
// then lets not try to transact any more (last22)
         

int start()
  {
   int      pos=Bars-100; // leave room for moving average periods

   double   cMAfst=0, pMAfst=0;
   double   cMAslo=0, pMAslo=0;
   double   MA100=0;
   
   double p=Point();
   
   while(pos>=1)
     {

      cMAfst=iMA(Symbol(),0,5,0,MODE_LWMA,PRICE_CLOSE, pos);
      pMAfst=iMA(Symbol(),0,5,0,MODE_LWMA,PRICE_CLOSE, pos+1);
      
      cMAslo=iMA(Symbol(),0,25,0,MODE_LWMA,PRICE_CLOSE, pos);
      pMAslo=iMA(Symbol(),0,25,0,MODE_LWMA,PRICE_CLOSE, pos+1);
      
      MA100=iMA(Symbol(),0,100,0,MODE_LWMA,PRICE_CLOSE, pos);

      // rising
      if (pMAfst<=pMAslo && cMAfst>=cMAslo && MA100<cMAslo)
        {
         Buffer8[pos]=cMAfst;
        }

      //falling
      if (pMAfst>=pMAslo && cMAfst<=cMAslo && MA100>cMAslo)
        {
         Buffer4[pos]=cMAfst;
        }

      // possible take-profit mark
      if ((MA100<pMAslo && MA100>cMAslo) || (MA100>pMAslo && MA100<cMAslo))
         {
          Buffer7[pos]=MA100;
         }

 	   pos--;
     }

   return(0);
  }
//+------------------------------------------------------------------+

Comments