5Min_01a_v1

Author: Ron T
5Min_01a_v1

Overview of the 10 Minute Trader Logic

This script is designed as a visual trading indicator for the MetaTrader platform. Its primary purpose is to identify specific momentum trends by monitoring the Relative Strength Index (RSI)—a common technical analysis tool that measures the speed and change of price movements.

Instead of providing a single simple signal, this logic tracks "chains" of data to determine how long a market has been overextended in a particular direction. It then places visual markers (dots) on your chart to represent the strength and duration of these trends.

How the Logic Works

1. Momentum Monitoring The script constantly calculates the RSI values for the current price and compares them against two specific boundaries:

  • Upper Boundary (53): Indicates a strong upward momentum.
  • Lower Boundary (43): Indicates a strong downward momentum.

2. Chain Tracking (The "Strength" Mechanism) Rather than just looking at one single moment in time, the script looks backward at the previous candles to see how many consecutive periods the market has remained above or below these boundaries.

  • Bullish Trend (Upward): If the RSI stays above the upper boundary (53) for several consecutive bars, the script recognizes an increasing bullish chain.
  • Bearish Trend (Downward): If the RSI stays below the lower boundary (43) for several consecutive bars, the script recognizes an increasing bearish chain.

3. Visual Feedback The indicator translates these chains into visual dots on your chart:

  • Positive Numbers: When a bullish chain is detected, it places dots above the price. The number of dots appearing simultaneously tells you how many candles in a row the momentum has remained strong. For example, if the market has been overextended upwards for 5 bars straight, you will see a stack of dots representing that duration.
  • Negative Numbers: When a bearish chain is detected, it places dots below the price. Similarly, the number of dots indicates how many consecutive candles have stayed in the oversold zone.

Key Summary for the User

The logic effectively visualizes "persistence." It helps you see not just that the market is moving up or down, but how long it has been moving in that direction without a significant correction. By observing the stack of dots, you can visually gauge the intensity of the current trend and identify potential exhaustion points where the momentum might be reaching its limit.

Price Data Components
Indicators Used
Relative strength index
Miscellaneous
Implements a curve of type %1
11 Views
0 Downloads
0 Favorites
5Min_01a_v1
/*-----------------------------+
|			       |
| Shared by www.Aptrafx.com    |
|			       |
+------------------------------*/

//+------------------------------------------------------------------+
//| 10 Minute trader                                                 |
//+------------------------------------------------------------------+
#property copyright "Ron T"
#property link      "http://www.lightpatch.com"

#property indicator_chart_window
#property indicator_buffers 7
#property indicator_color1 HotPink  // arrow up
#property indicator_color2 HotPink  // arrow down
#property indicator_color3 Aqua
#property indicator_color4 Red
#property indicator_color5 White
#property indicator_color6 HotPink
#property indicator_color7 LimeGreen
#property indicator_color8 White

//---- buffers
double ExtMapBuffer1[];
double ExtMapBuffer2[];
double ExtMapBuffer3[];
double ExtMapBuffer4[];
double ExtMapBuffer5[];
double ExtMapBuffer6[];
double ExtMapBuffer7[];
double ExtMapBuffer8[];

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

int init()
  {

   // 233 up arrow
   // 234 down arrow
   // 159 big dot
   // 168 open square
   
   SetIndexStyle(0,DRAW_ARROW);
   SetIndexBuffer(0, ExtMapBuffer1);
   SetIndexArrow(0,159);
   
   SetIndexStyle(1,DRAW_ARROW);
   SetIndexBuffer(1, ExtMapBuffer2);
   SetIndexArrow(1,159);

   SetIndexStyle(2,DRAW_ARROW);
   SetIndexBuffer(2, ExtMapBuffer3);
   SetIndexArrow(2,159);

   SetIndexStyle(3,DRAW_ARROW);
   SetIndexBuffer(3, ExtMapBuffer4);
   SetIndexArrow(3,159);

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

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

   SetIndexStyle(6,DRAW_ARROW);
   SetIndexBuffer(6, ExtMapBuffer7);
   SetIndexArrow(6,159);

   SetIndexStyle(7,DRAW_ARROW);
   SetIndexBuffer(7, ExtMapBuffer8);
   SetIndexArrow(7,159);

   return(0);
  }


//+------------------------------------------------------------------+
//| Custor indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
   int i;
   
   for( i=0; i<Bars; i++ ) ExtMapBuffer1[i]=0;
   for( i=0; i<Bars; i++ ) ExtMapBuffer2[i]=0;
   for( i=0; i<Bars; i++ ) ExtMapBuffer3[i]=0;
   for( i=0; i<Bars; i++ ) ExtMapBuffer4[i]=0;
   for( i=0; i<Bars; i++ ) ExtMapBuffer5[i]=0;
   for( i=0; i<Bars; i++ ) ExtMapBuffer6[i]=0;
   for( i=0; i<Bars; i++ ) ExtMapBuffer7[i]=0;
   for( i=0; i<Bars; i++ ) ExtMapBuffer8[i]=0;

   return(0);
  }


