• Home
  • Forums
  • Trades
  • News
  • Calendar
  • Market
  • Brokers
  • Login
  • Join
  • User/Email: Password:
  • 11:51am
Menu
  • Forums
  • Trades
  • News
  • Calendar
  • Market
  • Brokers
  • Login
  • Join
  • 11:51am
Sister Sites
  • Metals Mine
  • Energy EXCH
  • Crypto Craft

Options

Bookmark Thread

First Page First Unread Last Page Last Post

Printable Version

Similar Threads

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

Would you take profit with 500pips profit or? 26 replies

Would you take profit with 500pips profit or? 3 replies

  • Platform Tech
  • /
  • Reply to Thread
  • Subscribe
  • 82
Attachments: Manage Take Profit EA
Exit Attachments

Manage Take Profit EA

  • Last Post
  •  
  • 1 34Page 567 27
  • 1 4Page 56 27
  •  
  • Post #81
  • Quote
  • Mar 1, 2007 11:47am Mar 1, 2007 11:47am
  •  james2ko
  • | Joined Apr 2005 | Status: Member | 67 Posts
Your wish is my command..I bet you're really a "happy camper" now. Pun absolutely intended.
Attached File
File Type: mq4 BreakEvenExpert_v1-10.mq4   3 KB | 2,157 downloads
  • Post #82
  • Quote
  • Mar 1, 2007 11:56am Mar 1, 2007 11:56am
  •  happy camper
  • | Joined Jun 2006 | Status: Member | 84 Posts
Quoting james2ko
Disliked
Your wish is my command..I bet you're really a "happy camper" now. Pun absolutely intended.
Ignored
You'r da man James. Thank you,I realy appreciate your help
  • Post #83
  • Quote
  • Edited at 8:27pm Mar 7, 2007 4:01pm | Edited at 8:27pm
  •  tonygibbs
  • | Joined May 2006 | Status: I'm just pipin' | 28 Posts
Stock,

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!
  • Post #84
  • Quote
  • Mar 8, 2007 1:59pm Mar 8, 2007 1:59pm
  •  stockwet
  • Joined Mar 2006 | Status: Member | 723 Posts
I've not had that happen before. The only time it would happen is if

1) your expert gets de-initialized and then re-initialized. This could happen if you press the experts button off then on, close MT4, or get disconnected/reconnected from your account.
2) you have the EA running on a couple different charts.

If you want to send me your log file, I can take a look and see if there's anything in there that clues me in. Have you experienced that before? Can you replicate the problem?

stockwet

Quoting tonygibbs
Disliked
Stock,

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
  • Post #85
  • Quote
  • Mar 12, 2007 9:51am Mar 12, 2007 9:51am
  •  Scientist
  • | Joined Mar 2007 | Status: Programmer/Software Engineer | 531 Posts
Is it possible to include a function to close all orders (pending and active) as soon as a profit target is hit?

Thanks
  • Post #86
  • Quote
  • Mar 12, 2007 11:32am Mar 12, 2007 11:32am
  •  stockwet
  • Joined Mar 2006 | Status: Member | 723 Posts
Yes, 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.

Quoting Scientist
Disliked
Is it possible to include a function to close all orders (pending and active) as soon as a profit target is hit?

Thanks
Ignored
  • Post #87
  • Quote
  • Mar 18, 2007 11:43am Mar 18, 2007 11:43am
  •  dan921
  • | Joined Nov 2006 | Status: Member | 36 Posts
Quoting stockwet
Disliked
Yes, 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
Thanks Stockwet for this super EA, I've been using it for a few weeks now and it does almost everything I need. You mentioned in an earlier post that you could add a trailing stop, but there was no need as the broker supplied one. I trade the news and manage 3 platforms at news time, a TS on your EA would be perfect for me.

I understand that you are very busy, but if you ever do get the time I would very much appreciate it, if you can't I will carry on using this one as I've been having great success with it.
Thanks
Dan
  • Post #88
  • Quote
  • Mar 25, 2007 5:51am Mar 25, 2007 5:51am
  •  Trinity
  • | Joined May 2004 | Status: Member | 122 Posts
Quoting Scientist
Disliked
Is it possible to include a function to close all orders (pending and active) as soon as a profit target is hit?

Thanks
Ignored
Try the attached. Simply put into the EA file and attach to the chart/trade in you wish to close everything. Demo it.

Best regards
Attached File
File Type: mq4 close-all-orders.mq4   1 KB | 1,259 download
  • Post #89
  • Quote
  • Edited at 5:52pm Mar 30, 2007 5:50pm | Edited at 5:52pm
  •  jeffreytp
  • | Joined Jan 2007 | Status: Member | 344 Posts
