Tag: AdaptiveHybridSystem
Adaptive Hybrid System 78.10 – Multi-Core VISUAL MODE
Information Panel
15. Information Panel
A graphical panel in the upper-left corner of the chart displays in real time:
- Main status (
g_Status_Main): current engine state —"Looking for signal (Multi-Core)","Block BUY: Macro Score","Block: ADX too low", etc. - Macro Matrix status (
g_Status_Macro):"BUY Align: 82% (Pool: 145)"— current alignment percentage and pool weight - Channel status (
g_Status_Channel):"19000 - 21000"— boundaries of the active channel - MTF Dashboard: 7 timeframes (M1, M5, M15, M30, H1, H4, D1) with colour-coded EMA5/EMA7, RSI3, RSI14, CCI14, MFI14 readings
- Open positions list: ticket, direction, volume, profit, open time
- Equity and Balance: current values
- Daily P/L and information about active protection restrictions
- License info and expiry date
Visual parameters:
Inp_PanelHeaderFontSize = 10 // Header font size
Inp_PanelContentFontSize = 9 // Content font size
Inp_ShowPositionsOnPanel = true // Show positions list on panel
Pyramiding (Position Scaling)
14. Pyramiding (Position Scaling)
Inp_Pyramid_Multiplier = 3.0 // Scale multiplier (probe → main)
Inp_Pyramid_Max_Lots = 2.0 // Hard cap: max lots for any single position
Inp_Pyramid_OnlyProfitable = true // Pyramid only if last position is in profit
Logic:
- No open positions:
lots = target_lots / 3.0— a small probe is opened (1/3 of normal) - Position exists:
lots = last_volume × 3.0— scaling up to full size - If
OnlyProfitable = trueand the last position is in loss → pyramid is blocked
Log: "Pyramid blocked: last position not in profit." / "LOT CAP: 4.50 -> 2.00"
Capital Management & Position Sizing
13. Capital Management & Position Sizing
Capital Modes (ENUM_CAPITAL_MODE)
| Mode | Description |
|---|---|
CAPITAL_COMPOUND_AUTO | Base = account balance (automatic) |
CAPITAL_FIXED_MANUAL | Base = Inp_Fixed_Capital_Amount (fixed) |
CAPITAL_COMPOUND_AUTO + Inp_Compound_Enable=true | Base = Fixed + g_CompoundBuffer (from TXT file) |
Position Sizing Algorithm (CalculatePositionSize)
1. base_capital = [depending on mode]
2. budget = base_capital × MaxTotalMarginPercent / 100
3. risk_money = budget × Risk_Percent_Per_Trade / 100
4. sl_ticks = (Hard_SL_Points × _Point) / tick_size
5. loss_for_one_lot = sl_ticks × tick_value
6. target_lots = risk_money / loss_for_one_lot
→ First position: target_lots / Pyramid_Multiplier (probe — smaller)
→ Subsequent position: last_volume × Pyramid_Multiplier (main — larger)
7. Round to broker's volume step
8. Enforce broker's min/max volume
9. Check hard cap: Max_Lots
10. Margin check: OrderCalcMargin → if budget exceeded → abort
Compound Buffer
g_CompoundBuffer is read from an external TXT file. Allows percentage-based growth of the capital base at configurable intervals: Daily / Weekly / Monthly. Enables a compound interest effect on a locked base without changing EA settings.
Weekly Filter & Fibonacci (Anti-Crash)
12. Weekly Filter & Fibonacci (Anti-Crash)
Weekly Filter
Inp_WeeklyFilter_Enable = true
Inp_WeeklyFilter_TF = PERIOD_W1
Blocks trading when the current price is below the previous week’s Low on W1. Protects against trading in a structurally bearish trend or during potential crashes.
Fibonacci Extension Filter
Inp_FiboFilter_Enable = true
Inp_Fibo_TF = PERIOD_D1
Blocks orders at extreme Fibonacci extension levels on D1. Prevents entering an overheated market that has moved far from its fundamental value.
News Filter!
11. News Filter
Integration with an external economic calendar to protect against high-impact news events:
Inp_News_Filter_Enable = true // Enable the filter
Inp_News_Mins_Before = 30 // Freeze trading 30 mins before news
Inp_News_Mins_After = 12 // Continue freeze for 12 mins after news
Inp_News_Block_High = true // Block on high-impact events (red)
Inp_News_Block_Mid = true // Block on medium-impact events (orange)
When the news filter is active → no new orders are opened. Existing positions continue to be managed normally.
Trading Schedule & EOD Terminator
10. Trading Schedule & EOD Terminator
Session Schedule (Terminal Local Time)
Each weekday has its own trading window:
Monday: Inp_Hours_Monday = "00:00-22:00"
Tuesday: Inp_Hours_Tuesday = "00:00-22:00"
Wednesday: Inp_Hours_Wednesday = "00:00-22:00"
Thursday: Inp_Hours_Thursday = "00:00-22:00"
Friday: Inp_Hours_Friday = "00:00-05:00" // earlier close — weekend risk
Format: "HH:MM-HH:MM" — multiple ranges per day can be entered, comma-separated, e.g. "09:00-12:00,15:00-20:00". Saturday and Sunday are automatically blocked.
EOD Terminator
An emergency mechanism for closing all positions at a defined time:
Friday: Inp_EOD_Time_Friday = "21:39"
Other days: Inp_EOD_Time_OtherDays = "22:29"
Algorithm with retry logic:
- Attempts to close all positions on the symbol
- If the broker rejects an order → waits 5 seconds → retries (up to 10 attempts)
- On success:
g_Last_EOD_Day = dt.day_of_year(does not repeat on the same day)
Log: "EOD TERMINATOR: Emergency closing all positions..." → "EOD SUCCESS: Closed position #123." → "EOD TERMINATOR: Chart cleared. Goodnight."
Manual Trade Management — Click & Forget
9. Manual Trade Management — Click & Forget
Inp_Manage_Manual_Trades = true
One of the most practical features of the system. The trader can open a position MANUALLY (Magic Number = 0) and the EA immediately takes full management control:
- ✅ Virtual Stop Loss (emergency %-based cut)
- ✅ Profit Lock (aggressive trailing near TP)
- ✅ TSL Bollinger Bands (trailing SL)
- ✅ Hard Break-Even (SL moved to BE)
- ✅ Virtual Negative Break-Even
- ✅ Dynamic Take Profit (TP extension)
- ✅ EOD Terminator (end-of-day close)
- ✅ Equity Trailing Lock
Philosophy: The trader decides on the entry (direction, level) — the EA manages the risk. Perfect for discretionary trading supported by automatic protection.
Account Protection — System Level
8. Account Protection — System Level
Daily Loss Hard Limit
If daily P/L drops below -(Inp_Daily_Loss_HardLimit)% of balance:
→ g_DailyLossReached = true
→ ALL new orders blocked for the rest of the day
→ Existing positions continue to be managed
Default: 4% of balance.
Drawdown Freeze
If current drawdown > Inp_Drawdown_FreezeLimit%:
→ g_DrawdownFreeze = true
→ New orders frozen
Default: 0.5% (very conservative, ideal for prop firm challenges).
Daily Target Profit
If daily P/L > +Inp_Daily_Target_Profit%:
→ g_DailyTargetReached = true
→ Trading stopped — profit is secured
Default: 15% — after reaching the target, the system shuts itself down for the day.
Equity Trailing Lock (Master)
An equity protection mechanism operating at the account level:
If equity rises by >= Inp_Equity_TSL_Trigger%:
→ Sets an "equity high watermark"
→ If equity drops below (high - Inp_Equity_TSL_Buffer%):
→ Closes ALL positions immediately
Default: Trigger 5%, Buffer 0.2%. Protects against losing a large intraday gain.
