Need SL & TP added to EA

 

I have been playing around with the attached Moving Average EA with interesting results but would like to limit the losses. I wonder if one of the expert programmers would be so kind and add variable SL and while they are at it also variable TP?

Thanks in advance

Files:
 

Your check for Volume[0]>1 will not work because of the way tick data is processed.

 

Thanks ra300z for having a look at the EA, but because I don't know the lingo your comment does not mean anything to me. Could you expand a bit?

Regards

 
kaaskop:
Thanks ra300z for having a look at the EA, but because I don't know the lingo your comment does not mean anything to me. Could you expand a bit? Regards

Off the top of my head, I can't recall what the issue was. But this code is usually when someone wants to trade on a new open bar. If I recall, the code prevents execution all the time. But I don't remember why. It's better to use the time (hour) and compare to the hour of the previous bar (presuimg H1, H4)

PS any moving average EA won't work by itself. If you go with the moving average, you'll end up getting whipsawed. If you go against the moving average, you'll get squeezed.

 

The basic question about adding SL and TP to this EA has not been touched yet. So I repeat my request to our experts to see if one of you is able to add those things. Would have thought that it is fairly simple to do but that opinion is not based on any knowledge.

 

Have not done any test yet, jut hop in and do some modification. Hope this help and wish you like it! Good trading

Regards,

David

Files:
 

Thnaks David,

I am trying it out.

Regards

kaaskop

 

Back again,

Tried David's version but it does not trade life or in the strategy tester. Any modifications are welcome and will be tested by me.

Thanks

 
kaaskop:
Back again,

Tried David's version but it does not trade life or in the strategy tester. Any modifications are welcome and will be tested by me.

Thanks

What is the error messege on the Journal tab or the Expert tab, let me know so I dont need to waste time on troubleshoot. Good trading

Regards,

David

 

Hi David,

No error messages at all, just messages about being loaded ok and about the inputs.

Thank you for your interest.

 
kaaskop:
Hi David,

No error messages at all, just messages about being loaded ok and about the inputs.

Thank you for your interest.

130 invalid stops