Experts: EMA 6.12

 

EMA 6.12:

The Expert Advisor uses the signals of "crossover of two iMAs (Moving Average, MA)". The EA uses Trailing Stop and Take Profit.

EMA 6.12 EURUSD H1

Author: Vladimir Karputov

 
That's good....i have tried this EA...please give a logic explanation of your EA like tutorial...;)
 

anyone ever use this ea?

if yes please provide mql5 link signal.


to the author, thanks for sharing this ea.

but if you want to share some ea, 

it is very useful, if you also attach 

the mql5 link at least 3-6months.


so we all know.


thank you very much

 

I need the trades to open on the bar the follows the MA cross so I've messing around with chatgpt. Most of its code is riddled with errors and it doesn't really know mql5 but here's what it had to say.. 

Is this viable or could this be achieved in a different way? Your code is really nice and I would be so grateful if you could add that function along with being able to choose the type of moving average

I can post the code it spat out if you are interested. 


To open trades on the bar that follows the MA cross, you need to check the MA values at the close of the current bar and compare them with the MA values at the close of the previous bar. If the fast MA crosses above the slow MA at the close of the current bar and it was below the slow MA at the close of the previous bar, you can open a long trade. If the fast MA crosses below the slow MA at the close of the current bar and it was above the slow MA at the close of the previous bar, you can open a short trade.

Here is an example of how you can modify the OnTick() function to achieve this:

In this modified code, we first check for the MA cross using the same logic as before. If the MA cross is detected, we open a long or short trade based on the direction of the cross, but we use the current ask or bid price to open the trade, depending on the direction of the cross. This ensures that the trade is opened on the next bar after the cross, as requested. We also use the m_position.Modify() function to set the stop loss, take profit, trailing stop, and trailing step for the newly opened trade.


Reason: