Tâche terminée
Spécifications
MT4 (MQL4) Script:
The script can be dragged and dropped on to the relevant chart, where the information / input box will pop up
It will open a specified number of pending limit or stop orders, all buy or all sell. Maximum of 10 of each per pair.
Pips distance between each order can be specified (can be the same for first pending order entry above / below market, and each order spacing after that). For example if 50 pips was specified here as a limit order spacing, the first limit would be placed 50 pips from market price plus spread, the second limit 50 pips from the first order, the third at 50 pips from the second order and so on.
Each order can be managed by an EA via magic number or comment if required
Must be able to specify a hard stop loss location for all orders (in pips). The SL will be based on distance from market price at the time the script is executed, not from each pending order location, so the SL will be at the same price level for all orders.
I must be able to specify percent of account balance to allocate to each combined script of orders. The script will calculate the nearest micro lot size for each script order, based on the pip value for the pair, the number of pips distance between the individual order and the specified SL level. For example if I specify an allocation of 2%, and 4 limit orders, the script will split the 2% in to 0.5% for each order, then calculate the position size for each order as mentioned above. The closer each order is to the SL, the larger the position size will be to meet the allocation split. If any of the theoretical order position sizes would be less than 0.01, then the script will override the original percentage split for the affected individual order, and select the nearest smallest lot size (0.01) and raise a warning to ask for confirmation to proceed to use the minimum 0.01 with increased risk.
Once the orders are placed on the chart by the script, they can be modified manually (closed / deleted / moved) individually as necessary.
The same script can be used to place a set of limit orders and a set of stop orders separately, on the same chart without causing any conflict.
The same script can be used to execute limits / stops on any number of pairs / charts without conflict.
I will consider any more suggestions to make this script more robust.
Thanks