5评论

0收藏

黄金分割画线

avatar QWE147 | 1661 人阅读 | 5 人评论 | 2023-08-08

indicator_chart_window
#property indicator_buffers 4
#property indicator_color1 Aqua
#property indicator_color2 Lime
#property indicator_color3 Yellow
#property indicator_color4 Salmon
//------- ?????????? ?????????? --------------------------------------
//------- ?????????? ??????? ??????? ---------------------------------
//------- ??????? ????????? ?????????? -------------------------------
extern int NumberOfBars=1000;  // ?????????? ????? ??????? (0-???)
//------- ?????? ?????????? ------------------------------------------
double buf24[];
double buf38[];
double buf62[];
double buf76[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
  void init()
  {
   SetIndexBuffer(0, buf24);
   SetIndexStyle (0, DRAW_LINE, STYLE_DOT);
   SetIndexEmptyValue(0, EMPTY_VALUE);
   SetIndexBuffer(1, buf38);
   SetIndexStyle (1, DRAW_LINE, STYLE_DOT);
   SetIndexEmptyValue(1, EMPTY_VALUE);
   SetIndexBuffer(2, buf62);
   SetIndexStyle (2, DRAW_LINE, STYLE_DOT);
   SetIndexEmptyValue(2, EMPTY_VALUE);
   SetIndexBuffer(3, buf76);
   SetIndexStyle (3, DRAW_LINE, STYLE_DOT);
   SetIndexEmptyValue(3, EMPTY_VALUE);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
  void start()
  {
   double dMax, dMin;
   int    loopbegin, nsb, prevDay, shift;
//----
   if (NumberOfBars==0) loopbegin=Bars - 1;
   else loopbegin=NumberOfBars - 1;
     for(shift=loopbegin; shift>=0; shift--)
     {
        if (prevDay!=TimeDay(Time[shift]))
        {
         nsb=iBarShift(NULL, PERIOD_D1, Time[shift]);
         dMax=iHigh(NULL, PERIOD_D1, nsb);
         dMin=iLow (NULL, PERIOD_D1, nsb);
        }
      buf24[shift]=dMin-(dMin-dMax)*0.236;
      buf38[shift]=dMin-(dMin-dMax)*0.382;
      buf62[shift]=dMin-(dMin-dMax)*0.618;
      buf76[shift]=dMin-(dMin-dMax)*0.764;
      prevDay=TimeDay(Time[shift]);
     }
  }
//+------------------------------------------------------------------+

""
还没有人打赏,支持一下

评论|共 5 个

大锤

发表于 2023-8-10 16:00:20 | 显示全部楼层

这个挺实在的  直接复制就好。。。但是和我直接在图标上画有啥区别啊?大哥

QWE147

发表于 2023-8-11 08:16:06 | 显示全部楼层

区别就是不用画啊,就想K线剩余时间一样,还有点差也一样,都可以自己看和算,要的就是一目而已,也没什么的

QWE147

发表于 2023-8-11 08:19:40 | 显示全部楼层

看这个
24c99f91f218add17d4442906085f23.png

安疯子

发表于 2023-12-13 11:55:23 | 显示全部楼层

谢谢

田海

发表于 2024-4-20 14:30:54 | 显示全部楼层

您需要登录后才可以回帖 登录 | 注册 微信登录

EA之家评论守则