Close trade using MA crossover
-
Hi, I would like to know how to close a trade using a simple ma cross over.
I tried many things without success.Please advise.
Thanks in advance.
-
I can see what you have now. No trade -> Condition -> Close trades. But if you don't have trades, then "No trade" does not pass and there is no way to reach "Close trades"

-
I wish to open a trade - once per bar - check condition ( ma cross )- open trade.
Apply SL of "x" pips
Apply Break even at "x" pips value
Apply Trailing stop of "x" pips every "x" pips.The above I manage to make easily, however....
To close the trade I wish to use "ma cross" - close trade.
Or another indicator say like MACD on a long trade, when showing bearish divergence - close trade.This I can't seem to do.
How do I do this please

I do not want to use static TP
-
Condition -> Close trades
This should be under "on Tick" of course. Also, blocks like "Once per bar" can be used... if needed. I think the idea is clear. The condition checks two values and when the result is true, "Close trades" will close the trades

-
Yes, I have done this however trades refuse to close

-
I wish to ask.
One simple buy-Sell EA I used from examples is running well on back test in MT4 on an offline Renko chart.
Then when i run it on a demo account it fails to execute 50% of the trades...
Is there something I am missing? -
I have no idea what you are missing. I need more details of the problem. There are many, many reasons for something to not work. I can't say what is going on exactly and where is the problem all the time.
-
I copied the buy-sell EA you have on fxDreema, the only thing I changed was the MA value, same value for both buy and Sell.
When I back test it it works perfectly.
When I run it on a demo account it skips 50% of the trades.
Is there some code that needs to be added to make it run properly on a "actual" ( live or demo) account please? -
No, there is no such code. What works on the tester should wotk live. But it depends, because the tester is a little bit different. Do you have error messages?