Trabalho concluído
![](https://c.mql5.com/i/avatar/avatar_na2.png)
Termos de Referência
I want an EA that does the following:
When I turn it on, I insert a level price into it, which I will call “Anchor”;
Anchor will be Bid price or “near to it”. Thus I will insert it manually.
Immediately, the EA places a SELL STOP order at Anchor -50*;
E.G.
Anchor = 1.50500 SELLSTOP at 1.50450
* this "50"value should be customizable too. "Distance"
> IF MARKET GOES UP
The pending SELLSTOP order moves along with the market always respecting the distance; it moves dynamically updating the order price as the currency price moves based on a trailing parameter (distance) entered by trader.
Assuming the distance is 50:
If Anchor(market) = 1.50510 then SELLSTOP = 1.50460
If Anchor (market)= 1.50511 then SELLSTOP = 1.50461
And so on and so forth…
If possible, all trailing entry orders should be an actual pending order, not just an indicator line on the chart. This is in case the connection is lost with the server and the EA no longer has control. This will ensure the last trailing order is still in place as a static stop loss order and will protect any currently open order.
Hopefully this can be accomplished by the EA actually placing pending orders thus changing it with every tick as the order needs to trail the price. (if this is too much for the EA then other options can be considered).
>IF MARKET GOES DOWN
If market goes down and executes the pending order… reaching a Profit of let’s say 30 points… it readjusts the StopLoss from 50points to 10points… not zero. (Must be informed by trader)
If after this, Market goes Up again, and executes the stoploss…
… place another pending order at “Anchor -50” AGAIN. (The original point of first order)
… if cannot place another pending order because market plummeted below Anchor-50… sends a Market Sell Order.
-----
In a nutshell: Anchor gets always updated up. If it goes
under Anchor – 50 (or Anchor-5 in 4 digit) we’re shorting the instrument.
We’re ALWAYS with a pending order, or an active order.
The EA must have some features:
1. To be able to do it in both directions, which I can choose and select before running it ( SELLSTOP or BUYSTOP)
2. To have customizable:
Anchor // which first is defined by me and then it floats with the market bid price or ask price depending on which mode is working.
Distance //
Slippage
Stoploss
TakeProfit
MagicNumber
etc.
3.Should Alert trader at all moments what is doing:
Alert("moving up") Alert("moving down") etc
Could you do it?