Universal MA Cross EA - page 109

 
my2cents:
Hello everyone,

first of all, thanks to everybody who put this awesome ea together.

I read the complete thread over the past few days and did a ton of backtesting and tried to elaborate some useful settings for my favorite trading pairs.........

So far,

Markus

Hi

Can you share your settings of your back testing.

Thanks

Smartconnect

 

I stop to test this EA cause I found a promising one for basket trading and that is more what I want.

 
smartconnect:
Hi mladen

I trade all currency pairs with this EA with multiple orders in same pair. All my exits are either by Break Even or Trailing Stop. I use 'MinCrossDistance=10' and 'MaxLookUp=5' and 'MaxOpenTrade=6'. With these settings I get a new order opened at the start of the next 5 candles after the cross if the gap between the EMAs is more than 10. Can you help me to get this corrected with one order per cross.

smartconnect

Hi mladen

I would appreciate if you can make necessary changes in the EA to ensure one order per EMA cross. Looking forward to your response.

smartconnect

 
smartconnect:
Hi mladen

I would appreciate if you can make necessary changes in the EA to ensure one order per EMA cross. Looking forward to your response.

smartconnect

smartconnect

It is not possible to check which cross cause an order to be opened (the only field that can be used for that - the comment field - can be changed by the broker and we can not find out which cross caused one particular order to open - just imagine flat market when multiple crosses happen one after the other in a few bars distance)

 

Hi mladen

Thanks for your quick reply. Perhaps I have not explained correctly about my requirement.

"I use 'MinCrossDistance=10' and 'MaxLookUp=5' and 'MaxOpenTrade=6'. With these settings I get a new order opened at the start of the next 5 candles after the cross if the gap between the EMAs is more than 10."

As you can see the picture I posted, after the cross had taken place the gap in between the EMAs is >10 points the EA opens a trade. Some times even after the cross the gap remains >10 points. So the EA looks up for the 10 points gap in the subsequent candles. Max up to 5 candles.

There two possibilities; a) the EA finds the 10 points gap with in the next 5 candles and the order is opened. b) the EA doesn't find the gap with in the next 5 candles and no order is executed for that cross.

The issue here is that the EA finds the gap in the 1st or 2nd candle and order gets opened at the opening of the 3rd candle. The gap continue to remain > 10 points during the 4th & 5th candles as well. The EA continues with the condition and opens two more orders at the opening of the 4th & 5th candles. The EA doesn't know the order has already been opened.

If we keep the 'MaxLookUp=10' you can see more than 4 or 5 orders gets opened on fulfillment of the 10 points gap between the EMAs. You can observe this on back testing.

What is required : The EA should not add any more orders after execution of the first order on the Gap condition after the cross.

Hope I have clarified my request. Please help me out on this.

Regards

Smartconnect

 
smartconnect:
Hi mladen

Thanks for your quick reply. Perhaps I have not explained correctly about my requirement.

"I use 'MinCrossDistance=10' and 'MaxLookUp=5' and 'MaxOpenTrade=6'. With these settings I get a new order opened at the start of the next 5 candles after the cross if the gap between the EMAs is more than 10."

As you can see the picture I posted, after the cross had taken place the gap in between the EMAs is >10 points the EA opens a trade. Some times even after the cross the gap remains >10 points. So the EA looks up for the 10 points gap in the subsequent candles. Max up to 5 candles.

There two possibilities; a) the EA finds the 10 points gap with in the next 5 candles and the order is opened. b) the EA doesn't find the gap with in the next 5 candles and no order is executed for that cross.

The issue here is that the EA finds the gap in the 1st or 2nd candle and order gets opened at the opening of the 3rd candle. The gap continue to remain > 10 points during the 4th & 5th candles as well. The EA continues with the condition and opens two more orders at the opening of the 4th & 5th candles. The EA doesn't know the order has already been opened.

If we keep the 'MaxLookUp=10' you can see more than 4 or 5 orders gets opened on fulfillment of the 10 points gap between the EMAs. You can observe this on back testing.

What is required : The EA should not add any more orders after execution of the first order on the Gap condition after the cross.

Hope I have clarified my request. Please help me out on this.

Regards

Smartconnect

smartconnect

I do understand that.

Imagine this : an order is opened 5 bars from the cross. New bar opens. Again there should be opened a new order but now 6 bars from the cross. How can an EA "know" that the previous order was opened on that same cross (since we can not write it down in the order fields somewhere - as I said, broker can change the comment field)?

What could be a solution is to allow only opening an order in the opposite direction of the last opened order (if the last order is buy it can open only sell or if the last opened order is sell then a new one can only be buy)

 
mladen:
smartconnect

I do understand that.

Imagine this : an order is opened 5 bars from the cross. New bar opens. Again there should be opened a new order but now 6 bars from the cross. How can an EA "know" that the previous order was opened on that same cross (since we can not write it down in the order fields somewhere - as I said, broker can change the comment field)?

What could be a solution is to allow only opening an order in the opposite direction of the last opened order (if the last order is buy it can open only sell or if the last opened order is sell then a new one can only be buy)

Hi mladen

I understand the difficulty involved on this. Thank you for responding quickly.

smartconnect

 

Thanks CodersGuru

 

Updated Universal MA cross EA made to be new metatrader 4 compatible : universalmacrossea_nmc.mq4

Originally it was posted here : https://www.mql5.com/en/forum/general

 

Hours channel from this post https://www.mql5.com/en/forum/general adjusted to avoid compiler warnings : moving_average_nmc.mq4

________________

PS: not changing the names of the indicators in this thread in order to keep them usable the same way as they were used before

Files:
Reason: