- Tháng sáu 12, 2013
- Gửi bởi: Nhóm ngoại hối Wiki
- Loại: Ngoại hối Ấn Độ
Tên: |
|
||
Tác giả: | lococo (2011.07.26 10:29) | ||
Đã tải xuống: | 4789 | ||
Tải xuống: |
|
||
Sự miêu tả: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" thanh; 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. Hình ảnh:
|
|||
There is another indicator I think doing the same called i-HighLow //+------------------------------------------------------------------+ //| i-HighLow.mq4 | //| Bản quyền © 2007, RickD | //| Александър Пламенов Рядков | //| http://www.e2e-fx.net | //+------------------------------------------------------------------+ #property copyright "© 2007 RickD" #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() { //---- } //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ bắt đầu vô hiệu() { int counted = IndicatorCounted(); //---- nếu như(counted < 0) trở lại (-1); //---- nếu như(counted > 0) counted--; int limit = Bars - counted; //---- vì(int i = 0; Tôi < limit; i++) { UpperBuf[Tôi] = iHigh(VÔ GIÁ TRỊ, 0, iHighest(VÔ GIÁ TRỊ, 0, MODE_HIGH, N, Tôi)) + N2*Point; LowerBuf[Tôi] = iLow(VÔ GIÁ TRỊ, 0, iLowest(VÔ GIÁ TRỊ, 0, MODE_LOW, N, Tôi)) - N2*Point; } } //+------------------------------------------------------------------+ Choose for N2 "0" and you have the same. Nhìn thấy http://codebase.mql4.com/1099 |