IC Markets

Define Your Trading Session Windows in Advance

Master exponential money management, position sizing calculators, strict daily stop-loss limits, and overcoming FOMO on micro-timeframes.
FTtrader
Posts: 273
Joined: Mon Aug 03, 2026 2:43 pm

Re: Define Your Trading Session Windows in Advance

Post by FTtrader »

Key Differences from MQL:

Native Time Math: C#'s TimeSpan naturally understands hours, minutes, and seconds. A simple >= operator evaluates the entire time structure instantly without needing custom minute-conversion logic.

Initialization Parsing: We take a clean string input from the user ("08:00") and parse it once inside OnStart(). On every tick, the EA only compares pre-compiled objects, keeping latency near zero.

Time Zone Pinning: Notice the [Robot(TimeZone = TimeZones.UTC)] header? That guarantees your Server.Time reference remains constant. Backtesting in cTrader defaults to UTC, so locking your bot to UTC ensures your historical tests align perfectly with forward execution.
Post Reply