Forex time and Backtest operations during Weekends

Lucas Tavares  

Hi, I'm new to Forex, and I'm adapting my Day-trade EA to Swing trade on Forex (Exness Broker).

What I know is that Forex closes during weekend, right? I don't really understand if I can't operate during weekends.

If so, That would result on false results and reports while I'm doing backtests. As the EA might catch operations during "closed time".

Which leave me thinking on :

  •  On backtest my EA will do operations during the closed time of the market?
  • How to avoid EA operations during Weekends on backtest/live ?

  • When Forex closes for operations, and when it returns? 


The original Day-trading versionstop operating 1 hour before the market closes and closes all positions 10 minutes before market closes every day.

Now I wish to make a Swing Versionthat keeps all the position as long as it's needed, even if the market is closed (Is that possible?).

My Idea is to make it stop operating before the closing time, and back after the open time. Is that the Way?


Thanks.

Fernando Carreiro  
Lucas Tavares: Hi, I'm new to Forex, and I'm adapting my Day-trade EA to Swing trade on Forex. What I know is that Forex closes during weekend, right? I don't really understand if I can't operate during weekends. If so, That would result on false results and reports while I'm doing backtests. As the EA might catch operations during "closed time". Which leave me thinking on :
  •  On backtest my EA will do operations during the closed time of the market?
  • How to avoid EA operations during Weekends on backtest/live ?
  • When Forex closes for operations, and when it returns? 

The original Day-trading versionstop operating 1 hour before the market closes and closes all positions 10 minutes before market closes every day. Now I wish to make a Swing Versionthat keeps all the position as long as it's needed, even if the market is closed (Is that possible?). My Idea is to make it stop operating before the closing time, and back after the open time. Is that the Way?

Have you ever run a back-test of any type of EA in the Strategy Tester on Forex symbols? If so, have you done it in visual mode?

What did it do during weekends? Did you notice that there was no data or activity during the weekends in those tests?

Did you notice that the chart just jumps from the last bar on Friday to the first bar on Monday? There might be some data going into Saturday morning, or maybe data starts again during Sunday evening, but that is because of the different timezone that brokers use.

All open trades at the end of the week will remain open until the beginning of the week, and then just continues as if nothing happened.

Also, in recent builds of MT5, in now respects session trading times and blocks trading operations when session is closed, even if data is still available, such as during those times that brokers are calculating swaps.

In general, the Strategy Tester behaves and simulates the equivalent scenarios of live trading.

Lucas Tavares  

So it was a misconception of mine!

I thought the market would only avoid negotiation but still appearing candles and candles. Like, it was happening opportunities, but i couldn't get it until it "opens" again.

So every candle is a operable candle?


So, i must clean all the restrictions to close/stop operating ?



I did run backtest but with this restriction i said, about stop Friday x hour, and back at Monday, but i believe it totally wrong by now!

Thanks!!!

Fernando Carreiro  
Lucas Tavares: So every candle is a operable candle? So, i must clean all the restrictions to close/stop operating?

No, not every candle is tradable! Just as I wrote, there times on any symbol, not just Forex, that no trading is allowed. When you pull up the contract specifications for a symbol, you can see at which times the sessions close for trading.


You should use the MQL function SymbolInfoSessionTrade() to obtain data about these sessions and prevent your EA logic from trying to place orders or manage existing positions during those periods.

Also, the only reasons to close positions on a Friday night and open them again on a Monday morning, is if you wish to manage opening weekend gaps or reduce swap costs. If you are trying to reduce swap costs, then you would also need to close positions a few minutes before midnight and reopen them again a few minutes after midnight every day of the week. This is especially important on Wednesday night where triple-swaps are applied.

Fernando Carreiro  
Lucas Tavares: So my main idea was right after all. I will make it stop operaring on friday, and back to operate on monday

It depends. If the average volatility or price movement during that period is larger than the swap-costs, you may actually lose out if you close the positions to prevent the swap costs.

Sometimes, it is better to just leave them open and assume the swaps if the price movement during that period is more advantages. It all depends on the symbol and its volatility and behavior during those periods.

Lucas Tavares  
Fernando Carreiro:

It depends. If the average volatility or price movement during that period is larger than the swap-costs, you may actually lose out if you close the positions to prevent the swap costs.

Sometimes, it is better to just leave them open and assume the swaps if the price movement during that period is more advantages. It all depends on the symbol and its volatility and behavior during those periods.


By "stop operating" I mean stop trying to enter or leave operarion during weekend, and keep The position until trigger a New operation while The market is open.
Fernando Carreiro  
Lucas Tavares: By "stop operating" I mean stop trying to enter or leave operarion during weekend, and keep The position until trigger a New operation while The market is open.

Ok, understood! You mean not operating during session quote times when no trading is allowed.

Reason: