Need HELP with EA code!!

 
Could someone please help me with the code for the EA i have attached?

I have tried and tried to edit this code to change this without any success. Basically I want to have the EA open only one order at a time in the same direction. However, I also would like it the EA to open another order in the opposite direction, basically hedging the other order if it starts to go against me, while leaving the 1st order open.

To be more specific:

The EA will enter a buy/sell trade based on certain conditions. Once The initial trade is entered, it sometimes may take three to five days before it finally closes out at takeprofit. In the meantime, during that three to five day period, there may be several trade opportunities in the opposite direction. I want the EA to take advantage of those opportunities while leaving the original trade open because it will eventually close out in profit. These additional trade opportunities in the opposite direction of the original trade will technically be a hedge against the original trade, even though they will eventually also close out at a takeprofit value. To be clear though, I still only want the EA to only have one trade open in the same direction. So, the max trades open at the same time would be one buy and one sell.

If someone wouldn't mind, could you please look at the pertinent code in the EA and let me know what I need to add or change so that the EA would execute a new trade in the opposite direction of the already open trade?

Thanks in advance for your time and help.
 
waaustin:
Could someone please help me with the code for the EA i have attached?

I have tried and tried to edit this code to change this without any success. Basically I want to have the EA open only one order at a time in the same direction. However, I also would like it the EA to open another order in the opposite direction, basically hedging the other order if it starts to go against me, while leaving the 1st order open.

To be more specific:

The EA will enter a buy/sell trade based on certain conditions. Once The initial trade is entered, it sometimes may take three to five days before it finally closes out at takeprofit. In the meantime, during that three to five day period, there may be several trade opportunities in the opposite direction. I want the EA to take advantage of those opportunities while leaving the original trade open because it will eventually close out in profit. These additional trade opportunities in the opposite direction of the original trade will technically be a hedge against the original trade, even though they will eventually also close out at a takeprofit value. To be clear though, I still only want the EA to only have one trade open in the same direction. So, the max trades open at the same time would be one buy and one sell.

If someone wouldn't mind, could you please look at the pertinent code in the EA and let me know what I need to add or change so that the EA would execute a new trade in the opposite direction of the already open trade?

Thanks in advance for your time and help.
NEVER MIND. I RESOLVED THE ISSUE!!
 
Where is the code?
 
cyberpasta:
Where is the code?

The issue has been resolved.