No Idea to solve 2 warning sign

To add comments, please log in or register
Melvin Tan
331
Melvin Tan  

Hello guys,

I cant figure out...

After i compiler my coding, it works accordingly but there is 2 warning sign showed and i cant find out what is the problem with it.

Hope expert out there can help me out with this problem 


if(wt!=Time[0])
 {
  if(TotalOrder(0)<Max_order && TotalOrder(1)==0 && Trade_buy  && signal==1 ) {tiket = OrderSend(Symbol(),OP_BUY,NR(Lots),Ask,3,slb, tpb,Name_EA,Magic,0,Blue);}
  if(TotalOrder(0)==0 && TotalOrder(1)<Max_order && Trade_sell && signal==2 ) {tiket = OrderSend(Symbol(),OP_SELL,NR(Lots),Bid,3,sls, tps,Name_EA,Magic,0,Red);}
  if(tiket>0) wt=Time[0];
  }


Image


Colored box represent each warning sign

Lakshan Perera
9829
Lakshan Perera  

Please do not double post,

initialize the variable signal, something like below

int signal=-1; // no signal

change the data type of variable wt to datetime.

refer this article https://www.mql5.com/en/articles/1391

Common Errors in MQL4 Programs and How to Avoid Them
Common Errors in MQL4 Programs and How to Avoid Them
  • www.mql5.com
Some older programs can return errors in the new version of the MQL4 of compiler. To avoid critical completion of programs, the previous version compiler handled many errors in the runtime environment. For example, division by zero or array out of range are critical errors and usually lead to application crash. Such errors occur only in some...
Melvin Tan
331
Melvin Tan  
Thank you @Lakshan Perera,

I not sure why there is double post when I click Post... 

Thank you again :) 
Melvin Tan
331
Melvin Tan  

After some changes, I have an error (!= unexpected token)

I refer to the https://www.mql5.com/en/articles/1391 [1.1] 

But is seem even worst if i change it from

if(datetime!=Time[0])

TO

if(datetime1[] =Time[0])


image

Common Errors in MQL4 Programs and How to Avoid Them
Common Errors in MQL4 Programs and How to Avoid Them
  • www.mql5.com
Some older programs can return errors in the new version of the MQL4 of compiler. To avoid critical completion of programs, the previous version compiler handled many errors in the runtime environment. For example, division by zero or array out of range are critical errors and usually lead to application crash. Such errors occur only in some...
Melvin Tan
331
Melvin Tan  

Solve


Problem Solve, Thank you

Lakshan Perera
9829
Lakshan Perera  
Melvin Tan:

After some changes, I have an error (!= unexpected token)

I refer to the https://www.mql5.com/en/articles/1391 [1.1] 

But is seem even worst if i change it from

if(datetime!=Time[0])

TO

if(datetime1[] =Time[0])



this is wrong, what I said was replace the current data type of "wt" variable with datetime data type.

To add comments, please log in or register