Работа завершена
Техническое задание
Hi,
Would like to order an MQL5 Expert script to perform the following.
At the date/time specified open a buy and a sell pending order, which entry points are defined by the last X minutes of activity (based on high/low). All this is based on M1 time frame. If either order is filled, the other order is cancelled. Also the ability to cancel both orders if neither is filled within XX time.
Variables (Example only)
Variable |
Definition |
u_EntryTime |
UserInput: This is the date/time that the buy/sell trade will open. eg "17.11.17 22:30" |
u_CurrencyPair |
UserInput: What currency pair the trade should be against. eg. "AUDUSD" |
u_EntryTimeHistory |
UserInput: Number of points to read up to the u_EntryTime (Eg is set to 2, then read the high/low from 17.11.17 22:29 & 22:28). |
i_HighPoint |
InternalVar: the High from the EntryTimeHistory |
i_LowPoint |
InternalVar: the low from the EntryTimeHistory |
i_BuyAt |
InternalVar: This is the entry point for the Buy order eg. i_StopLossHigh + u_EntryLevelPips |
i_SellAt |
InternalVar: This is the entry point for the Sell order eg. i_StopLossLow - u_EntryLevelPips |
u_ProfitPips |
UserInput: Take profit level (eg 100) |
i_BuyProfit |
InternalVar: Exit point for Buy Profit (i_BuyAt+u_ProfitPips) |
i_SellProfit |
InternalVar: Exit point for Sell profit (i_BuyAt+u_ProfitPips) |
u_EntryLevelPips |
UserInput: Value above Stop Loss to entry the market at; eg 10 |
u_CloseIfNotOpened |
UserInput: Close all trades after XX minutes if orders are still pending eg. 5 = if neither order has been filled after 5 mins, close them both. |
u_Volume |
UserInput: Trade volume eg 0.01 |
u_StopLossPips |
UserInput: The stoploss adjuster eg 10 |
i_StopLossHigh |
InternalVar: i_HighPoint+u_StopLossPips |
i_StopLossLow |
InternaVar: i_Lowpoint-u_StopLossPips |
|
Conditions
- If either buy or sell is completed, then close the other pending trade.
- If neither are opened after u_ClosedIfNotOpened then close both pending trades.
- Must be able to work with JPY as well
Would like the ability to be able to input multiple trades, eg if there were 5 in a day or the same trade against multiple currencies at the same.
I have attached a basic spreadsheet with how the calculations should work, please let me know if you have any questions at all. The spreadsheet is only basic and only works for AUDUSD (doesn't work for JPY).