The Trading Session options work for gen.js and mm.js.
The Trading Session options limit the time the Strategy opens new positions. The position closing is not restricted.
We call the trading day a “session”.
The options session_open and session_close set the times of day when the strategy is allowed to open positions.
We use these options in two cases:
The friday_close option sets when we want to stop trading at the end of the trading week.
It is a separate option because brokers have different Friday closing times depending on their time zones.
The trade_on_sunday option determines whether we trade on Sunday evening.
It is useful if the broker starts the trading on Sunday (usually around 22:00) and uses higher spreads.
The close_at_session_close and close_at_friday_close options force the strategy to close positions at the end of the trading day or at the end of the week.
These are the default options:
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Trading Session ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; session_open = 00:00 session_close = 24:00 friday_close = 24:00 trade_on_sunday = true close_at_session_close = false close_at_friday_close = false
The Trading Session options work in the exported Expert Advisors in the trading and testing modes.
Set the Trading Session options in EA Studio to reproduce the same backtesting results. We need to do it because EA Studio has the Trading Session options at the application level and does not import them from the Strategy or from an exported Expert Advisor.