- 6월 12, 2013
- 게시자: 외환 위키 팀
- 범주: FX산업
이름: |
|
||
작가: | lococo (2011.07.26 10:29) | ||
다운로드됨: | 4789 | ||
다운로드: |
|
||
설명: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. 영상:
|
|||
There is another indicator I think doing the same called i-HighLow //+------------------------------------------------------------------+ //| i-HighLow.mq4 | //| 저작권 © 2007, RickD | //| Александър Пламенов Рядков | //| http://www.e2e-fx.net | //+------------------------------------------------------------------+ #재산 저작권 "© 2007 RickD" #속성 링크 "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) 반품 (-1); //---- 만약에(counted > 0) counted--; int limit = Bars - counted; //---- ~을 위한(int i = 0; 나 < limit; 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 |