有您的持续关注
我们会做得更好

绘制指定时间段高低点的指标Hi_Low_Indicator



Hi_Low_Indicator指标绘制的是H1指定K线个数的高低点。程序中昨日高低点函数也是调用H1.

Hi_Low_Indicator指标图表效果:Hi_Low_Indicator指标Hi_Low_Indicator指标源码:

//+------------------------------------------------------------------+
//|                                                Pivots_Hi_Low.mq4 |
//|                       Copyright @2006, Cartwright Software Corp. |
//+------------------------------------------------------------------+
#property copyright "Copyright @2006, Cartwright Software Corp."
#property link      "http://www.125808047.com"

#property indicator_chart_window

extern int BarsBack=8;    
extern bool ShowLines=true;
double yesterday_high, yesterday_low;


int init()
  {
//---- indicators
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
//----
ObjectDelete("Yesterdays Low line");   
ObjectDelete("Yesterdays High line"); 
Comment("www.125808047.com");     
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
  {

//----
yesterday_high=iHigh(NULL, PERIOD_H1,Highest(NULL, PERIOD_H1, MODE_HIGH, BarsBack, 0)); 
yesterday_low=iLow(NULL, PERIOD_H1,Lowest(NULL, PERIOD_H1, MODE_LOW, BarsBack, 0));     

if (ShowLines==true && Period() < PERIOD_D1) {  
ObjectDelete("Yesterdays Low line");
ObjectCreate("Yesterdays Low line",OBJ_HLINE, 0, Time[0], yesterday_low);
ObjectSet("Yesterdays Low line", OBJPROP_STYLE, STYLE_DASH);
ObjectSet("Yesterdays Low line", OBJPROP_COLOR, Green);

ObjectDelete("Yesterdays High line");
ObjectCreate("Yesterdays High line",OBJ_HLINE, 0, Time[0], yesterday_high);
ObjectSet("Yesterdays High line", OBJPROP_STYLE, STYLE_DASH);
ObjectSet("Yesterdays High line", OBJPROP_COLOR, Red);      
}   
//----
   return(0);
  }
//+------------------------------------------------------------------+

如您喜欢此文章请点下面分享按钮↴峰汇在线 » 绘制指定时间段高低点的指标Hi_Low_Indicator
上一篇:
下一篇:
分享到:更多 ()