Moving Average Cross with Exit Expert Advisor

Custom MT4 expert advisors published here.

Moderator: admin

Moving Average Cross with Exit Expert Advisor

Postby Apprentice » Mon Mar 13, 2017 5:40 am

MA Cross with Exit EA.jpg

Description:

This is an interesting MA Cross Expert Advisor that includes Exit rules. The EA will exit a trade either by SL/TP hit or by exit rules given by opposite MA crossings, whatever comes first. Results are interesting because that MA3 (which can be half way between MA1 and MA2) helps to protect the trade anticipating a change of trend.

Expert Advisor Entry Rules:

- Go Long when MA1 crosses above the MA2
- Go Short when MA1 crosses below the MA2

Expert Advisor Exit Rules:

- The traditional SL, TP and TSL
- Close Long and Short trades when the MA1 crosses either the MA3 or MA2 in opposite direction of the entry trigger

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:

- EA can be turned on and off
- 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
Two_MA_Cross_Indicator.mq4
(29.07 KiB) Downloaded 80 times

MA_Cross_with_Exit_EA.mq4
(68.43 KiB) Downloaded 2779 times
User avatar
Apprentice
FXCodeBase: Confirmed User
 
Posts: 36341
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia

Re: Moving Average Cross with Exit Expert Advisor

Postby Ehab.Ali » Mon Mar 13, 2017 10:06 am

perfect
thanks a lot man

but triling stop working with buy only not working with sell

pleas check that

thanks again
Ehab.Ali
 
Posts: 37
Joined: Tue May 31, 2016 2:10 pm

Re: Moving Average Cross with Exit Expert Advisor

Postby Mandelbrot » Mon Mar 13, 2017 5:06 pm

I see the same comment like in the "Two MA Cross Expert Advisor" posted here viewtopic.php?f=38&t=64500 but I ran the strategy tester in both and the TSL worked for sell orders with no problem.

Parameters are the following:

MA1: 5 SMA
MA2: 30 SMA
MA3: 10 SMA

SL: 200 (points, so it means 20 pips)
TP: 400
TSL: 150
TStep: 50

I attach a random Sell order from the test and you can notice that the order first modification is for setting the initial SL and TP. The second when the difference of the entry price and the TSL is 15 pips and then one modification every 5 pips.
Attachments
ScreenHunter_415 Mar. 13 14.09.jpg
Mandelbrot
 
Posts: 5
Joined: Fri Mar 11, 2016 11:33 am

Re: Moving Average Cross with Exit Expert Advisor

Postby Ehab.Ali » Tue Mar 14, 2017 5:33 am

Mandelbrot wrote:I see the same comment like in the "Two MA Cross Expert Advisor" posted here viewtopic.php?f=38&t=64500 but I ran the strategy tester in both and the TSL worked for sell orders with no problem.

Parameters are the following:

MA1: 5 SMA
MA2: 30 SMA
MA3: 10 SMA

SL: 200 (points, so it means 20 pips)
TP: 400
TSL: 150
TStep: 50

I attach a random Sell order from the test and you can notice that the order first modification is for setting the initial SL and TP. The second when the difference of the entry price and the TSL is 15 pips and then one modification every 5 pips.


yes it works you are right but it works only when you put tp (number) and sl (number)
but when i put sl 0 and tp 0 to make it disabled
it only work with buy and not work with sell
Ehab.Ali
 
Posts: 37
Joined: Tue May 31, 2016 2:10 pm


Re: Moving Average Cross with Exit Expert Advisor

Postby Ehab.Ali » Thu Mar 16, 2017 7:37 am

Apprentice wrote:Update.


THANKS A LOT MAN
NOW IT WORKS FINE
THANKS
Ehab.Ali
 
Posts: 37
Joined: Tue May 31, 2016 2:10 pm

Re: Moving Average Cross with Exit Expert Advisor

Postby Apprentice » Tue Mar 21, 2017 4:21 am

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).
User avatar
Apprentice
FXCodeBase: Confirmed User
 
Posts: 36341
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia

Re: Moving Average Cross with Exit Expert Advisor

Postby seunboi4u » Fri Nov 17, 2017 10:02 am

i really say thanks to the writer of the this EA....please i test my settings with one min but did not execute the trade and please can we get the indicator that i can set like this EA to Alert.......God bless
seunboi4u
 
Posts: 16
Joined: Wed Nov 01, 2017 5:59 am

Re: Moving Average Cross with Exit Expert Advisor

Postby seunboi4u » Fri Nov 17, 2017 10:10 am

im sorry please i want to give a test very well but i will like to get the same configuration but it will be indicator with Alert thanks
seunboi4u
 
Posts: 16
Joined: Wed Nov 01, 2017 5:59 am

Re: Moving Average Cross with Exit Expert Advisor

Postby Apprentice » Sun Nov 19, 2017 4:31 pm

Your request is added to the development list under Id Number 3952
User avatar
Apprentice
FXCodeBase: Confirmed User
 
Posts: 36341
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia

Next

Return to MT4 Expert Advisors

Who is online

Users browsing this forum: No registered users and 14 guests