HighestLowest

0
(0)
Nama:
Highest - Lowest
Pengarang: lococo (2011.07.26 10:29)
Diunduh: 4789
Unduh:
Highest - Lowest 1
Highest-Lowest.mq4 (2.6 Kb) Melihat

Keterangan:

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" bar; 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.

Gambar:

Highest - Lowest 2

 

 

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

//+------------------------------------------------------------------+
//|                                                    i-HighLow.mq4 |
//|                                          Hak Cipta © 2007, RickD |    
//|                                       Александър Пламенов Рядков |
//|                                            http://www.e2e-fx.net |
//+------------------------------------------------------------------+
#hak cipta properti "© 2007 RickD"
#tautan properti      "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, GAMBAR_LINE, STYLE_SOLID, 1);
   SetIndexStyle(1, GAMBAR_LINE, STYLE_SOLID, 1);
//----   
   SetIndexDrawBegin(0, N);
   SetIndexDrawBegin(1, N);
//----
   SetIndexBuffer(0, UpperBuf);
   SetIndexBuffer(1, LowerBuf);
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
void deinit() 
  {
//----
  }  
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
batal mulai() 
  {
   int counted = IndicatorCounted();
//----
   jika(counted < 0) 
       kembali (-1);
//----  
   jika(counted > 0) 
       counted--;
   int limit = Bars - counted;
//----  
   untuk(int i = 0; Saya < membatasi; saya++) 
     {
       UpperBuf[Saya] = iHigh(BATAL, 0, iHighest(BATAL, 0, MODE_HIGH, N, 
                           Saya)) + N2*Point;
       LowerBuf[Saya] = iLow(BATAL, 0, iLowest(BATAL, 0, MODE_LOW, N, Saya)) - 
                          N2*Point;
     }
  }
//+------------------------------------------------------------------+

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

Betapa bermanfaatnya postingan ini?

Klik pada bintang untuk menilainya!

Penilaian rata-rata 0 / 5. Penghitungan suara: 0

Tidak ada suara sejauh ini! Jadilah orang pertama yang menilai postingan ini.

Kami mohon maaf karena postingan ini tidak bermanfaat bagi Anda!

Mari kita perbaiki postingan ini!

Beri tahu kami bagaimana kami dapat meningkatkan postingan ini?



Pengarang: Tim Wiki Forex
Kami adalah tim Trader Forex yang sangat berpengalaman [2000-2023] yang berdedikasi untuk menjalani hidup dengan cara kita sendiri. Tujuan utama kami adalah untuk mencapai kemandirian dan kebebasan finansial, dan kami telah mengejar pendidikan mandiri dan memperoleh pengalaman luas di pasar Forex sebagai sarana kami untuk mencapai gaya hidup mandiri.