诚信为本
量力而为
当前位置:峰汇在线 > MetaTrader 4 > MT4指标 > 正文

注释收盘价指标 hemnina.mq4

hemnina指标注释当前10根K线的收盘价。

图表:hemnina指标

源码:

//+------------------------------------------------------------------+
//|                                                      hemnina.mq4 |
//|                                                              mog |
//+------------------------------------------------------------------+
#property copyright "mog"
#property link      "http://www.125808047.com/"
//----
#property indicator_chart_window
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int OnInit()
  {
   Comment("www.125808047.com");
    return(INIT_SUCCEEDED);
  }
// ------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int OnCalculate(const int rates_total,
                const int prev_calculated,
                const datetime &time[],
                const double &open[],
                const double &high[],
                const double &low[],
                const double &close[],
                const long &tick_volume[],
                const long &volume[],
                const int &spread[])
  {
   int    counted_bars=IndicatorCounted();
   double p10;
   double p9;
   double p8;
   double p7;
   double p6;
   double p5;
   double p4;
   double p3;
   double p2;
   double p1;
   double p0;
//-----
   p10=iClose(0,0,10);
   p9=iClose(0,0,9);
   p8=iClose(0,0,8);
   p7=iClose(0,0,7);
   p6=iClose(0,0,6);
   p5=iClose(0,0,5);
   p4=iClose(0,0,4);
   p3=iClose(0,0,3);
   p2=iClose(0,0,2);
   p1=iClose(0,0,1);
   p0=iClose(0,0,0);
//----
   Comment("Close[10] = ",p10,
           "\nClose[9] = ",p9,
           "\nClose[8] = ",p8,
           "\nClose[7] = ",p7,
           "\nClose[6] = ",p6,
           "\nClose[5] = ",p5,
           "\nClose[4] = ",p4,
           "\nClose[3] = ",p3,
           "\nClose[2] = ",p2,
           "\nClose[1] = ",p1,
           "\nClose[0] = ",p0);
//----
   return(rates_total);
  }
//+------------------------------------------------------------------+
打赏
版权所有转载请注明标题及链接:峰汇在线 » 注释收盘价指标 hemnina.mq4
上一篇:
下一篇:
分享到: 更多 (0)

如您觉得此文不错请扫码打赏!

支付宝扫一扫打赏

微信扫一扫打赏