Trade Management EA

1. There are 2 Trade Management Techniques Available
a. Dot to Dot
b. Grants Trade Management Technique
2. Trade Management Expert Advisors
3. Trade Management Scripts etc
Post Reply
User avatar
Darren
Posts: 891
Joined: 20 Nov 2012, 13:54
12

Trade Management EA

Unread post by Darren »

Hi Guys,

I have been asked to share the trade management EA that I wrote and am using at the moment on my live accounts. This version is 'Fruit Friendly' but you will have to put the initial stop loss below the fruit yourself. The stop loss won't be changed until a candle closes above the whole of the Gator for a Buy position or below the whole of the Gator for a Sell position. When a candle does close above or below the Gator you will see the 'TrailGreenGatorBUY' or 'TrailGreenGatorSELL' change on the chart from 0 to 1. From this point on until there are no longer any orders the EA will manage the position. Only when the position is closed will those parameters change to 0.

There are a few parameters that can be changed:

OverideTrailing: This is set to false by default but if you are in a trade and want to overide the Trade Management EA so that the SL is moved below/above the last closed candle then set this to true. It will basically trail every candle then.

UseMagicNumber: If you have other orders open that you don't want to be managed then set this to true and put the magic number of the position you want it to manage in the 'MagicNumber' parameter.

TrailGreenGatorLips: When set to true the stop loss will be moved below the candle that closes under the green line for a long position and above the candle that closes above the green line for a short position.

TrailAboveBelowWholeGator: When set to true this will trail the SL a certain amount of pips below or above the whole of the Gator. The amount of the trail is set by 'TrailAboveBelowGatorAddPipToUpperBar' and 'TrailAboveBelowGatorSubtractPipsFromLowerBar'. This feature is useful in the early stages of the trade and allows you to trade slightly bigger Aims boxes and use the bottom/top of the Gator as the SL.

UseInitialStoploss: When set to true as soon as a position is opened an 'emergency' SL can be set by the amount of pips but into the parameter 'InitialStopLoss'. Obviously if a position is opened with a SL less than the 'InitialStopLoss' the SL will not be changed.

Trail5Candles: If true and there are 5 red or 5 green candles then the EA will start trailing candles, but only if a certain amount of pips profit has been achieved and the amount of profit is greater than the value set in the parameter 'Trail5CandlesAfterPipsProfit'.

UseFractalStopLoss: When set to true the EA will trail Aims boxes.

'AddPipToUpperBar' and 'SubtractPipsFromLowerBar' are used for trailing fractals, trailing 5 candles and trailing the green line.

The TradeManagement EA will never increase the SL only decrease it. Test it on demo so you know how it works before going live.

Remember, the EA will only manage a position if a candle has closed above the gator unless you use the initial stop loss feature. For this reason it is great for fruit trading and will ensure the trade is managed with discipline. You can also have more than one position managed.

The default settings are what I use for M1 trading. If you are using the EA on M5 or above then you may have to change some of the settings as they may be a little close! For example, if you have set the initial stop loss to 18 pips on H1 it may be hit before you want it to!

You have to load the EA onto the chart of the same pair that you want it to manage and the same timeframe. Put it on a separate chart (not the one you trade on) so that you don't keep changing the timeframe as that may really confuse the EA!

Any questions, let me know. :)

EDIT: I have uploaded a new version of the trade management EA which has an additional feature. The new version is version 3. You can now move the stop loss once a certain amount of pips have been achieved. There are three parameters for this feature:

UseFirstTarget: When set to true and the position is in profit by the amount of pips set in the parameter 'FirstTargetProfit' (set to 12 pips as default) then the SL will be moved to the amount of pips set in the parameter 'FirstTargetTrailPips (set to -5 pips as default). So, if using default values as soon as the position is 12 pips in profit the SL will be moved to -5 pips from the original order entry price. The parameter 'FirstTargetTrailPips' can also be positive, so if set to 10 then as soon as there is 12 pips profit then you could lock in 1 pip profit. This feature works on individual orders, so if you entered an add on trade and it goes 12 pips in profit then its SL would be moved to -5 pips but the original position would not change its stop loss. Again, this feature will only work when a candle closes above the whole of the Gator.

