How to locked EA

 
Hei any one find find why this code doesn't work ? Must be something wrong //+------------------------------------------------------------------+
<removed by mod>
 
Suy Kok Yik:
I developed this EA but it doesn't function while i attached into the chart.
 

Hey,

a bit more structure and discipline in coding would really help ;) You should always use one line per command, not only sometimes. Futhermore use { } braces in any loops, it makes it much easier to read. 

Your question: You don´t have an return(INIT_FAILED) exit behind  

if(password_status==-1) Print("EA is not allowed to run on this account."); 

and you always return 0 in OnInit(). I didm´t compile it but this is the most obvious problem. Furhtermore, why do you check the password status in OnTick()? If you return INIT_FAILED in OnInit(), the OnTick() will never be called anyway.

Doerk 

 
Doerk:

Hey,

a bit more structure and discipline in coding would really help ;) You should always use one line per command, not only sometimes. Futhermore use { } braces in any loops, it makes it much easier to read. 

Your question: You don´t have an return(INIT_FAILED) exit behind  

if(password_status==-1) Print("EA is not allowed to run on this account."); 

and you always return 0 in OnInit(). I didm´t compile it but this is the most obvious problem. Furhtermore, why do you check the password status in OnTick()? If you return INIT_FAILED in OnInit(), the OnTick() will never be called anyway.

Doerk 

Dear Dorerk,

I m very appreciated finally somebody responded my help. This is my first EA I ever wrote.

Can you help me to incorporate this this EA (as attached) to make if work for me with the coding as above mentioned?

Pls send it back to me after you have corrected , therefore i can compared before and after.

This will be more easier to understand the errors i made.

Thanks and appreciated  in advance

Sky 

<decompiled code removed by mod>

 
Suy Kok Yik:

Dear Dorerk,

 This is my first EA I ever wrote.

Sky 

So the first thing you ever wrote is about locking it down?

why don't you first try to write something that actually works when it comes to trading?

 
Marco vd Heijden:

So the first thing you ever wrote is about locking it down?

why don't you first try to write something that actually works when it comes to trading?

I had an EA already made me a lot of money but i wish to lock it down and send to those friends who wants my EA.
 

 DO NOT POST DECOMPILED CODE IN THESE FORUMS!

Reason: