Files
Bell-PriceActionWithEma-EA/Experts/EA_ICT_CL/State.mqh
T

83 lines
1.4 KiB
Plaintext
Raw Normal View History

2026-03-10 13:47:42 +07:00
#ifndef EA_ICT_CL__STATE_MQH
2026-03-10 20:39:33 +07:00
#define EA_ICT_CL__STATE_MQH
2026-03-10 13:47:42 +07:00
enum EAState
{
2026-03-10 20:39:33 +07:00
EA_IDLE,
EA_WAIT_TOUCH,
EA_WAIT_TRIGGER,
EA_IN_TRADE
2026-03-10 13:47:42 +07:00
};
2026-03-10 22:21:59 +07:00
enum MarketDir { DIR_NONE=0, DIR_UP=1, DIR_DOWN=-1 };
2026-03-10 13:47:42 +07:00
enum BlockReason
{
2026-03-10 22:21:59 +07:00
BLOCK_NONE, BLOCK_SESSION, BLOCK_DAILY_LOSS, BLOCK_NO_TREND
2026-03-10 13:47:42 +07:00
};
enum FVGStatus
{
2026-03-10 20:39:33 +07:00
FVG_PENDING,
FVG_TOUCHED,
FVG_USED
2026-03-10 13:47:42 +07:00
};
struct TFTrendContext
{
2026-03-10 20:39:33 +07:00
MarketDir trend;
double h0, h1, l0, l1;
int idxH0, idxH1, idxL0, idxL1;
double keyLevel;
datetime lastBarTime;
2026-03-10 13:47:42 +07:00
2026-03-10 20:39:33 +07:00
datetime lastMssTime;
double lastMssLevel;
MarketDir lastMssBreak;
double mssSLSwing;
2026-03-10 13:47:42 +07:00
};
struct FVGRecord
{
2026-03-10 20:39:33 +07:00
int id;
FVGStatus status;
int usedCase;
MarketDir direction;
double high, low, mid;
datetime createdTime;
datetime touchTime;
datetime usedTime;
MarketDir triggerTrendAtTouch;
2026-03-10 13:47:42 +07:00
2026-03-10 20:39:33 +07:00
datetime mssTime;
double mssEntry;
double mssSL;
2026-03-10 13:47:42 +07:00
};
struct OrderPlan
{
2026-03-10 20:39:33 +07:00
bool valid;
int direction;
double entry, stopLoss, takeProfit, lot;
int parentFVGId;
2026-03-10 13:47:42 +07:00
};
2026-03-10 23:43:41 +07:00
struct OrderHistRecord
{
int id;
int direction;
double entry, stopLoss, takeProfit, lot;
datetime signalTime;
datetime closeTime; // 0 nếu đang active
int result; // 0=active, 1=TP hit, -1=SL hit, 2=cancelled
double profit;
int parentFVGId;
};
2026-03-10 13:47:42 +07:00
struct DailyRiskContext
{
2026-03-10 20:39:33 +07:00
double startBalance, currentBalance;
datetime dayStartTime;
bool limitHit;
2026-03-10 13:47:42 +07:00
};
2026-03-10 20:39:33 +07:00
#endif