Help with EA!

 

Hello, I have this EA that somebody was kind enough to put together but the only problem i have with it is that I can't shut it down without it having to reset. In other words, I am in a trade and, let say, my computer crashes. Now I bring up my charts and my EA starts all over again and now I have 2 trades going. Unfortunately the coder doesn't know how to rectify the problem and I'm here to see if anybody can help. Attached is the EA.

Thanks

Files:
 
criss73:
Hello, I have this EA that somebody was kind enough to put together but the only problem i have with it is that I can't shut it down without it having to reset. In other words, I am in a trade and, let say, my computer crashes. Now I bring up my charts and my EA starts all over again and now I have 2 trades going. Unfortunately the coder doesn't know how to rectify the problem and I'm here to see if anybody can help. Attached is the EA. Thanks

There's nothing you can do. Maybe someone has an idea. But I don't think you can do something.

 

hey, Dan. I'm trying! There's got to be a way!

 
criss73:
hey, Dan. I'm trying! There's got to be a way!

OK, I'll bite. First, could you tell me exactly what you are trying to do. I mean, this code would appear to just keep opening orders, there is no 'close orders' code...

 
omelette:
OK, I'll bite. First, could you tell me exactly what you are trying to do. I mean, this code would appear to just keep opening orders, there is no 'close orders' code...

Hello Omelette, the EA itself is working it is just when the chart closes, or the computer crash or a power outage, when I reopen the chart the EA resets and opens a new position. The previous position is open but no longer follows the EA. I hope I made myself clear and thank you!

 
Dan7974:
There's nothing you can do. Maybe someone has an idea. But I don't think you can do something.

Would you try this one ?

Files:
 

hey Michel, no it didn't work. When I shut down the platform then restarted the trade it starts all over. What i did is i let it double from .10 to .80 and then shut down the platform. I started up the platform and the EA started at .10. Thanks for the attempt though. Maybe what i'm not clear about is that after shut down then restart i want it to resume previous trade and NOT reset. It's the resetting that's the problem. If my trade doubled from .10 to 1.60 and my computer shuts down, i don't want to have to restart the EA at .10.

Michel:
Would you try this one ?
 

Excellent omelette, it works!!!!!! Thank you very much!

omelette:
Try this. As I develop stuff on the WHC platform, I had to change the ordersend code a bit also - WHC will not allow stops to be set with the order!
 

Hey Omelette, it's not quite working yet. What it will do is i'll shut the computer and then it'll start off from where it started and, again, shut the platform down and this time it reset. So it's getting there but it's tweaking. Also, sometimes, it'll open where it started and open an additional order. For example: it doubled from .10 to .40, i shut the platform down then reopen it. It resumes the .40 trade and opens another .40 trade.

 
criss73:
Hey Omelette, it's not quite working yet. What it will do is i'll shut the computer and then it'll start off from where it started and, again, shut the platform down and this time it reset. So it's getting there but it's tweaking. Also, sometimes, it'll open where it started and open an additional order. For example: it doubled from .10 to .40, i shut the platform down then reopen it. It resumes the .40 trade and opens another .40 trade.

Pity. I did no real testing, just hoped it would work. The 'GATE' calculation is the problem methinks. I'll check it tomorrow

 
criss73:
Hello Omelette, the EA itself is working it is just when the chart closes, or the computer crash or a power outage, when I reopen the chart the EA resets and opens a new position. The previous position is open but no longer follows the EA. I hope I made myself clear and thank you!

Try this. As I develop stuff on the WHC platform, I had to change the ordersend code a bit also - WHC will not allow stops to be set with the order!

Files:
Reason: