Page 1 of 3

Two Moving Average Cross Expert Advisor

PostPosted: Sat Mar 04, 2017 7:32 am
by Apprentice
Expert Advisor Entry Rules:
- Go Long when Fast MA crosses above the Slow MA
- Go Short when Fast MA crosses below the Slow MA

Where:
- MA can be any of 17 different Moving Averaging methods
- Price Type, MA Method and MA Period for each MA can be changed

Notes:
- Two_MA_Cross_Indicator.mq4 required (installed in the Indicators folder)

EA Features:
- Distance of Price with Slow MA to approve Entry (if too far away, trade is not executed)
- More than 1 trade can be opened at once
- Minutes to Wait for Next Open Trade
- Stop Loss, Take Profit and Trailing Stop Loss options
- AutoLots or Manual
- Trade Both Sides or only one direction
- Comments Displayed on Screen
- Optional Email and Sound Alerts

For further development (if requested):
- Lookback feature: check the crossing event looking back at n number of bars - For this, only the default MT4 moving averages could be used.
Two_MA_Cross_Indicator.mq4
(24.06 KiB) Downloaded 2148 times

Two_MA_Cross_EA.mq4
(64.82 KiB) Downloaded 2086 times

Re: Two Moving Average Cross Expert Advisor

PostPosted: Sat Mar 04, 2017 9:12 am
by Ehab.Ali
thanks Apprentice

Re: Two Moving Average Cross Expert Advisor

PostPosted: Sat Mar 04, 2017 6:20 pm
by Ehab.Ali
i found a problem while testing it

trailing stop working with buy orders only not working with sell
can you pls fix it

Re: Two Moving Average Cross Expert Advisor

PostPosted: Mon Mar 06, 2017 5:02 am
by Apprentice
Fixed.

Re: Two Moving Average Cross Expert Advisor

PostPosted: Mon Mar 06, 2017 7:22 am
by Ehab.Ali
Apprentice wrote:Fixed.


still not working with sell orders

Re: Two Moving Average Cross Expert Advisor

PostPosted: Thu Mar 16, 2017 4:45 am
by Apprentice
Update.

Re: Two Moving Average Cross Expert Advisor

PostPosted: Tue Mar 21, 2017 4:23 am
by Apprentice
This is a major update to the following Expert Advisors:

- Multi Indicator EA
- Two MA Cross EA
- MA Cross with Exit EA

The following improvements have been made:

- Now the trader sets the number of pips rather than points (no more thinking about how many points to set, simply write 20 for 20 pips and that's it).
- EA can be activated/deactivated to trade or not
- Auto Lots calculation has been revised and is working properly
- Comments displayed on chart give more information about risk, lots, equity, opened orders
- (By the way, trades comments can be turned off to avoid the comments area to keep growing)

Additions:

The trader can now estipulate a maximum percentage of risk for open trades. For example the risk can be 2% per trade and the maximum 7% of the equity. The user can also choose the number of opened trades at the same time, for example 5.

So the way it works is that once the SL has moved to breakeven, then the risk for that trade is no longer considered in the equity providing additional room for opening further trades if necessary. It could be, for instance, that there were 3 opened trades but the 4th one was opened when one of the prior 3 moved to B/E.

Also, the trader could decide to have the same fixed lots every time and again set a maximum number of lots traded. For example 1 lot per trade and a maximum of 4 lots in total.

One note about the trailing stop

The way the Stop Loss works is to initially protect the trade, say with 20 pips. If the user additionally sets a trailing stop (TSL) of 15 pips with a 5 pips step, it will not work until the trade is in profit. This means they are two different concepts. The TSL will be activated when the trade is 15 pips in the green and then correct itself every 5 pips (step).

Re: Two Moving Average Cross Expert Advisor

PostPosted: Fri Mar 24, 2017 1:59 pm
by 7510109079
Does the two MA Cross indicator exist as a Marketscope lua indicator?

Re: Two Moving Average Cross Expert Advisor

PostPosted: Sat Mar 25, 2017 7:07 am
by Apprentice

Re: Two Moving Average Cross Expert Advisor

PostPosted: Mon Mar 27, 2017 8:36 am
by 7510109079
thats good thx but doesnt have the same ability to specify the OPEN or CLOSE as the mq4 does.

Any possibility of putting together something like this:
Image