SimpleMAKairi
Download scriptThis script is a specialized technical analysis tool designed to help traders visualize market momentum and trend strength by measuring the relative distance between different moving averages. Instead of just showing you where prices are, it transforms complex price data into three distinct percentage values that represent how much "tension" exists in the current market movement.
Core Logic and Methodology
The logic functions by calculating four specific Moving Averages (MAs) based on historical price data:
- Long-term MA: Used as the primary baseline or "anchor."
- Middle-term MA: Represents mid-range momentum.
- Short-term MA: Represents immediate price movement.
- Super Short-term MA: Represents very recent, fast-acting fluctuations.
The tool then performs a specific calculation for each of the three shorter averages in relation to the long-term anchor. It determines how much the shorter average has deviated from the long-term average and expresses that difference as a percentage.
Visual Interpretation
By converting these distances into percentages, the script provides a clearer picture of market behavior than standard indicators might:
- Trend Strength: If the percentages are increasing, it indicates that the current trend is gaining strength and pulling away from the long-term average.
- Momentum Shifts: It allows traders to see how quickly the price is accelerating. Because there are three different lines (representing Short, Middle, and Super Short terms), you can observe whether the "fast" money is moving faster or slower than the "slow" money.
- Overextended Markets: By watching these percentages, a trader can identify when a market might be overextended. If the gap between the short-term price action and the long-term baseline becomes excessively large, it may signal a potential cooling-off period or a trend reversal.
Summary for Traders
Essentially, this script acts as a "momentum gauge." It strips away the noise of raw price action and shows you exactly how far the current market pulse has moved away from its historical average. It is designed to help you distinguish between a steady, healthy trend and a volatile, overextended move.
//+------------------------------------------------------------------+
//| SimpleMAKairi.mq4 |
//| Copyright(c) 2010 Masaru Sasaki |
//| |
//+------------------------------------------------------------------+
//
// uÆÓv
// *±ÌvOÉîÃs×Ìʶµ½áQA¹¸ÈÇÉ¢Ä
// ìÒÍêØÌÓCð¢Ü¹ñB
//
// uà¾v
// *·úÚ®½Ïü©ç̨£¦ð\¦µÜ·B
// ·úÚ®½ÏüÌWÝèÍA200SMA, úÚ®½ÏüÌÝèÍA75EMAA
// ZúÚ®½ÏüÌÝèÍA25EMAA´ZúÚ®½ÏüÌÝèÍA5EMAÆ
// ÈÁĨèÜ·BA¿iÍIlÅ·B
// l¦ûƵÄÍA·úÚ®½Ïü©çúÚ®½Ïüª£êĢ騣¦
// Æ·úÚ®½Ïü©çZúÚ®½Ïüª£êĢ騣¦A·úÚ®½Ïü
// ©ç´ZúÚ®½Ïüª£êĢ騣¦ðßéÉæèA3{̨£¦
// ªA0Éßâ½Agh]·_ÆÈéÌÅÍHÆv¢vO~O
// ÌûKpÉ쬵ܵ½Bsõª éÆv¢Ü·ÌÅA
// gp·éêÍÝèâ¼ÌwWÆgÝí¹ÄÓµÄgpº³¢B
//
// QlÐFFX^g[_[üå (PanRolling)
// ¿`[gÌÇÝûÌî{ (®ïзÎéÉ)
//
#property copyright "Copyright(c) 2010 Masaru Sasaki"
#property link "http://www.metaquotes.net"
#property indicator_separate_window
#property indicator_buffers 3
#property indicator_color1 Red
#property indicator_color2 Cyan
#property indicator_color3 Yellow
// wWobt@
double BufMAKairi1[];
double BufMAKairi2[];
double BufMAKairi3[];
// Ú®½ÏüúÔ ÏXūܷB
extern int LongMA_period = 200;
extern int MidleMA_period = 75;
extern int ShortMA_period = 25;
extern int sShortMA_period = 5;
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
// wWobt@폀
SetIndexBuffer(0, BufMAKairi1);
SetIndexBuffer(1, BufMAKairi2);
SetIndexBuffer(2, BufMAKairi3);
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start()
{
int counted_bars=IndicatorCounted();
int limit = Bars-counted_bars;
double MA, MA1, MA2, MA3;
if( counted_bars == 0 ) limit = limit - LongMA_period - 1;
for( int i=limit-1; i>=0; i-- )
{
MA = 0.0; MA1 = 0.0; MA2 = 0.0; MA3 = 0.0;
// ·úÚ®½ÏÌvZ
MA = iMA(NULL, 0, LongMA_period, 0, MODE_SMA, PRICE_CLOSE, i);
// úw½Ú®½ÏÌvZ
MA1 = iMA(NULL, 0, MidleMA_period, 0, MODE_SMMA, PRICE_CLOSE, i);
// Zúw½Ú®½ÏÌvZ
MA2 = iMA(NULL, 0, ShortMA_period, 0, MODE_SMMA, PRICE_CLOSE, i);
// ´Zúw½Ú®½ÏÌvZ
MA3 = iMA(NULL, 0, sShortMA_period, 0, MODE_SMMA, PRICE_CLOSE, i);
// ·úÚ®½Ï©çúÚ®½Ïª£êĢ騣¦ÌvZ
BufMAKairi1[i] = ((MA1 - MA)/MA) * 100;
// ·úÚ®½Ï©çZúÚ®½Ïª£êĢ騣¦ÌvZ
BufMAKairi2[i] = ((MA2 - MA)/MA) * 100;
// ·úÚ®½Ï©ç´ZúÚ®½Ïª£êĢ騣¦ÌvZ
BufMAKairi3[i] = ((MA3 - MA)/MA) * 100;
}
return(0);
}
//+------------------------------------------------------------------+
Comments