SimpleRSI&amp_MA

Author: Copyright(c) 2010 Masaru Sasaki
SimpleRSI&amp_MA
Indicators Used
Relative strength indexMoving average indicator
0 Views
0 Downloads
0 Favorites
SimpleRSI&amp_MA
//+------------------------------------------------------------------+
//|                                                 SimpleRSI&MA.mq4 |
//|                                  Copyright(c) 2010 Masaru Sasaki |
//|                                                                  |
//+------------------------------------------------------------------+
// 
// u–Ɛӎ–€v
//  *‚±‚̃vƒƒOƒ‰ƒ€‚ÉŠî‚­sˆ×‚ÌŒ‹‰Ê”­¶‚µ‚½áŠQA‘¹Ž¸‚Ȃǂɂ‚¢‚Ä
//    ’˜ìŽÒ‚ÍˆêØ‚̐ӔC‚𕉂¢‚Ü‚¹‚ñB
//
// uà–¾v
//  *RSI’l‚ÆRSI’l‚ðˆÚ“®•½‹Ï‚µ‚½’l‚ð•\ަ‚µ‚Ü‚·B
//   ŠúŠÔ‚Ì•W€Ý’è‚́A14‚ƂȂÁ‚Ä‚¨‚è‚Ü‚·B
//   “ñ‚‚̐ü‚̃NƒƒX‚ª”„”ƒ”»’f‚ƂȂÁ‚Ä‚¢‚Ü‚·B
//   –”AˆÚ“®•½‹Ïü‚ÌŽí—Þ‚ÍSMAA‰¿Ši‚͏I’l‚Å‚·B
//   ƒvƒƒOƒ‰ƒ~ƒ“ƒO‚Ì—ûK—p‚ɍ쐬‚µ‚½ˆ×A•s”õ‚ª‚ ‚邯Žv‚¢‚Ü‚·‚̂ŁA
//   Žg—p‚·‚éê‡‚͐ݒ蓙‚²’ˆÓ‰º‚³‚¢B
//
// ŽQl‘ÐFFXƒƒ^ƒgƒŒ[ƒ_[“ü–å PanRolling
//
#property copyright "Copyright(c) 2010 Masaru Sasaki"
#property link      "http://www.metaquotes.net"

#property indicator_separate_window
#property indicator_buffers 2
#property indicator_color1 Red
#property indicator_color2 Cyan
#property indicator_minimum 0
#property indicator_maximum 100
#property indicator_level1 30
#property indicator_level2 70

// Žw•Wƒoƒbƒtƒ@
double RSI_Buf[];
double RSI_MA_Buf[];

// ŠúŠÔ
extern int RSI_period = 14;

//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
  // Žw•Wƒoƒbƒtƒ@‚ÌŠ„‚è“–‚Ä
  SetIndexBuffer(0, RSI_Buf);
  SetIndexBuffer(1, RSI_MA_Buf);

   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {

   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
  {
   int    counted_bars=IndicatorCounted();
   int i;
   int limit = Bars - IndicatorCounted();
   
   if( counted_bars == 0 ) limit = limit - RSI_period - 1;     
   // RSI’l‚ÌŒvŽZ
   for( i = limit-1; i >= 0; i-- ){
      RSI_Buf[i] = iRSI(NULL, 0, RSI_period,PRICE_CLOSE, i);
   }
   
   if( counted_bars == 0 ) limit = limit - RSI_period - 1;
   // RSIˆÚ“®•½‹Ï’l‚ÌŒvŽZ
   for( i = limit-1; i >= 0; i-- ){
      RSI_MA_Buf[i] = iMAOnArray(RSI_Buf, 0, RSI_period, 0, MODE_SMA, i);
   }
   
   return(0);
  }
//+------------------------------------------------------------------+

Comments

Markdown supported. Formatting help

Markdown Formatting Guide

Element Markdown Syntax
Heading # H1
## H2
### H3
Bold **bold text**
Italic *italicized text*
Link [title](https://www.example.com)
Image ![alt text](image.jpg)
Code `code`
Code Block ```
code block
```
Quote > blockquote
Unordered List - Item 1
- Item 2
Ordered List 1. First item
2. Second item
Horizontal Rule ---