SimpleMAKairi

Download script
Author: Copyright(c) 2010 Masaru Sasaki
SimpleMAKairi

This 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:

  1. Trend Strength: If the percentages are increasing, it indicates that the current trend is gaining strength and pulling away from the long-term average.
  2. 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.
  3. 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.

Indicators Used
Moving average indicator
7 Views
0 Downloads
0 Favorites
SimpleMAKairi
//+------------------------------------------------------------------+
//|                                                SimpleMAKairi.mq4 |
//|                                  Copyright(c) 2010 Masaru Sasaki |
//|                                                                  |
//+------------------------------------------------------------------+
//
// u–Ɛӎ–€v
//  *‚±‚̃vƒƒOƒ‰ƒ€‚ÉŠî‚­sˆ×‚ÌŒ‹‰Ê”­¶‚µ‚½áŠQA‘¹Ž¸‚Ȃǂɂ‚¢‚Ä
//    ’˜ìŽÒ‚ÍˆêØ‚̐ӔC‚𕉂¢‚Ü‚¹‚ñB
//
// uà–¾v
//  *’·ŠúˆÚ“®•½‹Ïü‚©‚ç‚̘¨—£—¦‚ð•\ަ‚µ‚Ü‚·B
//   ’·ŠúˆÚ“®•½‹Ïü‚Ì•W€Ý’è‚́A200SMA, ’†ŠúˆÚ“®•½‹Ïü‚̐ݒè‚́A75EMAA
//   ’ZŠúˆÚ“®•½‹Ïü‚̐ݒè‚́A25EMAA’´’ZŠúˆÚ“®•½‹Ïü‚̐ݒè‚́A5EMA‚Æ
//   ‚È‚Á‚Ä‚¨‚è‚Ü‚·B–”A‰¿Ši‚͏I’l‚Å‚·B
//   l‚¦•û‚Æ‚µ‚ẮA’·ŠúˆÚ“®•½‹Ïü‚©‚ç’†ŠúˆÚ“®•½‹Ïü‚ª—£‚ê‚Ä‚¢‚阨—£—¦
//   ‚Æ’·ŠúˆÚ“®•½‹Ïü‚©‚ç’ZŠúˆÚ“®•½‹Ïü‚ª—£‚ê‚Ä‚¢‚阨—£—¦A’·ŠúˆÚ“®•½‹Ïü
//   ‚©‚ç’´’ZŠúˆÚ“®•½‹Ïü‚ª—£‚ê‚Ä‚¢‚阨—£—¦‚ð‹‚ß‚éŽ–‚É‚æ‚èA3–{‚̘¨—£—¦
//   ‚ªA0‚ɋ߂¢‚½ŽžAƒgƒŒƒ“ƒh“]Š·“_‚ƂȂé‚̂ł́H‚ÆŽv‚¢ƒvƒƒOƒ‰ƒ~ƒ“ƒO
//   ‚Ì—ûK—p‚ɍ쐬‚µ‚Ü‚µ‚½B•s”õ‚ª‚ ‚邯Žv‚¢‚Ü‚·‚̂ŁA
//   Žg—p‚·‚éê‡‚͐ݒ蓙‚⑼‚ÌŽw•W‚Æ‘g‚ݍ‡‚킹‚Ä’ˆÓ‚µ‚ÄŽg—p‰º‚³‚¢B
//
// ŽQl‘Ð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

// Žw•Wƒoƒbƒtƒ@
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()
  {
   // Žw•Wƒoƒbƒtƒ@‚ÌŠ„‚è“–‚Ä
   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;
      
      // ’·ŠúˆÚ“®•½‹Ï‚ÌŒvŽZ
      MA = iMA(NULL, 0, LongMA_period, 0, MODE_SMA, PRICE_CLOSE, i);
      // ’†ŠúŽw”•½ŠŠˆÚ“®•½‹Ï‚ÌŒvŽZ
      MA1 = iMA(NULL, 0, MidleMA_period, 0, MODE_SMMA, PRICE_CLOSE, i);
      // ’ZŠúŽw”•½ŠŠˆÚ“®•½‹Ï‚ÌŒvŽZ
      MA2 = iMA(NULL, 0, ShortMA_period, 0, MODE_SMMA, PRICE_CLOSE, i);
      // ’´’ZŠúŽw”•½ŠŠˆÚ“®•½‹Ï‚ÌŒvŽZ
      MA3 = iMA(NULL, 0, sShortMA_period, 0, MODE_SMMA, PRICE_CLOSE, i);
      
      // ’·ŠúˆÚ“®•½‹Ï‚©‚ç’†ŠúˆÚ“®•½‹Ï‚ª—£‚ê‚Ä‚¢‚阨—£—¦‚ÌŒvŽZ
      BufMAKairi1[i] = ((MA1 - MA)/MA) * 100;
      // ’·ŠúˆÚ“®•½‹Ï‚©‚ç’ZŠúˆÚ“®•½‹Ï‚ª—£‚ê‚Ä‚¢‚阨—£—¦‚ÌŒvŽZ
      BufMAKairi2[i] = ((MA2 - MA)/MA) * 100;
      // ’·ŠúˆÚ“®•½‹Ï‚©‚ç’´’ZŠúˆÚ“®•½‹Ï‚ª—£‚ê‚Ä‚¢‚阨—£—¦‚ÌŒvŽZ
      BufMAKairi3[i] = ((MA3 - MA)/MA) * 100;
      
   }

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

Comments