|
哥基本上搞定了,只是有点不踏实。法克。
- #property strict //frlin2003大爷
- #property indicator_chart_window
- extern int 数量 = 20;
- extern int 宽度 = 1;
- double 间距;
- int OnInit()
- {
- return(INIT_SUCCEEDED);
- }
- int OnCalculate(const int rates_total,
- const int prev_calculated,
- const datetime &time[],
- const double &open[],
- const double &high[],
- const double &low[],
- const double &close[],
- const long &tick_volume[],
- const long &volume[],
- const int &spread[])
- {
-
- 间距=0.003;
- if(StringFind(Symbol(),"JPY",3)==3) 间距=0.3;
- if(StringFind(Symbol(),"XAU",0)==0) 间距=3;
- double xxx =WindowPriceMax();
- for (int i = 0; i< 数量;i++) {
- ObjectCreate("网格"+i,OBJ_HLINE,0,0,xxx-i*间距);
- ObjectSet("网格"+i, OBJPROP_STYLE, 4);
- ObjectSet("网格"+i, OBJPROP_WIDTH, 宽度);
- ObjectSet("网格"+i, OBJPROP_COLOR, RoyalBlue);
- }
- return(rates_total);
- }
复制代码 |
|