Your wish is my command..I bet you're really a "happy camper" now. Pun absolutely intended.
Attached File(s)
BreakEvenExpert_v1-10.mq4
3 KB
|
2,462 downloads
EA to "save" profit and move/lock it if profit goes higher. does it exist? 8 replies
Profit From Profit-Taking —Scalping the Session Close 21 replies
Manage Save Profit System 0 replies
DislikedYour wish is my command..I bet you're really a "happy camper" now. Pun absolutely intended.Ignored
DislikedStock,
I just noticed something in my last two trades. Don't know if I have it set up wrong or it's just acting weird.
Here's the scenario: I have the first target set @ 7, the target increment @13. So the EA should take profit @ 7 and @ 20, correct? Well, I had a trade today where it took profit @ 7 and all the info on the screen changed, then price retreated to 2 or 3, and when it started moving again the EA took profit again @ 7. The screen info said the next profit target was 20. Do I have it set up incorrectly?
Thanks!Ignored
DislikedIs it possible to include a function to close all orders (pending and active) as soon as a profit target is hit?
ThanksIgnored
DislikedYes, it can be modified to support that feature. At least, on active orders. I have nothing in here to manage pending orders. I have my hands full with other projects, so, it's difficult for me to add new features. Needless to say, I get a lot of requests on this EA.Ignored
DislikedIs it possible to include a function to close all orders (pending and active) as soon as a profit target is hit?
ThanksIgnored
DislikedHi Everyone,
I've developed an expert that is designed to help me stick to my system a bit better than what I do by myself. Use it at your own risk, though.
The expert works by taking profit out of a trade at various take profit levels. It also moves stop losses at designated levels. You have the ability to customize the following parameters:
- First_Target: This is the first take profit target, in pips, that you specify.
- Target_Increment: Once the first profit target is reached, the next target will increment by the amount specified by the target increment variable.
- Close_Lots: This is how many lots you want to take out at each target. For example, if you have 10 lots, you can take 1 lot out at each of 10 profit targets, or 5 lots out at each of two targets. It's up to you.
- Move_Stops: Set to true if you want the expert to move stops based on the First_Stop and Stop_Differential parameters. Otherwise, set to false if you don't want stops moved automatically.
- First_Stop_Target: This is the amount in pips the trade moves before your stop loss is moved to the First_Stop level.
- First_Stop: This will move your stop loss when a target, in pips, is reached. The number represents the number of pips from entry and can be postive or negative.
- Second_Stop_Target: This is the amount in pips the trade moves before your stop loss is moved to the Second_Stop level.
- Second_Stop: This will move your stop loss when a target, in pips, is reached. The number represents the number of pips from entry and can be postive or negative.
- Use_Max_Loss: Set to true if you want to input your own stoploss and hide your stop value from your broker. This is the maximum loss you'll risk on the trade. It's irrelevant if Move_Stops is set to true AND Move_Stops was triggered.
- Max_Loss: This is the maximum pip loss you'll accept on the trade. If set to 0, this function is disabled.
- Magic_Number: You can use this to ensure the expert only manages trades with a particular magic number. This will allow you to trade the same pair using different systems without this expert interfering with the take profit points of the other trade(s).
The image below represents example parameters that can be set for the expert. I'll explain each one with a scenario. Assume you place a 1 lot sell order for EURUSD at 1.2100 (1.2103/1.2100 - ask/bid). (Assume a 3 pip spread.)
- The expert will take .1 lots ("Close_Lots"), or 1/10th of this scenario's order, out at +10 pips ("First_Target"), or 1.2090/1.2087.
- After that, the next profit target will increment 8 pips ("Target_Increment") to 1.2082/1.2079. and another .1 lots will be taken out at that level. The expert continues to increment the preceding profit target by 8 pips until the original order is closed. In this example, the maximum pips gained would be 10 + (8*9), or 82 pips. (First target pips + increment pips * number of times to increment, which would vary depending on the original order size and the "Close_Lots" parameter.)
- When the trade reaches +15 pips ("First_Stop_Target"), the stop loss will be moved to -5 pips ("First_Stop") from the order entry price. In this case, the order entry price was 1.2100, so the new price would be 1.2105. This means that you would lose 5 pips if the trade turned. Set the "Stop_Differential" parameter to "0" in order to move stops to breakeven (1.2100). If this parameter were, for example, set to 5, then the stop loss would be moved to 1.2095, and you would have a 5 pip increase if the move turned against you and stopped you out.
- When the trade reaches +30 pips (Second_Stop_Target), the SL is moved to Entry Price + 10 pips.
- If you don't want the expert to move the order's stop loss, then set the "Move_Stops" parameter to "false". I think this works, but haven't fully tested it.
In case you're wondering, the reason I wrote this is so that I didn't have to place 5 different stop loss orders in order to manage different take profit levels. Since I don't want to sit in front of the computer all the time, waiting for these levels to hit and I take out a portion of the order, I figured an expert would do just the thing.
Regards,
stockwet
** Important **
I've found that if I'm in the middle of trade and make a change to the expert parameters, it resets everything. So, here's an example. Let's say that I want to take 1 lot out at 20 pips and another out at 40 pips. The price moves to 25 pips and takes out my first lot. I decide that I want to change my stop rules to move stops from breakeven to +10 pips if the price goes to +30 pips. The problem is, my take profit had incremented to watch for +40 pips but my initial target is still set to 20. If I close the expert, it resets the incremented value to the initial target. Since the price is now +25 pips and my initial target is set to 20, even though the expert incremented to 40 as the next target, the reset causes my second lot to be taken out.
So, if you're targets have incremented and you want to change your move stops or any other value, make sure you make your initial target to be the new next target you want to take profit out at.
** Updates**
11/2/2006 (v2.3) :: Fixed bug that caused the sl var to be set to 1 when a pending order was > than the First_Stop_Target value. In other words, if a pending order was in, not an actual order, and the price was greater than First_Stop_Target pips from the pending order entry, then the expert would honor the second move stops stop target, and skip the first.
1/23/2007 (v2.4) :: Fixed pip calculation. The old way of calculating pips could be off by 1 pip, resulting in missed TP or move stops. The new calculation is more accurate.Ignored
DislikedI would like my stop loss to be automatically increased as the price increases. As the price ticks up 1 pip, I want the SL to increase by 1 pip, and so on, indefinately, until I get stopped out. Can this EA do this? Is so, how do I set this feature up, and if not, does anyone know of an EA that will allow me to do this?Ignored
DislikedI would like my stop loss to be automatically increased as the price increases. As the price ticks up 1 pip, I want the SL to increase by 1 pip, and so on, indefinately, until I get stopped out. Can this EA do this? Is so, how do I set this feature up, and if not, does anyone know of an EA that will allow me to do this?Ignored
DislikedOkay, thanks for this.
Can you please explain the differences between TrailingStop & TrailingStep?Ignored
DislikedHi Stockwet,
Thanks for the great EA.
I am currently testing this EA on demo, and when I place a MaxLoss of (for example) 10 (i.e. 10pips SL), and watch the price action reach that, then nothing it happens. It just keeps going without closing.
Am I doing something wrong?
Thanks.Ignored
DislikedI love this Ea. Thank you very much. I would like to know if it is available in Metatrader 3 format. I have an account where I trade a small group using a Pamm account and it is only available in MT3.
By the way I am not MA, it is only family members in my managed acct.
Thanks againIgnored
DislikedIt's hard for me to say, without seeing what's happening.
I will say that MT4 is a little funny with their "greater than or equal" and "less than or equal" operators. If I say something like:
Close when pips are greater than or equal to 10, then it doesn't really close until 11. I think the code evaluates true at 10 and it's delayed until the next pip.
I don't know your experience with EA's, either. It could be that you don't have live trading enabled. Or, it could be that your broker has disabled experts (unlikely.) But, the code is pretty well tested for probably a year now, so, I know it works. You could look in your log files and see if there's an order even attempting to execute. Other than that, I don't have a lot of information to go on in order to help out more.Ignored
DislikedHi Stockwet,
I have downloaded and attached EA to a couple of charts and activated EA in MT4. Both Journal/Experts confirm loaded plus smiley face on.
Based on original settings, I place market order say SELL EUR/USD 1lot. Do I have to enter SL and TP in my order as well, or will EA take care of this?
I haven't been able to get EA to wrok for me. Even with pending orders say, buy limit etc. Once open price hit, EA did nothing.
Could you please confirm what exactly I have to download incl version and how to set up the EA to handle a manual trade?
Mnay many thanks
TomIgnored