|
- #property indicator_chart_window
- extern double 间距 = 30;
- extern bool 方向=false;
- extern int 数量 = 50;
- //extern double xxx =WindowPriceMax();
- extern int 宽度 = 1;
- int deinit() {
- Delete();
- return (0);
- }
- int start()
- {
-
- if(!方向){
- for (int i = 0; i< 数量;i++) {//当前指标不适合日系,金系。适合镑系,欧系,奥西,钮系,加息,瑞系。
- double xxx =WindowPriceMax(); //20170519修改。无意间看到一个窗口最大价格函数。紧急对此指标进行修改。
-
- ObjectCreate("网格"+i,OBJ_HLINE,0,0,xxx);//OBJ_HLINE
- ObjectCreate("网格"+2,OBJ_HLINE,0,0,xxx-0.003);//OBJ_HLINE
- ObjectCreate("网格"+3,OBJ_HLINE,0,0,xxx-0.006);//OBJ_HLINE
- ObjectCreate("网格"+4,OBJ_HLINE,0,0,xxx-0.009);//OBJ_HLINE
- ObjectCreate("网格"+5,OBJ_HLINE,0,0,xxx-0.012);//OBJ_HLINE
- ObjectCreate("网格"+6,OBJ_HLINE,0,0,xxx-0.015);//OBJ_HLINE
- ObjectCreate("网格"+7,OBJ_HLINE,0,0,xxx-0.018);//OBJ_HLINE
- ObjectCreate("网格"+8,OBJ_HLINE,0,0,xxx-0.021);//OBJ_HLINE
- ObjectCreate("网格"+9,OBJ_HLINE,0,0,xxx-0.024);//OBJ_HLINE
- ObjectCreate("网格"+10,OBJ_HLINE,0,0,xxx-0.027);//OBJ_HLINE
- ObjectCreate("网格"+11,OBJ_HLINE,0,0,xxx-0.030);//OBJ_HLINE
- ObjectCreate("网格"+12,OBJ_HLINE,0,0,xxx-0.033);//OBJ_HLINE
- ObjectCreate("网格"+13,OBJ_HLINE,0,0,xxx-0.036);//OBJ_HLINE
- ObjectCreate("网格"+14,OBJ_HLINE,0,0,xxx-0.039);//OBJ_HLINE
- ObjectCreate("网格"+15,OBJ_HLINE,0,0,xxx-0.042);//OBJ_HLINE
- ObjectSet("网格"+i, OBJPROP_STYLE, 4);
- ObjectSet("网格"+i, OBJPROP_WIDTH, 宽度);
- ObjectSet("网格"+i, OBJPROP_COLOR, RoyalBlue);
- }
- }
- return(0);
- }
- //+------------------------------------------------------------------+
- void Delete(){
- for (int i = 0; i< 数量;i++) {
- ObjectDelete("网格"+i);
- }
- return (0);
-
- }
复制代码
来源: 自动画固定幅度网格指标临时兴起修改 |
|