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

指标MA dots将均线用点状显示



MA dots指标在主图绘制点状均线。参数extern int panjang= 3;即为均线的参数。

MA dots指标图表效果:MA dots指标MA dots指标源码:

//+------------------------------------------------------------------+
//|                                                      MA dots.mq4 |
//|                                     Copyright MA plotted as dots |
//+------------------------------------------------------------------+
#property copyright "MA plotted as dots"
#property link      "http://www.125808047.com/"

#property indicator_chart_window
#property indicator_buffers 1
#property indicator_color1 White

//---- input parameters
extern int panjang= 3;



//---- buffers
double titik[];

//---- variables

//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
{
   //IndicatorDigits(MarketInfo(Symbol(),MODE_DIGITS)+1);
   //---- indicators
   SetIndexStyle(0,DRAW_ARROW);
   SetIndexArrow(0,158);
   SetIndexBuffer(0,titik);
   SetIndexEmptyValue(0,0.0);
  
   IndicatorShortName("Darma:: MA in DOT");
   

   return(0);
}
//+------------------------------------------------------------------+
//| Custor indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
{
   //---- 
   Comment("www.125808047.com");
   //----
   return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
{
   int limit;
      
   //int signal = MathRound(signal_day*1440/Period());

   int counted_bars = IndicatorCounted();
   //---- check for possible errors
   if (counted_bars<0) return(-1);
   //---- last counted bar will be recounted
   if (counted_bars>0) counted_bars--;
   limit = Bars - counted_bars;

   for(int i=limit; i>=0; i--)
   {
      
      double bahan = iMA(NULL,0,panjang,0,MODE_SMA,PRICE_MEDIAN,i);
      titik[i]=bahan;
      
   }
   
   //----
   return(0);
}
//+------------------------------------------------------------------+

如您喜欢此文章请点下面分享按钮↴峰汇在线 » 指标MA dots将均线用点状显示
上一篇:
下一篇:
分享到:更多 ()