HighestLowest

0
(0)
姓名:
Highest - Lowest
作者: lococo (2011.07.26 10:29)
已下載: 4789
下載:
Highest - Lowest 1
Highest-Lowest.mq4 (2.6 KB) 看法

描述:

After a while, searching the MQL4 community looking for an explanation on how to calculate the highest and lowest values for a data series over "n" 酒吧; I end up with this indicator that display exactly that.

There are various post explaining how to use iHighest and iLowest, i acknowledge all of them. This is just an application of it that suited my needs.

Feel free to use it and modify it.

圖像:

Highest - Lowest 2

 

 

There is another indicator I think doing the same called i-HighLow

//+------------------------------------------------------------------+
//|                                                    i-HighLow.mq4 |
//|                                          版權所有© 2007, 瑞克·D |    
//|                                       Александър Пламенов Рядков |
//|                                            網址://www.e2e-fx.net |
//+------------------------------------------------------------------+
#property copyright "© 2007 瑞克·D"
#property link      "www.e2e-fx.net"
//----
#define major 1
#define minor 0
//----
#property indicator_chart_window
#property indicator_buffers 2
#property indicator_color1  Gold
#property indicator_color2  DodgerBlue
//----
extern int N = 20;
extern int N2 = 5;
//----
double UpperBuf[];
double LowerBuf[];
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
void init()
  {       
   SetIndexStyle(0, DRAW_LINE, STYLE_SOLID, 1);
   SetIndexStyle(1, DRAW_LINE, STYLE_SOLID, 1);
//----   
   SetIndexDrawBegin(0, N);
   SetIndexDrawBegin(1, N);
//----
   SetIndexBuffer(0, UpperBuf);
   SetIndexBuffer(1, LowerBuf);
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
void deinit() 
  {
//----
  }  
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
void start() 
  {
   int counted = IndicatorCounted();
//----
   如果(counted < 0) 
       return (-1);
//----  
   如果(counted > 0) 
       counted--;
   int limit = Bars - counted;
//----  
   為了(int i = 0; 我 < 限制; i++) 
     {
       UpperBuf[我] = iHigh(無效的, 0, iHighest(無效的, 0, MODE_HIGH, N, 
                           我)) + N2*Point;
       LowerBuf[我] = iLow(無效的, 0, iLowest(無效的, 0, MODE_LOW, N, 我)) - 
                          N2*Point;
     }
  }
//+------------------------------------------------------------------+

Choose for N2 "0" and you have the same. 看 http://codebase.mql4.com/1099

這篇文章有多有用?

點擊一顆星即可對其進行評分!

平均評分 0 / 5. 計票數: 0

目前還沒有投票! 成為第一個評價這篇文章的人.

很抱歉這篇文章對您沒有用!

讓我們改進這篇文章!

告訴我們如何改進這篇文章?



作者: 外匯維基團隊
我們是一支經驗豐富的外匯交易員團隊 [2000-2023] 致力於以我們自己的方式生活的人. 我們的主要目標是實現財務獨立和自由, 我們追求自我教育並在外匯市場上獲得豐富的經驗,以此作為實現自我可持續生活方式的手段.