adding a magic number to an EA

 

could someone add a magic number code to the 20/200 ea for me. I have a modified version I did but I am unsure how to add the magic number script to it. I can get it working on different currencies other then the E/U but when running 2 copies of the ea on the same MT4 they cancel each other and won't work. here is the link to the EA I would modified.

https://www.mql5.com/en/code/7891 

 
Since there are no slaves here, there are only two choices: learn to code or pay someone. We're not going to code it FOR you. We are willing to HELP you when you post your attempt and the nature of your problem.
 
WHRoeder:
Since there are no slaves here, there are only two choices: learn to code or pay someone. We're not going to code it FOR you. We are willing to HELP you when you post your attempt and the nature of your problem.

Well here is the modified copy I did with the magic number. And Yes I would be willing to do both options learn and pay even if someone said they would do it for X$ if it was what I thought reasonable I would pay them via paypal. With regards to coding it I have noticed that there are different ways to code the EA's which is what is confusing me right now I am a newbie to the mql language so I am trying to get my feet wet a little bit with looking at others work and using snipets from one and inserting it into another
 
jjafo007:

Well here is the modified copy I did with the magic number. And Yes I would be willing to do both options learn and pay even if someone said they would do it for X$ if it was what I thought reasonable I would pay them via paypal. With regards to coding it I have noticed that there are different ways to code the EA's which is what is confusing me right now I am a newbie to the mql language so I am trying to get my feet wet a little bit with looking at others work and using snipets from one and inserting it into another

In the code that follows this line  . . .

// block of a trade validity time checking, if MaxOpenTime=0, do not check.

 you need to check if the order you have selected matches your Magic number,  if not you shouldnt close it as it doesn't belong to the EA . . . you also need to adjust the loop to count down . . .  see this:  Loops and Closing or Deleting Orders

 
If you declare a variable with global scope you shouldn't declare the same variable with local scope . . .  extern int    is a integer with global scope . . .  you don't need the local declarations of the same variable.
Reason: