|
从这个模子里削出来
#property strict //frlin2003小明
#property indicator_chart_window
extern double 间距 ;
extern int 数量 = 20;
extern int 宽度 = 1;
double Oldxxx=0;
int start()
{
double Newxxx =WindowPriceMax();//MathCeil( double val // 数字 );//MathRound
间距=0.005;
if(StringFind(Symbol(),"JPY",3)==3) 间距=0.5;
if(StringFind(Symbol(),"XAU",0)==0) 间距=5;
if(Oldxxx==Newxxx){
return 0;
}
else{
ObjectsDeleteAll(0,"网格",-1,OBJ_HLINE);
for (int i = 0; i< 数量;i++) {
ObjectCreate("网格"+i,OBJ_HLINE,0,0,Newxxx-i*间距);
ObjectSet("网格"+i, OBJPROP_STYLE, 4);
ObjectSet("网格"+i, OBJPROP_WIDTH, 宽度);
ObjectSet("网格"+i, OBJPROP_COLOR, RoyalBlue);
}
Oldxxx=Newxxx;
}
return 0;
}
int deinit(){
ObjectsDeleteAll(0,"网格",-1,OBJ_HLINE);
return 0;
}
先沉思 |
|