Cool Break Even & Trade Management EA for MT4

Hello, traders, I found a cool trade management EA. It’s a break even Expert Advisor for the free MetaTrader 4 Forex trading platform. This EA allows you to set an amount, in pips, to trigger the EA to move your stop loss to break even, which helps with money management.

I use this break even Expert Advisor all the time, so I thought you guys might find it useful.

Unlike any other break even EA that I tried, this one allows you to set a custom break even point (lock in pips). You can lock in positive or negative pips.

This is useful because most break even expert advisors don’t allow you to factor in the spread cost. With this EA, you could lock in +3 pips, for example, to cover your spread and/or commission costs.

In the picture below, I have the EA set to move my stop loss 2 pips into profit once the “trigger” or 40 pips of profit is reached.

LockInPipsAt – This is the amount of pips you want price to move into profit before the EA moves your stop loss to break even.

LockInPips – This is the setting that I spoke of that allows you to lock in your desired amount of pips once the break even action has been triggered.

Note: As I mentioned earlier, you can also lock in negative pips. For instance, you could set this EA to lock in -4 pips once break even event has been triggered.

I don’t personally do this, but I know of other traders that sometimes adjust their stop losses, while not quite bringing them to break even. The idea is to leave the trade more room to move while taking some of the risk off of the table.

Trades – With this setting, you can scale out of your trade. A setting of 1 means that your stop loss will be moved to break even only. A setting of 2 will close half of your position when the stop loss is moved to break even, and the other half when your “LockInPipsAt” value is reached again. You can adjust this value up to 3 at the most.

Example: You set “LockInPipsAt” to 40 and “Trades” to 3. If price moves 40 pips in your favor, the break even event is triggered and half of your positions is closed. If price moves an additional 40 pips (80 pips in total) in your favor, half of the remaining position is closed. If price moves an additional 40 pips in your favor (120 pips in total) the remaining position is closed out.

A text message with your chosen trigger, profit lock, and (if activated) scale out values is displayed at the top of the chart. The FontSize and FontColour values control the visibility of the message.

Before anyone asks, I’m not entirely sure what ModifyTrades and ModifyTrade3 do. I’ve tried adjusting these both before, but I haven’t noticed any difference in how this break even Expert Advisor works.

I only use this break even EA to move my stop loss to break even (+2-3 pips), according to the rules of my trading system. I never use it to scale out, so you may have to experiment a bit to fully understand all of its features.

In order for the BreakEven_v2 EA to alter your trades automatically, you must make sure that “Allow live trading” and “Allow DLL imports” are checked under the Common tab of the break even EA (see the image above).

You can check these settings when you drag the indicator onto your charts, or you can pull up your EA “Properties” (Right-Click > Expert Advisors > Properties or F7) if the break even Expert Advisor is already attached to your chart.

To make sure these setting are always checked by default when you add any new EA, go to your MT4 “Options” (Tools > Options or Ctrl+O). Make sure “Allow automated trading” and “Allow DLL imports . . .” are checked.

Finally, make sure the “AutoTrading” button is activated (Ctrl+E) at the top of the platform. If everything is working correctly, you should see a smiley face next to the name of the EA in the top-right corner of your chart.

Adjust the settings (see the instructions above) and colors, if needed, and hit the “OK” button.

Make sure Auto Trading is enabled (Ctrl+E).

The beauty of this break even EA is that you can apply it to your chart and walk away. If you’ve been reading for a while, you know I hate to sit in front of my charts for too long. That is one of the reasons I switched my main trading system to Day Trading Forex Live this year.

No matter what timeframe you trade on, this break even Expert Advisor can help save you time and effort while keeping your trading system as accurate and mechanical as possible. I hope you guys find this free break even and trade management EA as useful as I have over the years. Please share and comment!

Jan, thanks for your comment. I agree this is a great EA. I use it all the time. Unfortunately, I did not write the EA, and I don’t yet know how to edit and write these. Your idea would be a good addition to the script.

Anyone reading this know how to program these? Contact me. Jan, you could also take this script to a freelance work site (like Vworker.com or Elance.com), and have an expert on Metatrader 4 EAs or MQL programming customize it for you.

