700200 发表于 2015-2-2 01:03:03

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

谁能帮忙改下这几个错误万分感谢!!!

汇友之家 发表于 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;   
   open   = Open;
   
   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";
colortwFontColor            = 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);
int   mm = TimeMonth(Time);
int   dd = TimeDay(Time);
   
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 ) { r = r2 ;cd = cd2 ;} // if date/time is greater than current date/time go back 1 day

DailyOpen = Open ;

}


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

/*


Comment(


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


"") ;


*/



你看看是不是

asisqrsa 发表于 2015-2-2 01:08:53

找版主

ing1024 发表于 2015-2-2 02:02:04

看看怎么样

sun001002003 发表于 2015-2-2 04:14:43

用老版编辑器试试

小雨 发表于 2015-2-2 08:45:17

我靠

metallica0005 发表于 2015-2-2 11:14:17

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

121352560 发表于 2015-2-2 11:14:29


研究研究

3dyddm 发表于 2015-2-2 14:18:51

700200 发表于 2015-2-2 16:18:36

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

测试了警告    not all control paths return a value        你.mq4        101        1
页: [1]
查看完整版本: 求助这个指标代码错误谁能帮忙看看