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 = true and 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)

ModeDescription
CAPITAL_COMPOUND_AUTOBase = account balance (automatic)
CAPITAL_FIXED_MANUALBase = Inp_Fixed_Capital_Amount (fixed)
CAPITAL_COMPOUND_AUTO + Inp_Compound_Enable=trueBase = 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.

Adaptive Hybrid System - Multi-Core Strategy Engine -US100
Privacy Overview

This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.