This is something similar on CodeBase -
-----------
Pending orders by time - expert for MetaTrader 5
The Expert Advisor works with pending orders: it sets Buy Stop and Sell Stop at the specified time. Pending orders are set with the Stop Loss. The EA uses virtual Take Profit, i.e. it monitors open positions, and when the current position profit reaches Take Profit, the EA closes it by market.
-----------
Pending orders by time 2 - expert for MetaTrader 5
Modification of the Pending orders by time EA: now you can set either a permanent (Lots > 0 and Risk ==0) or dynamic lot (Lots == 0 and Risk > 0). Added trailing.
This is more like that -
-----------
TimeEA - expert for MetaTrader 5
A Simple Expert Advisor The EA opens a position of the specified type at the time specified in the EA parameters. The position is closed at the time specified in the appropriate parameter.
Thanks so much. I've tested it and it works great however I can't set a specific date on it for instance tomorrow(I can set the time but not the date). Have you an idea on how to setup this kind of order or maybe there is a different EA for that?
I do not know sorry ..
Please look into the time structure it incorporates what you need.
struct MqlDateTime { int year; // Year int mon; // Month int day; // Day int hour; // Hour int min; // Minutes int sec; // Seconds int day_of_week; // Day of week (0-Sunday, 1-Monday, ... ,6-Saturday) int day_of_year; // Day number of the year (January 1st is assigned the number value of zero) };
You can literally make it do what you need.
Please see: https://www.mql5.com/en/docs/constants/structures/mqldatetime

- www.mql5.com
Additionally you can incorporate the calendar control so that it becomes easy to pick your dates.

- www.mql5.com

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hey,
Does anyone how to setup a program which would buy at current market price but at a specific time. For instance buy EURUSD on this day at 8AM with a stoploss and take profit with X amount of basis points?