[MT4指标]日图高低指示
主图指标,日图高低指示
mt4指标类型:震荡指标
是否能用在mt4手机版上:否
是否含有未来函数:无
//+------------------------------------------------------------------+
//| DailyHL.mq4 |
//| These are the days highest high and lowest low |
//| Written by: Ice |
//| |
//+------------------------------------------------------------------+
#property copyright \"2005 Free software for trader\"
#property indicator_chart_window
#property indicator_buffers 2
#property indicator_color1 Blue
#property indicator_color2 Red
//---- input parameters\\
datetime BT;
double YesterdayHigh[50];
double YesterdayLow[50];
double YesterdayClose[50];
//---- buffers
double HighArray;
double LowArray;
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
//---- indicators
// Pivot
SetIndexStyle(0,DRAW_LINE);
SetIndexBuffer(0,HighArray);
IndicatorShortName(\"High Line\");
// Resistance 1
SetIndexStyle(1,DRAW_LINE);
SetIndexBuffer(1,LowArray);
SetIndexLabel(3,\"Low Line\");
return(0);
}
//+------------------------------------------------------------------+
//| Custor indicator deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start()
{
int counted_bars=IndicatorCounted();
ArrayResize(BT, Bars); Print(\"Bars = \" + Bars);
// Fill BT with bar open TIME
ArrayCopySeries(BT, MODE_TIME);
// Fill temp arrays with High, Low and Close prices per day
ArrayCopySeries(YesterdayHigh, MODE_HIGH, Symbol(), PERIOD_D1);
ArrayCopySeries(YesterdayLow, MODE_LOW, Symbol(), PERIOD_D1);
ArrayCopySeries(YesterdayClose, MODE_CLOSE, Symbol(), PERIOD_D1);
int od = 0;
int dd = 0;
double HighLine;
double LowLine;
//Cycle through all the bars and fill the indicator bars with the Pivot point values
for (int i = 0; i <= Bars; i++) {
if (TimeDay(BT) != od) {
dd++;
HighLine = YesterdayHigh[dd-1];
LowLine = YesterdayLow[dd-1];
od = TimeDay(BT);
}
HighArray = HighLine;
LowArray=LowLine;
}
//----
return(0);
}
//+------------------------------------------------------------------+
发表于:2017-08-11 08:08只看该作者
2楼
谢谢分享!!
韬客社区www.talkfx.co