update to my mt5 libs to include better comments

This commit is contained in:
Matt Corcoran
2025-07-12 15:29:30 +02:00
parent ec3fc120ce
commit 136522ef1c
31 changed files with 1389 additions and 2024 deletions
+17
View File
@@ -12,6 +12,23 @@ public:
bool trade_window(string t1, string t2, string time_zone = "Broker", bool plot_range_inp = true);
};
// ---------------------------------------------------------------------
// Determines whether the current time is inside a defined trade session.
//
// Parameters:
// - t1 : Start time string (e.g., "22:00").
// - t2 : End time string (e.g., "01:00").
// - time_zone : The timezone of input times (default = "Broker").
// - plot_range_inp : If true, draws vertical lines for start/end.
//
// Returns:
// - true if current time is within the session window, false otherwise.
//
// Logic:
// - Handles overnight sessions (e.g. 22:0001:00) correctly.
// - Automatically rolls the window to the next day when expired.
// - Uses TimeZones class to convert time to broker timezone.
// ---------------------------------------------------------------------
bool TradeSessionUtils::trade_window(string t1, string t2, string time_zone, bool plot_range_inp) {
datetime _t1 = StringToTime(t1); // Convert string to datetime
datetime _t2 = StringToTime(t2); // Convert string to datetime