首页 > > 详细

代做公式选股、MT4策略公式调试、代做公式选股、根据上下影线画出矩形的指标i源码



源码:
//+------------------------------------------------------------------+
//| 画图.mq4 |
//|LIUSONG |
//| qq:|
//+------------------------------------------------------------------+
#property copyright "LIUSONG"
#property link"qq:569638390"
#property indicator_chart_window
extern int NumberOfDays = 30;
extern color Color_1 = Wheat;
extern color Color_2 = MediumSlateBlue;
extern int shijian=0;
void deinit() {
DeleteObjects();
return(0);
}
int start()
{
DrawSpiral();


hua();
return(0);
}
voidDrawSpiral(){
for (int i = NumberOfDays;
i>=1;
i--) {
ObjectCreate("aaa"+i,OBJ_RECTANGLE, 0,0,0,0);
ObjectSet("aaa"+i, OBJPROP_TIME1 , iTime(Symbol(),shijian,i));
ObjectSet("aaa"+i, OBJPROP_PRICE1, iHigh(Symbol(),shijian,i));
ObjectSet("aaa"+i, OBJPROP_TIME2 , iTime(Symbol(),shijian,i-1));
ObjectSet("aaa"+i, OBJPROP_PRICE2, iLow(Symbol(),shijian,i));
if(i%2==0)color Color=Color_1;
else Color=Color_2;
ObjectSet("aaa"+i, OBJPROP_COLOR , Color);
}
return(0);
}
void hua(){
for (int i = NumberOfDays;
i>=0;
i--) {
ObjectCreate ("zhi"+i,OBJ_LABEL, 0,0,0);
ObjectSetText("zhi"+i, i+":"+ DoubleToStr((iHigh(Symbol(),shijian,i)-iLow(Symbol(),shijian,i)),4) ,10,"Comic Sans MS", Gold);
ObjectSet("zhi"+i, OBJPROP_CORNER, 0);
ObjectSet("zhi"+i, OBJPROP_XDISTANCE, 10);
ObjectSet("zhi"+i, OBJPROP_YDISTANCE, 12*i);
}
return(0);
}
void DeleteObjects(){
for (int i = NumberOfDays;
i>=0;
i--) {
ObjectDelete("aaa"+i);
ObjectDelete("zhi"+i);
}
return(0);
}

联系我们 - QQ: 88652583
© 2014 www.93stock.com
代写选股公式网!
声明:警惕假冒分子冒充本站提供证券咨询服务,选股公式网为非证券咨询机构,本站不提供有关股评、投资分析报告、股市预测,证券咨询等服务。本站仅提供股票、期货、黄金、外汇的软件技术交流与分享。本站文章为互联网文章,其仅供参考,并不构成投资建议。