|
蜡烛图翻转指标说明
1.图形背景色见图示颜色(白底蓝红K)
2.同http://my.fx3q.com/thread-9243-1-1.html 结果相似,路数不同;
2.均线参数可调
3.K宽度为3像素
4.作用:未知
代码:
- #property indicator_separate_window
- #property indicator_buffers 3
- #property indicator_color1 White
- #property indicator_color2 White
- #property indicator_color3 Red
- double E1[];
- double E2[];
- double jx[];
- int init()
- {
- SetIndexBuffer(0,E1);
- SetIndexBuffer(1,E2);
- SetIndexBuffer(2,jx);
- SetIndexStyle(2,DRAW_LINE);//(0,DRAW_LINE,0,2,Red)
- SetIndexEmptyValue(0, 0.0);
- SetIndexEmptyValue(1, 0.0);
- IndicatorShortName("附图反k线");
- SetIndexLabel(0,NULL);
- SetIndexLabel(1,NULL);
- return(0);
- }
- int deinit()
- {
- for(int i=0;i<1000;i++){
- ObjectDelete("tlWickD1"+i);
- ObjectDelete("tlBodyD1"+i);
- }
- return(0);
- }
- int start()
- {
- int counted_bars=IndicatorCounted();
- double cp,op,hp,lp;
- int x=0;
- int BarCount=3000;
- color cl;
- double maxhp=0;
- for(int i=0;i<BarCount;i++)
- {
- cp = 1/iClose(NULL, 0, x);
- op = 1/iOpen(NULL, 0, x);
- hp = 1/iHigh(NULL, 0, x);
- lp = 1/iLow(NULL, 0, x);
- if (cp > op){
- cl = Red;//LimeGreen;
- }else if(cp < op){
- cl = Blue;//Silver; //Gainsboro
- }else{
- cl = Red;//LimeGreen;
- }
- DrawTl("tlWickD1"+x, Time[i], Time[i], lp, hp, cl, 1);
- DrawTl("tlBodyD1"+x, Time[i], Time[i], op, cp, cl, 3);
- if (hp>maxhp) maxhp=hp;
- E1[i] = 1/iLow(NULL, 0, x);
- E2[i] = 1/iHigh(NULL, 0, x);
- jx[i] = 1/iMA(NULL,0,60,0,0,0,x);
- x++;
- }
- return(0);
- }
- void DrawTl(string n, datetime from, datetime to, double p1, double p2,color c, int w)
- {
- if (ObjectFind(n) != WindowFind("附图反k线"))
- {
- ObjectCreate(n, OBJ_TREND, WindowFind("附图反k线"), from, p1, to , p2);
- }
- else
- {
- ObjectMove(n, 0, from, p1);
- ObjectMove(n, 1, to, p2);
- }
- ObjectSet(n, OBJPROP_WIDTH, w);
- ObjectSet(n, OBJPROP_RAY, false);
- ObjectSet(n, OBJPROP_COLOR, c);
- ObjectSet(n, OBJPROP_BACK, true);
- WindowRedraw();
- }
复制代码 |
-
-
附图反k线.zip
1.08 KB, 下载次数: 181, 下载积分: 金钱 -8
售价: 5 金钱 [记录]
评分
-
查看全部评分
|