Example B4: Intraday trading mode with forced closures at end of day
This is not a ready-to-use trading strategy. A trading strategy requires adjustment to the timeframe and symbol, along with thorough backtesting. The example is intended as a foundation for your own custom strategy and to help you get familiar with the Expert Advisor Builder web application. To import and use an example, please follow the instructions provided here.
Description
This example implements intraday trading mode with forced closures at day's end. Positions can only open between 9 AM and 6 PM, with all trades automatically closed by 9 PM regardless of profit or loss. This prevents overnight risk and swap charges while ensuring clean starts each trading day.
The forced closure feature distinguishes this from simple time restrictions. Even profitable trades must close by the deadline, preventing the temptation to hold positions overnight. This discipline proves valuable for day traders who must maintain strict separation between trading days.
Visual timing indicators show three zones: transparent for full trading, orange for exit-only periods, and red for forced closure times. This clear visualization helps traders understand exactly when the system will act, removing uncertainty from the trading process.
Recreate the Example
You can either import this example directly or set it up manually. To manually replicate the trading module, make sure a newly added module includes the following key settings and that the professional mode is activated:
Trade Basics
- Operation type = Long
Signal Generation - Indicators - STD
- Signal in use = On
- Signal used for = Forward
- Selected indicator = STD
- Draw in chart = Off
- Forward adjustment = 3.50
Signal Generation - Indicators - SMA
- Signal in use = On
- Signal used for = Entry
- Selected indicator = SMA
- Draw in chart = On
- Drawing slot = 1
Signal Generation - Indicators - EMA
- Signal in use = On
- Signal used for = Entry
- Selected indicator = EMA
- Draw in chart = On
- Drawing slot = 2
Signal Generation - Indicator Combinations (SMA & EMA)
- Signal in use = On
- Signal used for = Entry
- Input indicator 1 = SMA
- Input indicator 2 = EMA
- Value relation = Value x cross value x
Initial Stop Loss
- Selection = Indicator
- Used indicator = STD
Initial Take Profit
- Selection = Risk ratio
- Risk ratio = 1.40
Timing
- Visualize timing = On
- Intraday mode = 09:00:00
- Start intraday trading = 18:00:00
- Deadline intraday trading = 21:00:00
- Intraday mode = On
Volume Calculation
- Volume calculation method = Fix lots
- Fix lots = 0.10
Screenshots
