Техническое задание
If possible the EA should be made for both MT4 and MT5
The EA should not place an order if I didn't place an order manually.
The EA will place one averaging order at a time. Only one limit order can be placed.
If the order is executed the next averaging limit order will be placed instantly.
The TP of each averaging order will be placed based on 1.5 times the difference between the orders. Ex. The first order was placed at 1800.50, the next averaging order was be placed at 1780.50, the Take Profit will be at 1810.50.
If a TP on an or der has been triggered the EA will automatically and instantly place another order at the same price as before, after deleting the any pending orders that were previously placed by the expert.
This should be repeated as long as the manual trade is not closed. If the first manual trade is closed, all pending orders should be deleted and no new pending orders should be placed.
There should be a place where I enter how many orders the averaging EA will place ( for example it will not average more than 5 times).
I will also place the lot size and distance from the previous order of each averaging order separately, for example for the first order I will choose the size and distance in the input tab, these may be different than the next order.
All pending orders and averaging orders will have the same SL as the main order, if the SL order of the manual orders was changed, all the other pending orders and averaging orders will change as well.
I will be using the expert on instruments with 2 digits, 3 digits, 4 digits and 5 digits. This means if slippage occurred, the expert should move on to the next averaging order without duplication.
Looking for the source code as well that contains a comment on each line that explains what the code line accomplishes.