Raghee5minutes
Download scriptThis tool is designed as a specialized visual aid for traders who focus on short-term price movements, specifically tailored for the 5-minute timeframe. It works by analyzing the trend, momentum, and volatility of a financial instrument to provide a clearer picture of market direction.
How the Logic Works
The script functions through three primary layers of analysis:
1. Timeframe Restriction To ensure accuracy based on its specific mathematical design, the tool is programmed to only activate when viewed on a 5-minute chart or lower. If used on higher timeframes (like hourly or daily charts), the indicator will remain inactive to prevent misleading signals.
2. Trend and Angle Analysis The core "brain" of this script calculates the trajectory of the price movement by measuring the angle of the trend. It looks at how quickly the price is moving relative to a specific moving average.
- If the upward momentum is strong enough (exceeding a specific degree of incline), it identifies a bullish trend.
- If the downward momentum is aggressive enough, it identifies a bearish trend.
3. Dynamic Moving Averages The tool plots four different "Exponential Moving Averages" (EMAs) on your chart simultaneously. These are smoother versions of price action that help filter out market "noise."
- Standard Monitoring: It continuously tracks three primary lines (13, 21, and 55 periods) based on the closing price to show the general flow of the market.
- Adaptive Switching: A unique feature of this logic is its ability to "switch" what it tracks based on the trend angle. If the market is moving sharply in one direction, the tool adjusts which data points (Highs or Lows) it focuses on for the primary 34-period average. This allows the indicator to react more sensitively to price extremes during volatile trends.
Summary for the User
Essentially, this script acts as a trend-sensitive filter. It doesn't just show you where the price has been; it calculates the "slope" of the market. When the market is moving with significant force, the tool shifts its focus to highlight the most relevant price extremes, while providing a constant backdrop of smoothed average lines to help you visualize the prevailing momentum at a glance.
//+------------------------------------------------------------------+
//| Raghee5minutes.mq4 |
//| Copyright © 2009, Roman Robidet Burel |
//| IF you find this Indicator/Code usefull and you want |
//| donate something |
//| YOU ARE WELCOME PayPal : roman.robidet@hotmail.com |
//| |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2009, Roman Robidet Burel"
#property link "none"
#property indicator_chart_window
#property indicator_buffers 4
#property indicator_color1 Chartreuse
#property indicator_color2 Green
#property indicator_color3 Red
#property indicator_color4 Maroon
double ema13[];
double ema21[];
double ema34[];
double ema55[];
double XScale;
double Angle;
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
//---- indicators
IndicatorBuffers(4);
//---- drawing settings
SetIndexStyle(0,DRAW_LINE,0,2);
SetIndexStyle(1,DRAW_LINE,0,2);
SetIndexStyle(2,DRAW_LINE,0,2);
SetIndexStyle(3,DRAW_LINE,0,2);
//---- indicator buffers mapping
SetIndexBuffer(0,ema13);
SetIndexBuffer(1,ema21);
SetIndexBuffer(2,ema34);
SetIndexBuffer(3,ema55);
// SetIndexEmptyValue(0,0.0);
// SetIndexEmptyValue(1,0.0);
// SetIndexEmptyValue(2,0.0);
//---- indicator short name
IndicatorShortName("Raghe Fast Trade 5 minutes");
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start()
{
if (Period()>5) return(0);
XScale=MarketInfo(Symbol(),MODE_TICKVALUE)*MarketInfo(Symbol(),MODE_TICKSIZE)*10;
if (XScale==0) return(0);
double RV13=iMA(Symbol(),60,34,0,MODE_EMA,PRICE_CLOSE,13);
double RV2=iMA(Symbol(),60,34,0,MODE_EMA,PRICE_CLOSE,0);
Angle=MathArctan( (RV2-RV13)/(XScale * 13) )/3.1415965*180;
//----
int limit;
int counted_bars=IndicatorCounted();
if(counted_bars<0) return(-1);
if(counted_bars>0) counted_bars--;
limit=Bars-counted_bars;
//-- main loop
for(int i=0; i<limit; i++)
{
if (Angle>30) { ema34[i]=iMA(Symbol(),0,34,0,MODE_EMA,PRICE_LOW,i);SetIndexLabel(2,"EMA34L");}
else if (Angle<-30) { ema34[i]=iMA(Symbol(),0,34,0,MODE_EMA,PRICE_HIGH,i);SetIndexLabel(2,"EMA34H");}
else { ema13[i]=0;ema21[i]=0;ema55[i]=0;break;}
ema13[i]=iMA(Symbol(),0,13,0,MODE_EMA,PRICE_CLOSE,i);
SetIndexLabel(0,"EMA13C");
ema21[i]=iMA(Symbol(),0,21,0,MODE_EMA,PRICE_CLOSE,i);
SetIndexLabel(1,"EMA21C");
ema55[i]=iMA(Symbol(),0,55,0,MODE_EMA,PRICE_CLOSE,i);
SetIndexLabel(3,"EMA55C");
}
//----
return(0);
}
//+------------------------------------------------------------------+
Comments