adding a filter to existing EA

 

HI traders,

I have quite a good EA, but I think it would work even better when I add a filter to it.

Firstly, I will describe, how it works now: It is based on MA - when a candle crosses MA, it opens a trade by the beginning of the next candle (in the same direction as it crosse the candle). The closing condition is as follows: when the MA crosses candle in the opposite direction, or when it hits SL/TSL.

Now I would like to suggest a possible change to it: There would be one more condition. We open a trade only when the candle crosses MA - and at the same time both the candle and the MA must be rising(and vise versa). If the candle is going up, but the MA is still on decrease, we donť open a trade (and vise versa). We postpone a trade and execete it by the time the MA turns to the same direction as the candle. (It is not necessary to open a trade only when the MA crosses a candle...) We close the current trade at the same time we open a new one (bacically, we have one opened position all the time).

We expect, that the new vesion will have a great potential - we did a manual backtest, and the results were promising.

Could someone try to make a change to the code I am attaching?

Thank you very much in advance!

Martin

 
billy90:
Could someone try to make a change to the code I am attaching?
No Slaves here, learn to code or pay someone. We're not going to code it FOR you. We are willing to HELP you.
 
WHRoeder:
No Slaves here, learn to code or pay someone. We're not going to code it FOR you. We are willing to HELP you.

Ok, I didnt really expect someone to do it for me...but I would just like to have an opinion from more experienced programmers, if it is possible to do such change
 
billy90:

Could someone try to make a change to the code I am attaching?

Thank you very much in advance!

Martin

 
RaptorUK:


?

Ok, I tried it...Why not, after all? But I didnt believe to get it for free anyway...The thing is, that I am not sure, if it is possible to code such change...If you think you can do it, I am eagerly awaiting your offer!

 
billy90:


?

Ok, I tried it...Why not, after all? But I didnt believe to get it for free anyway...The thing is, that I am not sure, if it is possible to code such change...

Of course it's possible . . . although you do seem to contradict yourself a little . .

"We open a trade only when the candle crosses MA" . . . . "(It is not necessary to open a trade only when the MA crosses a candle...)"

Reason: