2026-02-15 05:13:55 +00:00 | | | #ifndef MARKET_STATE_MQH
|
| | | #define MARKET_STATE_MQH
|
| | |
|
| | | void UpdateModeAndState()
|
| | | {
|
| | | bool stack_bull = (MA_Current[0] > MA_Current[1] && MA_Current[1] > MA_Current[2] && MA_Current[2] > MA_Current[3]);
|
| | | bool stack_bear = (MA_Current[0] < MA_Current[1] && MA_Current[1] < MA_Current[2] && MA_Current[2] < MA_Current[3]);
|
| | |
|
| | | double ma_gap_points = MathAbs(MA_Current[0] - MA_Current[3]) / _Point;
|
| | | bool low_trend_energy = (Current_ADX < 16.0 || ma_gap_points < 80.0);
|
| | |
|
| | | if((stack_bull || stack_bear) && Current_ADX >= 20.0)
|
| | | Current_Mode = MODE_TRENDING;
|
| | | else if(low_trend_energy)
|
| | | Current_Mode = MODE_CHOP;
|
| | | else
|
| | | Current_Mode = MODE_RANGING;
|
| | |
|
| | | if(Active_Praise_Signals >= Active_Warnings + 2)
|
| | | Current_State = STATE_CONTINUATION;
|
| | | else if(Active_Warnings >= Active_Praise_Signals + 2)
|
| | | Current_State = STATE_REVERSAL;
|
| | | else
|
| | | Current_State = STATE_PULLBACK;
|
| | |
|
EA: sync live build (Jul-Nov 2026) — trade report direction/setup fix, VZ indicators, risk modules
- AIGateway/profitgtx: report_trade takes direction and setup from the position's
opening deal ("dir_src":"entry"); the closing deal inverted every direction and
restarts lost the setup (99% "auto")
- add MATheory, RiskGuards, RiskSizing, TradePolicy (setup blocklist, strict AI gate)
- add VZ_Core + VZ_Features/MFIB/Regime/Setups/Sessions indicators, VZ_FeaturesExport
service, VZ_DumpMA, VZ_TogglePause
- margin-aware sizing, news, labels and session updates since 2026-07-14
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-04 13:48:22 -06:00 | | | // MA theory: state from the 7/14/21 stack relative to the 21x50 trend (MATheory.mqh)
|
| | | if(Use_MA_Theory && MAT_State_From_Stack)
|
| | | Current_State = MAT_State();
|
| | |
|
2026-02-15 05:13:55 +00:00 | | | // State bias for downstream execution gating.
|
| | | Current_Bias_Direction = BiasDirection();
|
| | |
|
| | | double raw = 50.0 + (double)(Active_Praise_Signals - Active_Warnings) * 5.0;
|
| | | if(Current_Mode == MODE_TRENDING) raw += 10.0;
|
| | | if(Current_Mode == MODE_CHOP) raw -= 10.0;
|
| | | State_Bias_Confidence = MathMax(0.0, MathMin(100.0, raw));
|
| | | }
|
| | |
|
| | | #endif
|