📅 财经日历 📊 实时波动 📈 大盘云图 📶 行情走势 🆚 投机情绪 🚀 今日热点

    求助这个指标代码错误谁能帮忙看看

    700200 LV5
    2015-02-02 · 4503 阅读
    谁能帮忙改下这几个错误万分感谢!!!
    ""
    还没有人打赏,支持一下
    回复

    举报

     

    回答|共 9 个

    汇友之家 LV4

    发表于 2015-2-2 14:24:42 | 显示全部楼层

    //+------------------------------------------------------------------+
    //|                                                      signal .mq4 |
    //|                      Copyright ?2009, MetaQuotes Software Corp. |
    //|                                        http://www.metaquotes.net |
    //+------------------------------------------------------------------+
    #property copyright "Copyright ?2009, MetaQuotes Software Corp."
    #property link      "http://www.metaquotes.net"

    //---- indicator settings
    #property indicator_chart_window
    #property indicator_buffers 0
    #property indicator_minimum 0
    #property indicator_maximum 1



    //---- indicator parameters  


    extern int win = 0;
    extern int pricexoffset= 47 ;
    extern int priceyoffset= 30 ;


    extern int   myFontSize       = 14;


    extern string noteTimeNY = " 14:00 server time = 05:00 mst" ;
    extern string noteTimeAU = " 23:00 server time = 14:00 mst" ;
    extern string noteTimeLD = " 09:00 server time = 00:00 mst" ;


    extern string myHHMM       = "13:00"; // 05:00 am pst = 14:00 server time
    extern string myMessage    = "NY" ;


    extern string Buy_Message  = "BUY SIGNAL" ;
    extern string Wait_Message = "WAIT FOR SIGNAL" ;
    extern string Sell_Message = "SELL SIGNAL" ;
    extern string Rdy_Message  = "READY TO ENTER" ;

    extern color Buy_color = Lime;
    extern color Wait_color = Yellow;
    extern color Sell_color = Red;
    extern color Rdy_color = Aqua;

    //---- indicator buffers



    //---- buffers


    string tMessage , oldmsg = "" ;
    //+--------- TRO MODIFICATION ---------------------------------------+
    string symbol, tChartPeriod,  tShortName ;  
    int    digits, period  ;

    datetime Trigger ;

    int OldBars = -1 ;

    color tColor = Yellow ;


    color ClOpColor;

    double H1_open, H1_close, open, close, diff, spread, DailyOpen ;
      
    //+------------------------------------------------------------------+
    int init()
      {
       period       = Period() ;     
    //   tChartPeriod =  TimeFrameToString(period) ;
       symbol       =  Symbol() ;
       digits       =  Digits ;   

       tShortName = "tw"+ symbol + tChartPeriod  ;

       return(0);
      }

    int deinit()
    {

       
       ObjectDelete("TRAIN30");
       ObjectDelete("TRAIN29");
       ObjectDelete("TRAIN29B");
       ObjectDelete("TRAIN31");
       ObjectDelete("TRAIN32");
       ObjectDelete("TRAIN34");   
       
       ObjectDelete("TRAIN30");
       ObjectDelete("TRAIN29");
       ObjectDelete("TRAIN29B");
       ObjectDelete("TRAIN31");
       ObjectDelete("TRAIN32");
       ObjectDelete("TRAIN34");   
    }  

    //+------------------------------------------------------------------+
    int start()
      {
       
    DoDailyOpen() ;   
       
    //   open     = iOpen(symbol,PERIOD_D1,0);
       close    = Close[0];   
       open     = Open[0];
       
       H1_open  = iOpen(symbol,PERIOD_H1,0);
    //   H1_close = iClose(symbol,PERIOD_H1,0);  

    while(true)
    {

    if( close > open && close > DailyOpen && close > H1_open ) { tMessage = Buy_Message  ; ClOpColor = Buy_color  ; break ; }

    if( close < open && close < DailyOpen && close < H1_open ) { tMessage = Sell_Message ; ClOpColor = Sell_color ; break ; }

    tMessage = Wait_Message ; ClOpColor = Wait_color ;

    break;

    } // while


    oldmsg =  tMessage ;

    //+------------------------------------------------------------------+  
                        
       ObjectCreate("TRAIN31", OBJ_LABEL, win, 0, 0);//HiLow LABEL
       ObjectSetText("TRAIN31",tMessage, myFontSize , "Segoe Print", ClOpColor );
       ObjectSet("TRAIN31", OBJPROP_CORNER, 0);
       ObjectSet("TRAIN31", OBJPROP_XDISTANCE, pricexoffset);
       ObjectSet("TRAIN31", OBJPROP_YDISTANCE, priceyoffset);


    string note2 = "Default Font Color";
    color  twFontColor              = DimGray;
    string note3                  = "Font Size";
    int twFontSize                  = 8;
    string note4                  = "Font Type";
    string twFontType               = "Verdana"; // Tahoma Courier
    string RAN953 =  ""  ;   
    string tObjName03 = "TROTW"  ;
       
       ObjectCreate(tObjName03, OBJ_LABEL, 0, 0, 0);//HiLow LABEL
       ObjectSetText(tObjName03, RAN953 , twFontSize ,  twFontType,  twFontColor );
       ObjectSet(tObjName03, OBJPROP_CORNER, 3);
       ObjectSet(tObjName03, OBJPROP_XDISTANCE,  5 );
       ObjectSet(tObjName03, OBJPROP_YDISTANCE, 10);
    //+------------------------------------------------------------------+        

       WindowRedraw();   
       
       return(0);
    }

    //+------------------------------------------------------------------+

    void DoDailyOpen()
    {

    int   yy = TimeYear(Time[0]);
    int   mm = TimeMonth(Time[0]);
    int   dd = TimeDay(Time[0]);  
       
    string yymmddms = yy+"."+mm+"."+dd+" " + myHHMM ;
             
    datetime var1 = StrToTime(yymmddms);  
       
    datetime day=24*60*60;
    datetime r= var1 ;

    int      cd=iBarShift(NULL,0,r,FALSE);
    datetime r2=r-day;

    if(TimeDayOfWeek(r2)==0) r2=r2-day-day;
    int cd2=iBarShift(NULL,0,r2,FALSE);

    if( var1 > Time[0] ) { r = r2 ;cd = cd2 ;} // if date/time is greater than current date/time go back 1 day

    DailyOpen = Open[cd] ;

    }


    //+------------------------------------------------------------------+

    /*


    Comment(


    "DailyOpen " , DoubleToStr(DailyOpen,Digits) , "\n" ,


    "") ;


    */



    你看看是不是

    asisqrsa LV3

    发表于 2015-2-2 01:08:53 | 显示全部楼层

    找版主

    ing1024 LV3

    发表于 2015-2-2 02:02:04 | 显示全部楼层

    看看怎么样

    sun001002003 LV17

    发表于 2015-2-2 04:14:43 | 显示全部楼层

    用老版编辑器试试

    小雨 LV4

    发表于 2015-2-2 08:45:17 | 显示全部楼层

    我靠

    metallica0005 LV3

    发表于 2015-2-2 11:14:17 | 显示全部楼层

    顶楼主~~~~~~~~~~~~~~~

    121352560 LV1

    发表于 2015-2-2 11:14:29 | 显示全部楼层


    研究研究

    3dyddm LV4

    发表于 2015-2-2 14:18:51 | 显示全部楼层

    [s:132]

    700200 LV5

    发表于 2015-2-2 16:18:36 | 显示全部楼层

    汇友之家 发表于 2015-2-2 14:24
    //+------------------------------------------------------------------+
    //|                          ...

    测试了  警告    not all control paths return a value        你.mq4        101        1
    您需要登录后才可以回帖 登录 | 注册

    提醒: 禁止引战、谩骂、灌水内容

    微信二维码

    有问题联系客服