İş tamamlandı
![](https://c.mql5.com/i/avatar/avatar_na2.png)
![](https://c.mql5.com/i/avatar/avatar_na2.png)
İş Gereklilikleri
Will need the Expert Advisor (EA) source code in MQL5 (runs Metatrader 5) for the below description. It is only for long-direction. Will need it to be tested to make sure the code running on Forex pairs without any issues or errors, and that it follows the logic described in each input. If there are any questions please text me anytime to make this experience as good as possible!
The below text in Bolt font are the inputs needed. A
Assumption: The trading accounts equity is $500
Inputs for Long Direction: the numbers used in the inputs below are examples and are applied on other inputs to make the logic clearer and for calculations purposes
Distance to place buy stop order(s) from current bid-price in points: i.e 100 points (10 pips
Explanation: Once the EA is loaded, the first buy stop order is automatically submitted at a distance of i.e 100 points from the market price (bid price). If the EA is then disabled, the metatrader user will have to remove the order manually.
Number of times to repeat the above buy stop order: i.e 4
Explanation: So if first order is filled, then the strategy adds a second buy stop order that is 100 points above the market price (bid price). This process repeats up to 4 times in this example)
Stoploss: i.e. 150 points (fixed distance)
Explanation: The stoploss is automatically inputted when the order is filled and is at a fixed distance of i.e 150 points below the current market price (bid price)
TrailingStop amendment move: i.e. 130 points
Explanation: when the buy stop order is filled due to market moving higher, then if the market price rises higher by another i.e 130 points from long entry price, then the TrailingStop moves according to below input. Once it rises, the market price then needs to move higher by another 130 points so that the TrailingStop moves higher for a second time, and then another 130 points e.t.c)
TrailingStop’s new Stoploss distance from current price: i.e. 70 points
Explanation: When the TrailingStop of an existing long position is to be amended due to the market moving higher by i.e 130 points (according to the input above this one), then the TrailingStop’s new Stoploss is to be 70 points below the market price (bid price) at the time the amendment is made. This fixed distance of 70 points repeats for all TrailingStop amendments following the 130 points moves.
Risk per each trade applied to current equity balance (used to calculate position size per trade): i.e 1%
Explanation: 1% is $500 of equity in the account, so the risk is $5 per trade and since the Stoploss is set to be 150pts, then the position size is automatically calculated to be $5/150 = 0.03 rounded to nearest second decimal.
Additional inputs:
Price level:
Place order only if current-bid price is below this price level: i.e 1.11235
Explanation: if the market price is above this price, no buy stop-order is placed, can still enter manually and stoploss/trailstop can still operate on the manual entry, any positions from this EA that are open remain open). Also we need to add the option to close all positions and open buy stop orders if this input occurs
Place order only if current-bid price is above this price level: i.e 1.11000 (if the market price is below this price, no buy stop-order is placed, any positions from this EA that are open remain open). Also we need to add the option to close all positions and open buy stop orders if this input occurs
Equity rule:
Current account’s equity must be below this level: i.e. $650
Explanation: if the account’s equity rises from say $500 to $650 then no more buy stop orders to be placed, stop/trailing stops still active). Also we need to add the option to close all positions and open buy stop orders if this input occurs
Current account’s equity must be above this level: i.e. $400
Explanation: if the account’s equity drops from say $500 to $400 then no more buy stop orders to be placed, stop/trailing stops still active). Also we need to add the option to close all positions and open buy stop orders if this input occurs
There are a few more additions that will be added on the formal requirements specification file. Only the selected developer will be able to see that.