Quoting stockwet
Disliked
Hi 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:

  1. First_Target: This is the first take profit target, in pips, that you specify.
  2. Target_Increment: Once the first profit target is reached, the next target will increment by the amount specified by the target increment variable.
  3. 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.
  4. 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.
  5. First_Stop_Target: This is the amount in pips the trade moves before your stop loss is moved to the First_Stop level.
  6. 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.
  7. Second_Stop_Target: This is the amount in pips the trade moves before your stop loss is moved to the Second_Stop level.
  8. 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.
  9. 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.
  10. Max_Loss: This is the maximum pip loss you'll accept on the trade. If set to 0, this function is disabled.
  11. 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.)

  1. 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.
  2. 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.)
  3. 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.
  4. When the trade reaches +30 pips (Second_Stop_Target), the SL is moved to Entry Price + 10 pips.
  5. 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
I 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?
  • Post #90
  • Quote
  • Mar 31, 2007 10:39am Mar 31, 2007 10:39am
  •  stockwet
  • Joined Mar 2006 | Status: Member | 723 Posts
Quoting jeffreytp
Disliked
I 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
You're looking for a trailing stop EA. You can also use the built in trailing stop feature in Metatrader.
  • Post #91
  • Quote
  • Apr 1, 2007 8:58am Apr 1, 2007 8:58am
  •  ident1714
  • | Joined Dec 2006 | Status: Member | 10 Posts
Quoting jeffreytp
Disliked
I 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
Here you go. Run this EA in one window and run the manage take profit EA in another window of the same currency pair. Just set the move stops in the manage take profit EA to "false" since you want the trailing stop EA to move them for you. Then you can just use the manage take profit EA to take profit at your pre-defined intervals.
Attached File
File Type: mq4 TrailingStop.mq4   9 KB | 1,829 download
  • Post #92
  • Quote
  • Apr 2, 2007 11:40am Apr 2, 2007 11:40am
  •  jeffreytp
  • | Joined Jan 2007 | Status: Member | 344 Posts
Okay, thanks for this.

Can you please explain the differences between TrailingStop & TrailingStep?
  • Post #93
  • Quote
  • Apr 3, 2007 5:21am Apr 3, 2007 5:21am
  •  ident1714
  • | Joined Dec 2006 | Status: Member | 10 Posts
Quoting jeffreytp
Disliked
Okay, thanks for this.

Can you please explain the differences between TrailingStop & TrailingStep?
Ignored
Once you have decided how far back you want the trail (a 10 pip trail, for example), the "trailing step" is how often it moves the stop. Setting trailing step to "1" will move the stop each tick in your direction. Setting it to "5" will only move the stop each 5 ticks in your direction.
  • Post #94
  • Quote
  • Apr 3, 2007 6:08pm Apr 3, 2007 6:08pm
  •  turbo_electric
  • | Joined Sep 2006 | Status: Member | 33 Posts
Hi 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.
  • Post #95
  • Quote
  • Apr 3, 2007 8:57pm Apr 3, 2007 8:57pm
  •  stockwet
  • Joined Mar 2006 | Status: Member | 723 Posts
It'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.

Quoting turbo_electric
Disliked
Hi 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
  • Post #96
  • Quote
  • Apr 5, 2007 2:05am Apr 5, 2007 2:05am
  •  Playmaker
  • | Joined Dec 2004 | Status: Member | 13 Posts
I 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 again
  • Post #97
  • Quote
  • Apr 5, 2007 9:09am Apr 5, 2007 9:09am
  •  stockwet
  • Joined Mar 2006 | Status: Member | 723 Posts
I don't have a version for MT3. There might be a similar one out there, but, I'm not sure.

Quoting Playmaker
Disliked
I 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 again
Ignored
  • Post #98
  • Quote
  • Apr 5, 2007 11:53am Apr 5, 2007 11:53am
  •  okie51
  • | Joined Feb 2005 | Status: Member | 11 Posts
Hello, Great expert, I also need a take profit expert for mt3 any idea where to look? Thanks
  • Post #99
  • Quote
  • Apr 18, 2007 4:10am Apr 18, 2007 4:10am
  •  schuette
  • | Joined Jan 2007 | Status: Member | 6 Posts
Quoting stockwet
Disliked
It'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
Hi 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

Tom
  • Post #100
  • Quote
  • Apr 18, 2007 10:51am Apr 18, 2007 10:51am
  •  jeffreytp
  • | Joined Jan 2007 | Status: Member | 344 Posts
Quoting schuette
Disliked
Hi 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

Tom
Ignored
I have noticed that the Max Loss function does not work. I have it set to true and the SL is also set. I am using MT4
  • Platform Tech
  • /
  • Manage Take Profit EA
  • Reply to Thread
    • 1 34Page 567 27
    • 1 4Page 56 27
0 traders viewing now
  • More
Top of Page
  • Facebook
  • Twitter
About FF
  • Mission
  • Products
  • User Guide
  • Media Kit
  • Blog
  • Contact
FF Products
  • Forums
  • Trades
  • Calendar
  • News
  • Market
  • Brokers
  • Trade Explorer
FF Website
  • Homepage
  • Search
  • Members
  • Report a Bug
Follow FF
  • Facebook
  • Twitter

FF Sister Sites:

  • Metals Mine
  • Energy EXCH
  • Crypto Craft

Forex Factory® is a brand of Fair Economy, Inc.

Terms of Service / ©2021