MQL5-SyntheticTestHarness/MQL5/Include/SyntheticTestHarness/MockTick.mqh

31 lines
1.7 KiB
MQL5
Raw Permalink Normal View History

//+------------------------------------------------------------------+
//| MockTick.mqh |
//| Synthetic Test Harness for MetaTrader 5 |
//| Institutional Architecture in MQL5 - Part 1 Series |
//+------------------------------------------------------------------+
2026-07-18 22:59:46 -03:00
#ifndef SYNTHETIC_TEST_HARNESS_MOCKTICK_MQH
#define SYNTHETIC_TEST_HARNESS_MOCKTICK_MQH
//+------------------------------------------------------------------+
//| MockTick: the atomic unit of synthetic market data. |
//| |
//| Each field is independently controllable so test scenarios can |
//| vary one dimension at a time (spread spike, price gap, error |
//| injection) without coupling to the others. |
//| |
//| Design note: spread_points is separate from the bid/ask delta |
//| to allow scenarios where spread is the variable under test, |
//| independently of the price levels. |
//+------------------------------------------------------------------+
struct MockTick
{
datetime time; // Simulated server timestamp
double bid; // Simulated bid price
double ask; // Simulated ask price
double spread_points; // Spread in points (broker convention)
int injected_error; // MQL5 trade server error code (0 = none)
};
//+------------------------------------------------------------------+
2026-07-18 22:59:46 -03:00
#endif