最新公告
  • 欢迎您光临九毛八公式指标网www.9m8.cn,本站全新改版试运行,期间内容全部免费,欢迎下载!欢迎加入本站VIP
  • 根据上下影线画出矩形的指标i源码[MT4公式]

    正文概述    2024-04-14 11:10:02  

    //+------------------------------------------------------------------+
    //| 画图.mq4 |
    //| LIU SONG |
    //| www.gszb.com qq:262069696 |
    //+------------------------------------------------------------------+
    #property copyright LIU SONG
    #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);
    }


    void DrawSpiral(){
    for (int i = NumberOfDays; i 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 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 i--) {
    ObjectDelete( aaa +i);
    ObjectDelete( zhi +i);

    }

    return(0);

    }


    参数可以设置画矩形数量 颜色 以及时间周期 默认0 即为当前周期画矩形 右边的数值为设定周期内 的一根k线的波动值


    根据上下影线画出矩形的指标i源码[MT4公式]

    九毛八公式指标,一个优质的公式指标平台!
    九毛八公式指标 » 根据上下影线画出矩形的指标i源码[MT4公式] 加入收藏