Работа завершена
Техническое задание
I´m looking for an experienced developer who can write a well documented code for a simple martingale/grid strategy. (EA + source code)
Entry:
There is no complicated entry logic (no indicators). The first position is entered manually by the user but every following order is initiated by the algorythm (order grid, pending orders).
However, unlike usual grid strategies the direction (long/short) of new entry orders are dependant on the market hitting either stoploss or takeprofit of the open position.
Stoploss and Takeprofit are user inputs in pips and are counted towards the real execution price.
Pending orders for the next entry use the exact same levels of stoploss/takeprofit. If a new position is opened, the entry order on the other side of the just finished trade is canceled. Then the stoploss and takeprofit for the new position and the entry orders for the next trade are initiated. (see example at bottom)
There is a martingale factor. So if the open position loses, the next position will be opened with a larger lot-size until the current position hits the takeprofit. If a position wins the next position uses the initial lot size.
There is a maximum order size (MaxLots). If the open position already has the maximum lot-size, the next position is always opened with the initial lot size (also in the losing scenario).
The EA needs the possibility for user inputs. These variables are:
- Initial Lot Size: 0.01 to 1 (1 micro to 1 standardlot)
- Maximum Lot Size: 0.01 to 100 (1 micro to 100 standardlots)
- Stoploss in Pips: 1 to 1000
- Takeprofit in Pips: 1 to 1000
- MartingaleFactor: 0.1 to 10 (0.1 means the next position is +10% bigger)
- email-adress for notifications
General conditions:
It is necessary to finalize the Expert Advisor (MetaTrader 4) to work on a real account - place all of the necessary checks, restore normal operation after a temporary disconnection, reconnection to the account, or a reset/update of the client terminal.
Also add a few attempts to open a position if there is an error. The EA will be moved to a VPS so migration must work. It must work on both 4-and 5-digit quotes (autodetect).
The EA trades each currency pair independently. So it must be possible to trade EUR/USD and GBP/USD on the same client. But there will not be multiple instances of the EA trading on the same curreny. So 1 instance per currency.
The EA gets the very first entry from the user. No Manual trading alongside the working EA is planned so it doesn´t have to be facilitated.
When you change an account, the EA should notify the user about this and stop until a new launch of the EA is executed.
If there are open positions and the external parameters (user inputs) are changed, the EA changes already existing pending orders according to the changes. However, the currently opened position will not be changed in Lot-Size.
In the case of a critical error, the EA sends an email to the users adress (input).
Example:
inputs
InitialLots = 0.01
MaximumLots = 1.00
Stop = 100 Pips
Target = 100 Pips
MartingaleFactor = 1.0
email:---
1.) Manual Entry (Buy) 0.01 Lot @ 1.0000
-> cancel all pending orders of that currency pair
-> add Sell-Stop 0.01 Lot @ 0.9900 (Stoploss)
-> add Sell-Stop 0.02 Lot @ 0.9900 ("New Entry 1" -> current Lots x (MartingaleFactor + 1) )
-> add Sell-Limit 0.01 Lot @ 1.0100 (Takeprofit)
-> add Sell-Limit 0.01 Lot @ 1.0100 ("New Entry 2" -> initial Lot Size)
2.) Market goes down to 0.9900
-> Position stop out (LOSS)
-> Order of "New Entry 1" is executed (short position of 0.02 Lot)
-> cancel all pending orders of that currency pair ("New Entry 2" gets cancelled)
-> add Buy-Stop 0.02 Lot @ 1.0000 (Stoploss)
-> add Buy-Stop 0.04 Lot @ 1.0000 ("New Entry 3" -> current Lots x (MartingaleFactor + 1) )
-> add Buy-Limit 0.02 Lot @ 0.9800 (Takeprofit)
-> add Buy-Limit 0.01 Lot @ 0.9800 ("New Entry 4" -> initial Lot Size)
And so on...
I´m looking forward to your applications with your price and timeframe.