Chris,
I’m having issues on just trying to lock 1 pip after it reaches 10 pips with no scaling included. For some reason it doesn’t work. But if I allow it to scale and set it for 3 trades where I really want to set for one 1 trade, it works, But not the way I would expect based from the inputs I provided on the configuration.

hi, i have just downloaded this EA to use but it will not let me attatch to any charts? Also, i have looked and compled it in Metaquotes editor to check for issues and it tells me that “use of decompiled EA’s is prohibited”/

I’m not sure what the problem is. I’ve never run into this issue, and thousands have downloaded this EA with no problems.

Does your broker allow the use of EA’s? Not all of them do. Also, if you edited anything while looking around in the Metaquotes editor, you would have to recompile the code before it would work (assuming you didn’t edit out any of it’s functions). You might try downloading the EA again.

It has to do with the scaling out feature. I don’t personally use this feature in my own trading, because the Top Dog Trading system uses indicators to scale out – on the techniques where that is an option.

Hi there, i have placed this ea in my expert files of the mt4 but cant figure out what to do next. You talk about making sure the settings are correct but where do i find this. You also say we can drag and drop this on the chart. Can you explain how to do this please
Many thanks

If you’ve put the files in the right folder, you should be able to open MT4 and see BreakEven_V2 in your experts folder on the left. If you see it, simply click and drag it onto your chart. That’s when the options will pop up for you.

Make sure your “Experts” button at the top of MT4 is on, and it should work. If not, you may have to go to Tools > Options and make the adjustments that I mentioned above. Hope this helps.

Thank you for the EA! If I have several trades open, in different pairs, and I attach this to EU, will it only move the SL on the EU trades? The pips value is input in the same manner for both 4 and 5 digit brokers? For example, value of 20, for really 20 pips? (some EA’s need adjustment, otherwise, it’d use 2 pips instead of 20). Thank you

Thanks for the input! But I’m having a problem!
I want the EA to close half of my position after a
certain amount of pips in my favour and move SL to breakeven. Sometimes it
seems to work. But other times it does something weird. It closes the first half
like I ordered, but immediately scales the remaining half in a few more
positions and closes them right after. Doesn’t let the second half position
opened and the SL in the breakeven.

I’m not sure about that. This EA could be conflicting with your version of MT4. Like I mentioned above, I lost the ability to use this when I updated to the 600+ builds. With that in mind, if you like these old EAs and indicators, don’t update!

hi..thanks for sharing.does the ea will make virtual top loss ??my broker will not allow to make stop loss more than10 pips above..this.ea will be perfect if the stop loss made virtually..so OP will close by ea

If you can get this old EA to work (you’re using an old MT4), then yes, this would work for you, because it does not drop a stop loss in until a predetermined amount of pips are made (that you set). This EA doesn’t work on the new builds of MT4 though. Sorry.

Awesome, Jp! I’m glad it works for you. This EA is one of those that I recompiled a while back, but I had some problems with it in a later build, so I gave up on it. Maybe it’s working for everyone again.

Chris, Can you please tell me how will know if the advisor is working apart from the smiling face on the upper right side of the graph. How do I find how many live trades the system made and if necessary how do I close them manually..

Thanks for commenting Paolo. I’m glad you found this EA useful. I didn’t create this, I just found it useful at one point. I haven’t used it in a while either. I don’t remember what “ModifyTrades” and “ModifyTrades3” does. I was thinking it had something to do with scaling out, but I don’t remember for sure. I never used that feature.

Sorry that I missed this one. I get a lot of spam, and haven’t been too diligent lately. I haven’t used this indicator in a while. When I did, it was because I was going to be away from the computer while a trade was on, so I’m not sure if I ever noticed what you described.

I’m making a note to try this out next week. You might be able edit the file to remove the code that causes the alert, if nothing else works.

Well, I did use this indicator on the one trade that I took last week. It worked like it should, and I immediately remembered the squeaking sound.

It only happened once for me, because I had it setup to move my stop to +3 pips after my trade got to 1:1. It never made another sound for me. I had the alerts checked (I left everything default other than my break even rules).

Like I said before, you might just have to edit out code for the alert sound, if you can’t live with it. I actually found this EA to be pretty useful as is. I’ll probably start using it again.

