Manage Take Profit EA
1 2 3 ...

thread: Manage Take Profit EA

  1. #1
    Junior Member campttalexalex7's Avatar
    23

    Manage Take Profit EA

    ******************************

    Updated: 9/5/2010

    Hello all. This specialist was created. Ever since that time, MetaTrader has introduced several, many new features. This specialist is guaranteed to work with these newer variants of MetaTrader and I'm not in a situation where I can or wish to create a new specialist. Thus, read this thread at your own risk, so to speak. Happy Trading!

    ******************************



    Hi Everyone,

    I've developed a professional that is designed to help me stick to my system a little better than that which I do by myself. Use it at your own risk, however.

    The expert works by taking profit out of a trade at different take profit amounts. It moves prevent losses at levels. You have the ability to customize these parameters:First_Target: This will be the first take profit target, in pips, which you specify. Target_Increment: Once the initial profit target is reached, the next target will increment by the amount. Close_Lots: That is how many lots you would like to take out at each target. As an example, if you have 10 lots, you can take 1 lot out at each of 10 profit goals, or 5 lots out two targets at each. It is Your Choice. Move_Stops: Set to true if you would like quits to maneuver based on the First_Stop and Stop_Differential parameters. Otherwise, if you don't want stops set to false transferred automatically. First_Stop_Target: That is the sum in pips before your stop loss is transferred to the First_Stop level the trade moves. First_Stop: This may move your stop loss when a target, in pips, is reached. The amount represents the amount of pips from entry and can be postive or negative. Second_Stop_Target: This is the sum in pips before your stop loss is transferred to the Second_Stop level the trade moves. Second_Stop: This may move your stop loss when a target, in pips, is reached. The amount represents the amount of pips from entry and can be postive or negative. Use_Max_Loss: Set to true if you would like to enter your stoploss and hide your stop worth from the broker. That is the maximum reduction you'll risk on the trade. If Move_Stops is set to true it's irrelevant AND Move_Stops has been triggered. Max_Loss: This is the maximum pip reduction you'll accept on the trade. If set to 0, then this function is disabled. Magic_Number: You can use this to make sure the expert manages transactions with a distinct number that is magical. This will let you trade the same pair using different systems with this expert interfering with the take profit points of the other transaction (s). The image below represents example parameters which can be set to your specialist. I will explain each one. Assume you put a 1 lot sell order for EURUSD at 1.2100 (1.2103/1.2100 - ask/bid). (Assume a 3 pip spread.) The specialist will take.1 lots (Close_Lots), or 1/10th of this scenario's orderout at 10 pips (First_Target), or 1.2090/1.2087. After that, another profit target will increment 8 pips (Target_Increment) into 1.2082/1.2079. And another.1 lots will probably be taken out at the level. The expert continues to increment the profit target by 8 pips until the original order is shut. In this example, the maximum pips gained would be 10 (8*9), or 82 pips. (First target pips increment pips * amount of times to increment, which would change based on the original order size and the Close_Lots parameter.) When the trade reaches 15 pips (First_Stop_Target), the stop loss is going to be transferred to -5 pips (First_Stop) in the order entry price. In cases like this, the order entry price was 1.2100, therefore the new price would be 1.2105. This usually means that you'd lose 5 pips if the trade turned. Place 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 transferred to 1.2095, and you'd have a 5 pip increase if the move turned against you and stopped out you. When the trade reaches 30 pips (Second_Stop_Target), the SL is transferred to Entry Price 10 pips. If you don't need the specialist to maneuver the order's stop loss, then place the Move_Stops parameter to false. I think this works, but haven't completely tested it. In case you're wondering, why I wrote this is so that I did not need to put 5 stop loss orders in order to handle different take profit amounts. Since I don't wish to sit all the time, waiting for all these amounts to hit and I just take out a part of the order, I figured that an expert would do the thing.

    Regards,




    ** Important **
    I've discovered that if I'm in the midst of trade and make a shift to the expert parameters, then it resets everything. Here's an illustration. Let's say that I wish to take 1 lot out at 20 pips and another out at 40 pips. The price goes to 25 pips and takes out my first lot. I decide that I wish to change my stop rules to maneuver stops from breakeven to 10 pips if the price goes to 30 pips. The problem is, my take profit had incremented to await 40 pips but my initial target is set to 20. When the expert closes, it resets the incremented value. Since the price is pips and my initial target is set to 20, though the expert incremented as another target, the reset causes my next lot to be removed.

    So, if you are goals have incremented and you would like to change your relocation stops or another price, be sure to create your initial target to be the new next target that you would like to take profit out at.




    ** Upgrades **
    11/2/2006 (v2.3):Fixed bug that caused the sl var to be set to 1 when a pending order was gt; than the First_Stop_Target value. If a pending order was in, not an actual order, and also the price was higher than First_Stop_Target pips in the pending order entry, then the specialist would honor the move stops that are next skip the first, and stop target.
    1/23/2007 (v2.4):Fixed pip calculation. The old method of calculating pips could be off by 1 pip, resulting in move stops or TP. The new calculation is much more accurate.

    https://www.cliqforex.com/attachment...1091924877.mq4
    https://www.cliqforex.com/attachment...1962411674.mq4

  2. #2
    Junior Member Oxrayna's Avatar
    17
    95925Thanks. Anyway to create the Max_Loss value change just like a stop? I enjoy hiding my SL from the broker. Upon order entry, I'll decide on a sl worth and t/p worth, like 100 pips to prevent broker strikes and in case of personal injury, but I'd love to have the Max reduction move in a worth.

  3. #3
    901791 Structure (s) here is mine
    Require.5 lots profit at 30 pips (assuming 1 lot, I want to take 50 percent of place )
    In 30 pips, move stop to breakeven (First_Stop 0)

    Disregard second cease amounts.

    I think when you've got all your other factors it could be your issue. If second stop moves stops to 0 (breakeven) at 0 pips profit, then it will be screwy and kick you out of rankings. Consider setting them to amounts. Same goes with Goal increment.

  4. #4
    90179Dear Stockwt.
    Might it be possible that you please alter your ManageTPv2-4. Mq4 a bit for me .
    Would you put in a trailing stop role after the Second_Stop has occurred.
    This is going to be a user-parameter. Once the transaction proceeds and Second_Stop is executed, the stop will trail by a chosen value.
    Please?

  5. #5
    Junior Member Citizen_Logan's Avatar
    2
    90179Thanks for the EA Stockwet has made my trading thus much simpler. If someone uses this EA with a few stringent discipline you can earn money every trade, no joke in case a (entry is great ) this EA can lock in a serious return weekly. 327 pips this week. Again thanks over for sharing it at no cost.

    Roland J

  6. #6
    Junior Member beaencasa's Avatar
    5
    90179Thank you very much for you participation.

  7. #7
    90179
    Thank you for the EA Stockwet, your EA has made my trading thus much simpler. If a person employs this EA with some stringent discipline it is possible to earn money every trade, no joke if your (entry is good ) this EA could lock in a serious return weekly. 327 pips this past week. Again many thanks over for sharing it at no cost.

    Roland J
    Mate, does this EA includes a trailing stop feature, following the Second_stop is finished?

    How do you move your stop following the second _stop?

  8. #8
    Junior Member Citizen_Logan's Avatar
    2
    90179 Sorry my friend I don't think you can have it trail. After your stop your stop loss will be moved by it as far as you need into your trade though. Therefore, if you have your first stop at 35pips it'll move to break , now your next stop you're able to proceed to state and another 25pips in case your trade moved that far for a total 60 pips supporting your entrance or whatever number of pips you desire. I really hope that helps, I attached a pic of a few of my settings to get a few pairs.

  9. #9
    Junior Member campttalexalex7's Avatar
    23
    90179I realize that a lot of people ask for a stop feature. At one stage, I'd started to bring that feature into MTP. However, I realized it was a lot simpler to use one of the other really great monitoring stop experts on a different chart of the identical currency pair and have it kick in after MTP did it is part. I found it a very effective approach and used myself.

    SomedayI might really have the opportunity to add in all these great requests.

    Regards,

  10. #10
    90179Oh Dear stockwet
    Please include the trailing stop loss feature in it. . please. Your system will then turn into the ultimate commerce handling EA ever!

    I usually overlook large moves... ahhhh just if we had the monitoring stop...

  •