//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
  {
   double   draw=0;
   int      heit=0;
   
   double rsimin=43;
   double rsimax=53;

   double   rsi0=0;              // Relative Strength Indicator
   double   rsi1=0,     rsi2=0;  // long chain rsi 1&2
   double   rsi3=0,     rsi4=0;  // long chain rsi 3&4
   double   rsi5=0,     rsi6=0;  // long chain rsi 1&2
   double   rsi7=0,     rsi8=0;  // long chain rsi 3&4
   
   double p=Point();
     
   int pos=Bars-100;             // leave room for moving average periods
      
   while(pos>=0)
     {
      rsi0=iRSI(Symbol(),0,28,PRICE_CLOSE,pos+0);
      rsi1=iRSI(Symbol(),0,28,PRICE_CLOSE,pos+1);
      rsi2=iRSI(Symbol(),0,28,PRICE_CLOSE,pos+2);
      rsi3=iRSI(Symbol(),0,28,PRICE_CLOSE,pos+3);
      rsi4=iRSI(Symbol(),0,28,PRICE_CLOSE,pos+4);
      rsi5=iRSI(Symbol(),0,28,PRICE_CLOSE,pos+5);
      rsi6=iRSI(Symbol(),0,28,PRICE_CLOSE,pos+6);
      rsi7=iRSI(Symbol(),0,28,PRICE_CLOSE,pos+7);
      
      heit=0;
      
      if (rsi0>rsimax) heit=1;
      if (rsi0>rsimax && rsi1>rsimax) heit=2;
      if (rsi0>rsimax && rsi1>rsimax && rsi2>rsimax) heit=3;
      if (rsi0>rsimax && rsi1>rsimax && rsi2>rsimax && rsi3>rsimax) heit=4;
      if (rsi0>rsimax && rsi1>rsimax && rsi2>rsimax && rsi3>rsimax && rsi4>rsimax) heit=5;
      if (rsi0>rsimax && rsi1>rsimax && rsi2>rsimax && rsi3>rsimax && rsi4>rsimax && rsi5>rsimax) heit=6;
      if (rsi0>rsimax && rsi1>rsimax && rsi2>rsimax && rsi3>rsimax && rsi4>rsimax && rsi5>rsimax && rsi6>rsimax) heit=7;
      if (rsi0>rsimax && rsi1>rsimax && rsi2>rsimax && rsi3>rsimax && rsi4>rsimax && rsi5>rsimax && rsi6>rsimax && rsi7<rsimin) heit=8;
      
      if (rsi0<rsimin) heit=-1;
      if (rsi0<rsimin && rsi1<rsimin) heit=-2;
      if (rsi0<rsimin && rsi1<rsimin && rsi2<rsimin) heit=-3;
      if (rsi0<rsimin && rsi1<rsimin && rsi2<rsimin && rsi3<rsimin) heit=-4;
      if (rsi0<rsimin && rsi1<rsimin && rsi2<rsimin && rsi3<rsimin && rsi4<rsimin) heit=-5;
      if (rsi0<rsimin && rsi1<rsimin && rsi2<rsimin && rsi3<rsimin && rsi4<rsimin && rsi5<rsimin) heit=-6;
      if (rsi0<rsimin && rsi1<rsimin && rsi2<rsimin && rsi3<rsimin && rsi4<rsimin && rsi5<rsimin && rsi6<rsimin) heit=-7;
      if (rsi0<rsimin && rsi1<rsimin && rsi2<rsimin && rsi3<rsimin && rsi4<rsimin && rsi5<rsimin && rsi6<rsimin && rsi7<rsimin) heit=-8;
      
      
      if (heit>0)
        {
         switch (heit)
         {
          case 1:
             ExtMapBuffer1[pos]=High[pos]+(p*1);
             break;
          case 2:
             ExtMapBuffer1[pos]=High[pos]+(p*1);
             ExtMapBuffer2[pos]=High[pos]+(p*2);
             break;
          case 3:
             ExtMapBuffer1[pos]=High[pos]+(p*1);
             ExtMapBuffer2[pos]=High[pos]+(p*2);
             ExtMapBuffer3[pos]=High[pos]+(p*3);
             break;
          case 4:
             ExtMapBuffer1[pos]=High[pos]+(p*1);
             ExtMapBuffer2[pos]=High[pos]+(p*2);
             ExtMapBuffer3[pos]=High[pos]+(p*3);
             ExtMapBuffer4[pos]=High[pos]+(p*4);
             break;
          case 5:
             ExtMapBuffer1[pos]=High[pos]+(p*1);
             ExtMapBuffer2[pos]=High[pos]+(p*2);
             ExtMapBuffer3[pos]=High[pos]+(p*3);
             ExtMapBuffer4[pos]=High[pos]+(p*4);
             ExtMapBuffer5[pos]=High[pos]+(p*5);
             break;
          case 6:
             ExtMapBuffer1[pos]=High[pos]+(p*1);
             ExtMapBuffer2[pos]=High[pos]+(p*2);
             ExtMapBuffer3[pos]=High[pos]+(p*3);
             ExtMapBuffer4[pos]=High[pos]+(p*4);
             ExtMapBuffer5[pos]=High[pos]+(p*5);
             ExtMapBuffer6[pos]=High[pos]+(p*6);
             break;
          case 7:
             ExtMapBuffer1[pos]=High[pos]+(p*1);
             ExtMapBuffer2[pos]=High[pos]+(p*2);
             ExtMapBuffer3[pos]=High[pos]+(p*3);
             ExtMapBuffer4[pos]=High[pos]+(p*4);
             ExtMapBuffer5[pos]=High[pos]+(p*5);
             ExtMapBuffer6[pos]=High[pos]+(p*6);
             ExtMapBuffer7[pos]=High[pos]+(p*7);
             break;
          case 8:
             ExtMapBuffer1[pos]=High[pos]+(p*1);
             ExtMapBuffer2[pos]=High[pos]+(p*2);
             ExtMapBuffer3[pos]=High[pos]+(p*3);
             ExtMapBuffer4[pos]=High[pos]+(p*4);
             ExtMapBuffer5[pos]=High[pos]+(p*5);
             ExtMapBuffer6[pos]=High[pos]+(p*6);
             ExtMapBuffer7[pos]=High[pos]+(p*7);
             ExtMapBuffer8[pos]=High[pos]+(p*8);
             break;
         }
        }

      if (heit<0)
        {
         switch (heit)
         {
          case -1:
             ExtMapBuffer1[pos]=Low[pos]-(p*1);
             break;
          case -2:
             ExtMapBuffer1[pos]=Low[pos]-(p*1);
             ExtMapBuffer2[pos]=Low[pos]-(p*2);
             break;
          case -3:
             ExtMapBuffer1[pos]=Low[pos]-(p*1);
             ExtMapBuffer2[pos]=Low[pos]-(p*2);
             ExtMapBuffer3[pos]=Low[pos]-(p*3);
             break;
          case -4:
             ExtMapBuffer1[pos]=Low[pos]-(p*1);
             ExtMapBuffer2[pos]=Low[pos]-(p*2);
             ExtMapBuffer3[pos]=Low[pos]-(p*3);
             ExtMapBuffer4[pos]=Low[pos]-(p*4);
             break;
          case -5:
             ExtMapBuffer1[pos]=Low[pos]-(p*1);
             ExtMapBuffer2[pos]=Low[pos]-(p*2);
             ExtMapBuffer3[pos]=Low[pos]-(p*3);
             ExtMapBuffer4[pos]=Low[pos]-(p*4);
             ExtMapBuffer5[pos]=Low[pos]-(p*5);
             break;
          case -6:
             ExtMapBuffer1[pos]=Low[pos]-(p*1);
             ExtMapBuffer2[pos]=Low[pos]-(p*2);
             ExtMapBuffer3[pos]=Low[pos]-(p*3);
             ExtMapBuffer4[pos]=Low[pos]-(p*4);
             ExtMapBuffer5[pos]=Low[pos]-(p*5);
             ExtMapBuffer6[pos]=Low[pos]-(p*6);
             break;
          case -7:
             ExtMapBuffer1[pos]=Low[pos]-(p*1);
             ExtMapBuffer2[pos]=Low[pos]-(p*2);
             ExtMapBuffer3[pos]=Low[pos]-(p*3);
             ExtMapBuffer4[pos]=Low[pos]-(p*4);
             ExtMapBuffer5[pos]=Low[pos]-(p*5);
             ExtMapBuffer6[pos]=Low[pos]-(p*6);
             ExtMapBuffer7[pos]=Low[pos]-(p*7);
             break;
          case -8:
             ExtMapBuffer1[pos]=Low[pos]-(p*1);
             ExtMapBuffer2[pos]=Low[pos]-(p*2);
             ExtMapBuffer3[pos]=Low[pos]-(p*3);
             ExtMapBuffer4[pos]=Low[pos]-(p*4);
             ExtMapBuffer5[pos]=Low[pos]-(p*5);
             ExtMapBuffer6[pos]=Low[pos]-(p*6);
             ExtMapBuffer7[pos]=Low[pos]-(p*7);
             ExtMapBuffer8[pos]=Low[pos]-(p*8);
             break;
         }
        }

 	   pos--;
     }

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

Comments