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

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