Hi,
I wanted to test my strategy on stock and had to changed the demo account, using VantageFX-demo account.
Had to switch the filling_type to SYMBOL_ORDER_MARKET and then I got the "Market closed" error on order execution. With other order types is got "unsupported filling type".
I can't seem to find an explanation to why is it actually trying to execute the order on the account? As all I need is to use the demo account for data. Am I missing some checkbox to tell backtester to simulate the orders?
Best Regards,
Hendrik
The Strategy Tester of course doesn't try to open real orders. If you get market close error that's because you are trying a trading operation when the market is closed according to trading hours (with ST simulated time). Check your symbol settings and fix your code accordingly.
The Strategy Tester of course doesn't try to open real orders. If you get market close error that's because you are trying a trading operation when the market is closed according to trading hours (with ST simulated time). Check your symbol settings and fix your code accordingly.
Makes sense, tho I can't seem to find a sensible way to change the session time. Original symbol did not allow me to set the session time values.
I tried to make a custom symbol which allows changing session time, used AAPL. Then I exported original AAPL data and imported to my custom AAPL2 symbol. When I try to use the custom symbol then it is not able to find the data, tho I double checked that I got the correct timeframe.
There must be a simpler way?
Yes, but I need backtesting to be able to simulate the orders, even in the weekend.
Actually, I would expect the backtester not to be affected by the session time at all, as it is not going to do any trades on the live market anyway.
When I use the MetaQuotes-Demo account and do backtesting on currencies, even in the weekend, everything works out of the box, but when I try to use VantageFX-demo account for stock data, then it says Market Closed and backtester does not do any trades.
You can back test on weekends or anytime you want, but the Strategy Tester does not use the Live Time, but the simulated testing time based obviously on Quotes Session Times, of which there are simulated Trade Session Times that your EA has to check and adhere to, as if it were trading on a live account.
Obviously, different brokers and different account types and different symbols use different Quotes and Trade Session Times.
This subject has already been discussed several times here on the forum, so please do a search and read up on the other threads as well.
Forex time and Backtest operations during Weekends - https://www.mql5.com/en/forum/371144
Please help - "Market closed" in Strategy Tester - https://www.mql5.com/en/forum/369755
Yes, but I need backtesting to be able to simulate the orders, even in the weekend.
Actually, I would expect the backtester not to be affected by the session time at all, as it is not going to do any trades on the live market anyway.
When I use the MetaQuotes-Demo account and do backtesting on currencies, even in the weekend, everything works out of the box, but when I try to use VantageFX-demo account for stock data, then it says Market Closed and backtester does not do any trades.
You are still mixing live chart/trading and the Strategy Tester which is completely simulated trading. However the Strategy Tester by default use the same settings as the real ones. You get the "Market close" error because on a live trading you would get the same error at that given time.
FIX YOUR CODE.
I think to have risolved this issue with a Sleep function after the condition of trade is true.
if (condition)
{
Sleep(32400000);
.......go on with code.....
In this case, the backtest is on daily time frame, I added 32400000 millisecond after midnight, so the tester starts to backtest during open session.
It works on daily, weekly, but not monthly, perhaps because every month doesn't start the same, i think.

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi,
I wanted to test my strategy on stock and had to changed the demo account, using VantageFX-demo account.
Had to switch the filling_type to SYMBOL_ORDER_MARKET and then I got the "Market closed" error on order execution. With other order types is got "unsupported filling type".
I can't seem to find an explanation to why is it actually trying to execute the order on the account? As all I need is to use the demo account for data. Am I missing some checkbox to tell backtester to simulate the orders?
Best Regards,
Hendrik