I thought you were already using this one. Anyway, I’m not sure what versions it will or will not work with. I had to edit this one a year or so ago to get it to work with the newer versions of MT4, and I don’t have the original file anymore. Sorry.

Thanks for the comment. It’s funny that you asked this question. I was planning to update this article today, and I’m going to cover these options in more detail.

All you need to do is change “Trades” to 1 (to avoid scaling out). Change “LockInPips” to the amount of pips you want to lock in. Change “LockInPipsAt” to the amount of pips price needs to move in your favor before the EA moves your stop loss to break even (+LockInPips).

Does this expert advisor move the stop loss to be after the set number of pips for all trades, or only for the chart that the advisor is on? I’ve been looking for a ea that can do what you say this ea does for all of my open trades. I run other auto traders to take my trades on several different types of pairs throughout the day.

This EA only works on the chart you have it applied to. That’s good for the way I use it because I often use different stop losses and take profits from trade to trade.

If you’re trying to run multiple EAs, obviously you can’t run them on the same chart. The solution is to open multiple charts of the same currency. For instance, you open two GBPUSD charts, one with this break even EA, and another with your other EA.

I too had the problem of the squeaking mouse sound. In fact it was more like a thousand mice squeaking at the same time, none stop 24/7. When the sound started I had no idea where it was coming from. I thought my laptop was biting the dust. I had 4 different mt4 platforms running, all with different indies and ea’s. After some epic investigation that would put Sherlock Holmes to shame, I finally tracked down the noise to one particular mt4 platform. The EA at the top of this page is an exe file so It can not be edited. I found a mq4 version via a google search. I edited the file by deleting “alert.wav” from the code and instantly the noise stopped.
Hope this helps anyone else having the same problem.
Regards,
Ian

Thanks for the comment. I’m glad you got it figured out. I did mention, when I replied to Dane, that he could edit out the alert sound code. Thanks for mentioning the exact file, BTW. That’s useful.

However, I recently updated this article. When I did, I re-uploaded the file because I’ve edited it slightly for a cleaner display. I actually have both files but for some reason I only uploaded the new .ex4 file. Thanks for bringing this to my attention. I’ve made a note to change the download to include either include both files or just the .mq4. That way, you guys can edit it if you need to.

Edit: The download is now the .mq4 file, so it can be edited. Thanks again, Ian.

Thanks for the comment, Brian. This indicator doesn’t do trailing stops. It can move your stop loss to break even (while locking in some positive or negative pips if you like) and it can scale out of your trade.

Really not clear about the difference between this EA and the trailing stop loss. Also, is it possible for this EA to LockIn say 2pips immediately after the slightest profit margin so that even if the profit doesn’t get to the projected pips stated in LockInPipsAt value, you are sure to LockIn your transaction cost atleast

This indicator doesn’t trail price. It’s primarily used to move your stop loss after a certain amount of pips that you set. For instance, you can lock in 2 pips above entry after price has moved 10 pips. Both values are adjustable.

You could lock in 2 pips immediately by setting “LockInPipsAt” and “LockInPips” to 2, but you would almost certainly be stopped out immediately.

It can work either way. I keep it on my charts and adjust the parameters as I enter a new trade. If your broker allows you to trade and use EAs during high volatility fundamental announcements (which is what I believe you’re asking about), you should be able to use this one. I’ve never had a problem with it.

I believe that if you have multiple open orders on the same currency, this EA will affect all of them. However, we cannot trade that way here in the U.S. anyway because of FIFO, so I don’t know for sure.

The name of the EA and smiley face are locked to the foreground color in your chart properties. If that color is similar to your background color, it may be hard (or impossible) to see. If that’s not the issue, then I need more information. Are you seeing a frowning face in the upper-right hand corner? Have you followed the steps detailed in this article?

FYI, the message that you’re talking about will display regardless of whether or not the EA is activated.

question does it have to be on the same chart to lock in pips for that trade, for example euruad. i dragged it on after the trade was in profit because i was trying another ea but it did not work. and what does Modifytrades3 mean? and modifytrades?