EDIT 2: I have uploaded version 4 of the EA. There are a few small bug fixes and a new parameter so please use the latest version. You can now put a target in place. This isn't something I use myself but the feature is there if you require it. The new parameters are:

UseTakeProfit: If set to true then the EA will put a take profit amount equal to the amount of pips in the 'TakeProfitPips' parameter.
You do not have the required permissions to view the files attached to this post.
Last edited by Darren on 21 Nov 2014, 11:14, edited 12 times in total.
Michal
Free Member
Free Member
Posts: 762
Joined: 28 Aug 2012, 01:13
13

Re: Trade Management EA

Unread post by Michal »

great stuff Darren thank you very much ! :)
All I need is Aims. Just love it !
User avatar
zlabis
AIMSter
AIMSter
Posts: 533
Joined: 26 Nov 2013, 08:53
11

Re: Trade Management EA

Unread post by zlabis »

Darren you're awesome !!!! :-bd :-bd :-bd
"Want what the market wants", Bill M. Williams in "Trading Chaos - Second edition"
User avatar
Darren
Posts: 891
Joined: 20 Nov 2012, 13:54
12

Re: Trade Management EA

Unread post by Darren »

A new version has been uploaded with a new feature. :)
User avatar
Grant
Posts: 943
Joined: 14 Aug 2011, 14:52
14

Re: Trade Management EA

Unread post by Grant »

thank you Darren,

apologies for being lazy but a quick Q if i may, does the addto and subtract from include the spread? ie if set to 2 on Dax will it actually be 3 (2 +spread)??

cheers

Grant
success = patience + discipline - greed
User avatar
Darren
Posts: 891
Joined: 20 Nov 2012, 13:54
12

Re: Trade Management EA

Unread post by Darren »

Grant wrote:thank you Darren,

apologies for being lazy but a quick Q if i may, does the addto and subtract from include the spread? ie if set to 2 on Dax will it actually be 3 (2 +spread)??

cheers

Grant
Hi Grant.

No, you have to figure out the spread yourself! The SubtractPipsFromLowerBar subtracts a certain number of pips from the bid price (the price you see on the chart). So if you want to trail 1 pip below the lower aims box for a long then this should be set to 1. The AddPipToUpperBar adds that amount of pips to the bid price so in this case you have to work out the spread yourself. If your spread is 1 and you want to trail 1 pip above the aims box for a short then this value has to be set to 2. Hope this makes sense! If you have a variable spread then you would have to work out the average and add that value to the upper level.

Cheers.
User avatar
zlabis
AIMSter
AIMSter
Posts: 533
Joined: 26 Nov 2013, 08:53
11

Re: Trade Management EA

Unread post by zlabis »

thank you so much for your effort. I will put it on my charts tomorrow.
:-bd :-bd :-bd
"Want what the market wants", Bill M. Williams in "Trading Chaos - Second edition"
User avatar
Darren
Posts: 891
Joined: 20 Nov 2012, 13:54
12

Re: Trade Management EA

Unread post by Darren »

fxsam wrote:A question to you darren. Is that possible to set hard TP in this EA ? i.e 50 pips or 100 pips or whatever.
Very possible and an easy addition. I shall add it to the next version when I get around to coding it! :)
User avatar
Darren
Posts: 891
Joined: 20 Nov 2012, 13:54
12

Re: Trade Management EA

Unread post by Darren »

Darren wrote:
fxsam wrote:A question to you darren. Is that possible to set hard TP in this EA ? i.e 50 pips or 100 pips or whatever.
Very possible and an easy addition. I shall add it to the next version when I get around to coding it! :)
A new version with this feature has been uploaded. We are now up to version 4. It has a couple of small bug fixes so please download and use the latest version. :)
Post Reply