2025-09-25 00:25:48 -04:00 | | | //+------------------------------------------------------------------+
|
| | | //| Test_GateManager.mq5 |
|
| | | //| Unit test for CGateManager |
|
| | | //+------------------------------------------------------------------+
|
| | | #include <Trade\Trade.mqh>
|
2026-02-05 23:31:20 -05:00 | | | #include "..\\Include\\IStrategy.mqh"
|
2025-09-25 00:25:48 -04:00 | | | #include "..\\Include\\GateManager.mqh"
|
| | | #include "..\\Include\\LearningBridge.mqh"
|
| | |
|
| | | input int Verbosity = 2;
|
| | |
|
| | | void OnStart()
|
| | | {
|
| | | Print("[Test] CGateManager: BEGIN");
|
2026-02-05 23:31:20 -05:00 | | | CLearningBridge *learning = new CLearningBridge("TestData", 100);
|
| | | CGateManager gm(false, false, false);
|
2025-10-03 01:39:11 -04:00 | | |
|
2026-02-05 23:31:20 -05:00 | | | // Build a sample signal using TradingSignal from IStrategy.mqh
|
2025-10-03 01:39:11 -04:00 | | | TradingSignal signal;
|
2026-02-05 23:31:20 -05:00 | | | signal.strategy_name = "TEST_SIGNAL";
|
2025-10-03 01:39:11 -04:00 | | | signal.symbol = _Symbol;
|
| | | signal.timeframe = _Period;
|
| | | signal.timestamp = TimeCurrent();
|
2026-02-05 23:31:20 -05:00 | | | signal.entry_price = SymbolInfoDouble(_Symbol, SYMBOL_BID);
|
| | | signal.direction = 1; // Buy
|
| | | signal.stop_loss = signal.entry_price - 100 * _Point;
|
| | | signal.take_profit = signal.entry_price + 200 * _Point;
|
2025-10-03 01:39:11 -04:00 | | | signal.confidence = 0.75;
|
2025-09-25 00:25:48 -04:00 | | |
|
2026-02-05 23:31:20 -05:00 | | | Print("PASS: TradingSignal created successfully");
|
2026-02-24 12:48:15 -05:00 | | |
|
| | | // Clean up to prevent memory leak
|
| | | delete learning;
|
| | |
|
2025-09-25 00:25:48 -04:00 | | | Print("[Test] CGateManager: END");
|
| | | }
|