Make sure you have “Allow DLL imports” and “Allow live trading” selected as shown in this post above. It shouldn’t matter which chart you add it to. Also, as I mentioned in the post above, I never figured out what ModifyTrades and ModifyTrade3 do. This EA still works fine for me. I only use it to move my stop loss to break even, though. I don’t use it to scale out of the trade.

The way you’re going to use it is going to depend on the rules of your trading system. I use this with the DTFL system. I have it set to move my stop loss to break even if the trade goes in my favor for 60% of my total take profit.

For instance: If I set a 40 pip take profit, I have the EA move my stop loss to break even if price goes in my favor for about 24 pips (60% of take profit). That has worked well for me.

Why is that the EA didn’t trigger when it reached 40 pips. I set my TP1 at 40 pips. There is a smiley face on the top right beside the EA name and the platform is set at auto trading. Please help. Thanks!

This is not at take profit EA. Maybe you meant to type something else. You should have the LockInPipsAt variable set to 40 if you want the EA to move to break even at 40 pips in your favor.

Also, keep in mind that it’s possible during a sell trade for price to barely reach 40 pips in your favor, yet the spread was wide enough at the time to not trigger the EA.

In other words, while price may have reached 40 pips in your favor, you’re profit may have only been 38 pips (give or take) because of the ask price. In a sell trade, you enter at the bid price and exit at the ask price.

Sorry for the late response. I’ve been busy with family/holiday stuff. You can use two or more EAs on a single pair, but you need to open a separate chart for each one you attach. Also the EAs can’t perform conflicting actions or you’ll run into problems.

Hello, Zac. I don’t think you can backtest this kind of EA. In any case, I’m not the right person to ask. I don’t do backtesting in any real capacity. If I’m testing a new system or technique, I’m always manually forward testing.

Will this work for multiple trades on the same pair separately? For example if i entered two separate positions on EUR/USD will the EA work separately with each? Also If i entered a trade off the MT4 app on my phone would this EA still work since my account is linked to my MT4 on the computer? Lastly is there a way to edit out the alert noise i cant seem to find it in the code? If so what does it need to be changed too. Thanks!

Chris, this EA doesn’t trigger a take profit? It only moves the stoploss to a fixed value (trailing stoploss) to make it a breakeven? I need to still manually close my trades. Is my understanding correct?

If I entered a trade and I am totally wrong and the trend went against my trade, how will it break even? Or I will still lose money in a preset amount?

You should always be trading with a stop loss, Sherwin. That’s how you predetermine your risk. This EA can lock in some pips after price moves in your favor by an amount that you determine.

For example: You pull the trigger on a trade and your target is 40 pips. You’re stop loss is 20 pips. You could then set this EA to move your stop loss to breakeven if price moves in your favor 20 pips or so.

You can use the “LockInPips” value to have the EA move to breakeven + 2 (or 3) to cover your spread cost.

You can also the “ModifyTrades” and “ModifyTrades3” values to allow the EA to partially close (or scale out) your trade.

It’s been a while since I’ve used this EA, and I never really used the scale out feature, so you’ll have to experiment with that. I have traded systems that required scaling out, like Top Dog Trading, but I didn’t use this EA to do it.

Clinking on the link under “Installation Instructions” will initiate the download. You have to go find it in the folder that your system downloads files to. For me it goes straight into my “Downloads” folder.

Ciao Chris, you’re one of the best! I found your site last night and i am going to enjoy all your contents. Congratulations for your job! Chris, a quick one, i’ll test BreakEvenEA on one of my MT4 demo starting from tomorrow night but my question is: the value is actually in Pips or it’s in points for MT4? Sorry if you have already posted a message about it, i don’t find information but maybe i am not finding the post. And also, do you know if this EA works fine on MT4 version 4.00 build 1260 24jan20? Many thanks for your kind reply. Ciao. Fab

“LockInPips” is the value past breakeven you want the EA to move your stop loss to. The EA will only move your stop loss to breakeven after the market has gone in your favor for the value that you set in “LockInPipsAt”.

For instance, you could set the EA to move your stop loss to breakeven after 40 pips by setting the “LockInPipsAt” value to 40. You could also have the EA move your stop loss past breakeven, by say 2 pips to cover your spread cost, by setting the “LockInPips” value to 2.