黄金分割画线
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))
{
nsb=iBarShift(NULL, PERIOD_D1, Time);
dMax=iHigh(NULL, PERIOD_D1, nsb);
dMin=iLow (NULL, PERIOD_D1, nsb);
}
buf24=dMin-(dMin-dMax)*0.236;
buf38=dMin-(dMin-dMax)*0.382;
buf62=dMin-(dMin-dMax)*0.618;
buf76=dMin-(dMin-dMax)*0.764;
prevDay=TimeDay(Time);
}
}
//+------------------------------------------------------------------+
这个挺实在的直接复制就好。。。但是和我直接在图标上画有啥区别啊?大哥 区别就是不用画啊,就想K线剩余时间一样,还有点差也一样,都可以自己看和算,要的就是一目而已,也没什么的 看这个 谢谢 {:1_180:} 顶下
页:
[1]