forex software

Create and Test Forex Strategies

forex software

express-generator:trading-session

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

express-generator:trading-session [2023/07/04 17:18] – created Miroslav Popovexpress-generator:trading-session [2026/02/21 11:17] (current) – Created "Trading Session" article Miroslav Popov
Line 1: Line 1:
-====== Trading session ======+====== Trading Session ====== 
 + 
 +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: 
 + 
 +  * to prevent entries around midnight if the broker suspends the trading due to "swap calculations"
 +  * to prevent high-spread entries if the broker increases the spreads near the start and end of the trading day. 
 + 
 +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:
  
 <code ini> <code ini>
Line 16: Line 39:
 </code> </code>
  
 +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.