Spezifikation
This Technical Requirement Specification (TRS) is the overall detailed description of the EA required. It incorporates the modular entry system, multi-loop basket management, and the dynamic Take Profit scaling requirement where the profit target increases proportionally with the risk (lot size) of the basket.
Some of the below comments are improvement from template of EA already developed.
Technical Requirement Specification: Global Basket Scalper (V3.0)
1. Phase 1: Modular Entry Logic (Initial Trade) à NEW / replaces ADX feature
Phase 1 governs the first trade of any new cycle. The logic must be modular, allowing the user to enable/disable specific filters.
- Modular "Gate" System:
- Trend Bias Gate (EMA): Checks price against an EMA (user-defined period, max 10 min). Settings as per user choice (manual or as per trend)
- Volatility Gate (BBW): Only allows entry if Bollinger Band Width (20, 2.0) is currently expanding ($BBW > SMA100$). (True or false – as per user choice) Settings as per user choice
- 55-EMA Channel Gate: Price must be outside the channel formed by the 55-EMA High and 55-EMA Low. (True or false – as per user choice) Settings as per user choice
- Speed-Cross Signal: Triggers on 9/21 EMA crossover with RSI (14) confirmed above/below the 50 mid-line. (True or false – as per user choice) Settings as per user choice
- Thrust Filter (ATR Multiplier): To ensure a valid "push" without being too restrictive, the signal candle body must be above ({ATR}(10) * multiplier) (True or false – as per user choice) Settings as per user choice
2. Phase 2: Basket & Recovery Management à existing in EA version shared
Once the first trade is open, the EA manages the "Basket" across multiple loops.
- Loop 1 (Initial): Adds positions at fixed $X$-pip intervals only as price moves favorably (adding to winners).
- Hedging Countermeasure: If price moves $X$ pips against any entry, the EA opens an equal-sized counter-position (reversal logic).
- Recovery Loops (Loops 2–N):
.
- Constraint 1: Preceding loop reaches a user-defined position count
- Constraint 2: New Loops need to meet the criteria chosen in phase 1 New feature
- Lot Multiplier: New loops use a multiplier (e.g., 1.5x or 2.0x) to increase basket weight. Settings as per user choice
- Max Quantity of loops: in settings
3. Phase 3: Dynamic Profit Closure & Continuity NEW
This section defines how the EA exits and immediately hunts for the next cycle.
- Dynamic Take Profit Scaling:
- Logic: The Take Profit (TP) target must increase proportionally as new loops are added and lot sizes increase.
- Formula: $GTP = TP_{Base} \times (\text{Total Basket Lots} / \text{Initial Lot Size})$.
- Global Closure: When the combined net profit of all active loops reaches this dynamic target, all positions close.
- Momentum Continuity:
- Logic: After a successful TP closure, if SMA 50 and SMA 100 are aligned (both below price for Buys, above for Sells), the EA skips Phase 1 and restarts Loop 1 immediately in the same direction.
- Safeguards:
- News Filter: Stops new initial loop initialization before/after high-impact news. The logic reaches completion of ongoing loop.
- Trading Hours: Restricts initial entries to specific daily windows.
- Max Drawdown: Hard equity stop that liquidates all trades and resets the cycle.
- Max Quantity of open positions: Hard equity stop that liquidates all trades and resets the cycle.
4. Developer User Settings Interface
| Section | Parameter Name | Type | Description |
| Logic Toggles | Use_EMA_Trend / Use_BBW / Use_Channel | Bool | Modular Phase 1 toggles. |
| Loop 1 Setup | Initial_Lot_Size / TP_Base_Pips | double / int | Starting volume and base profit target. |
| Grid Logic | Dist_Between_Trades / Hedge_Distance | int | Pips for scaling and reversal. |
| Recovery | Max_Quantity_Loops / Trigger_Pos_Count | int | User-defined loop cap and trigger. |
| Recovery | Proximity_Offset / Lot_Multiplier | int / double | Distance from entry and weight increase. |
| Safety | Max_Drawdown_Pips / News_Filter_Toggle | int / bool | Global stop loss and news logic. |
| Continuity | Use_SMA_Momentum_Restart | bool | Toggles SMA 50/100 instant re-entry logic. |
5. Developer Implementation Guidelines
- Dashboard: On-chart UI must display active Loop Tier, Current Basket Profit vs. Dynamic TP, and News status.