Experts: Close Basket Pairs v1

 

Close Basket Pairs v1:

This MQL4 EA is designed to close positions for a basket of currency pairs based on certain profit and loss thresholds.

Close Basket Pairs v1

Author: Iulian Persinaru

 
Is this a script or an EA? The description seems to be using both terms interchangeably.
 
speedytina #:
Is this a script or an EA? The description seems to be using both terms interchangeably.

Based on the fact that

#property show_inputs

appears up top in the code, it's a script.

 
@Ryan L Johnson #: Based on the fact that ... appears up top in the code, it's a script.

Actually, not quite! It seems that the author has incorrectly mixed up a few concepts, making the code somewhat invalid. In fact, "show_inputs" is not even a valid property, but "script_show_inputs" is valid.

However, the most important aspects to make the program work, are the event handlers. In this case, there is no OnStart() event handler, so it will not run as a Script. Instead it will be treated as an Expert Advisor, because there are OnInit() and OnTick() event handlers.

 
Fernando Carreiro #:

Actually, not quite! It seems that the author has incorrectly mixed up a few concepts, making the code somewhat invalid. In fact, "show_inputs" is not even a valid property, but "script_show_inputs" is valid.

However, the most important aspects to make the program work, are the event handlers. In this case, there is no OnStart() event handler, so it will not run as a Script. Instead it will be treated as an Expert Advisor, because there are OnInit() and OnTick() event handlers.

Well, that certainly explains the "Published by: [Deleted]" status of the author.😐

 
Ryan L Johnson #:

Well, that certainly explains the "Published by: [Deleted]" status of the author.😐

Thank you, gentlemen. I don't know coding, but I was puzzled about the description switching between EA and script. The fact that the publisher was deleted also gave me pause. Was not a fan of having to list every pair in a basket along with whether or not it was a buy or sell. It makes for a lot of work and attention to detail if one trades a more sizable basket. I was hoping for a 'close all' EA.

Thanks again for your comments.