Indicators Used
0
Views
0
Downloads
0
Favorites
SimpleMAKairi
//+------------------------------------------------------------------+
//| 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
Markdown Formatting Guide
# H1
## H2
### H3
**bold text**
*italicized text*
[title](https://www.example.com)

`code`
```
code block
```
> blockquote
- Item 1
- Item 2
1. First item
2. Second item
---