Tâche terminée
Spécifications
I need an Expert Advisor for MetaTrader 4. Trading on a single currency. Closing of positions - by the SL, TP, and by a reverse signal. All positions are accompanied by a trailing stop. The lot is calculated as a percentage of the balance. The most preferred currency would GBPUSD.
1) Signal to open a position:
a) A buy-position is opened if the currency increases by more than 0.00002 (example: if GBPUSD was 1.22021, and it increase to more than 1.22023);
b) A sell-position is opened if the currency decreases by more than 0.00002 (example: if GBPUSD was 1.22023, and it decreases to more than 1.22021);
2) StopLoss (SL) and TakeProfit (TP) - are fixed at 4 pinps , but can be adjustable by the parameters StopLoss and TakeProfit (example: in a BUY position if GBPUSD was 1.22023, and it increase to more than 1.22027, it should take profit; in the other hand, in a BUY position if GBPUSD was 1.22027, and it decrease to more than 1.22023, it should stop loss)
a) The levels are specified in points of 4-digit quotes;
b) The levels are calculated relative to the price of opened position (the Ask price - for the long positions and the Bid price - for short positions);
c) If the value is too low, the stop should be set at a minimum allowed distance;
3) Subsequent buy positions should be automatically initiated when the position continues to increase (in the same direction) and after 4 pinps. The lot of the new buy position should be calculated taking into consideration the profit taken at 4 pinps. This should continue to do so onwards. (example: if GBPUSD was 1.22023, and it increase to more than 1.22027, the current position is closed and a new buy position is initiated from that same point of closed position but with an increased value from the 100% of profit taken from the last position);
4) Subsequent sell positions should be automatically initiated when the position continues to decrease (in the same direction) and after 4 pinps. The lot of the new sell position should be calculated taking into consideration the profit taken at 4 pinps. This should continue to do so onwards. (example: if GBPUSD was 1.22027, and it decrease to more than 1.22023, the current position is closed and a new sell position is initiated from that same point of closed position but with an increased value from the 100% of profit taken from the last position);
5) The position volume is calculated in the following order: Lot= equity amount (this will be specified) * allowed leverage, where:
a) Equity amount – to be specified, a window to insert must be provide;
b) MarginRequired - the margin required to open a position with a size of 1 lot;
c) Allowed leverage – this depends on the pair and brokers. (Example with IC market GBPUSD 1:500).
6) All of the open positions are accompanied by trailing stop:
a) If a buy-position or sell-position is opened, the trailing stop is activated once it trails by 0.00004 points respectively.
7) Moving the SL is permitted only in the direction of profit of the position - up for long position and down for short position;
a) If you cannot set the SL at the level of the line, it should be set at the minimum allowable distance (but only if it complied with the previous rule of moving in the direction of the profit);
b) The trailing stop feature should be configurable (AllowTrailing = true/false parameter).
8)
If
there is an opened position, and there is a opposite signal, the opened
position must be closed and a new one must be opened (in the opposite
direction).
For a new position the calculation of the lot must be called after closing
the opened position.
9) Miscellaneous:
a) When you run the Expert Advisor, it should attach the used indicators with the specified parameters;
b) The information on the opening/closing of positions and of modifications of the SL should be stored in the Journal;
c) If there are any errors, it must print a message describing the error.
d) It must have a start button
e) It must have a stop button
f) It must have a window to introduce the equity amount (from which it is calculated the lot amount when multi[plied by the leverage)
g) It must show the profit/loss status