Super Easy Question...

 

Real Quick Question... what is the script for an END function in MQL? Here's what I'm trying to do:





If(TotalOrders() == 12 && TotalProfit() >= TargetProfit) {what do I put here so that it won't continue processing the rest of the script?}

Computehistoricals();

EstimateNxtTarget();


Thanks!

 

Hi Phy,


Sorry for the confusion, but teh script above is already within a function. If I placed return then it would only end the function and not the entire script. (Pls correct me if I am wrong..) What should I do in that case?

Thanks again!

 

There is no exit function in MQL4. You need to return a specific value from the function (usually -1 for errors) and if in start() you detect that the function returned -1, just use "return()" in the start() function and execution will stop there.

.

Jon

 
Archael:

There is no exit function in MQL4. You need to return a specific value from the function (usually -1 for errors) and if in start() you detect that the function returned -1, just use "return()" in the start() function and execution will stop there.

.

Jon

I see.. thanks for your help! =)

 

"There is no exit function in MQL4"

divide by zero works pretty well.

 
Haha! Ingenius ;) But that would keep spamming your journal lol
 

I delete the logs regularly, no problem.

Reason: