DYJ Dynamic StopLimit Engine
- Experts
- Daying Cao
- Versione: 1.5
- Aggiornato: 28 dicembre 2025
- Attivazioni: 5
DYJ Dynamic Stop-Limit Engine is an intelligent entry execution engine designed for automated trading systems. By dynamically combining Stop and Limit mechanisms, it strictly constrains execution prices only after a valid price trigger has been confirmed. The engine focuses on addressing common issues in high-volatility markets, such as slippage, abnormal spread expansion, and uncontrolled executions, ensuring that every trade is executed within an acceptable price range—or deliberately skipped when conditions are not met.
Unlike traditional market orders or fixed Stop-Limit orders, the Dynamic Stop-Limit Engine continuously evaluates real-time market conditions during order placement. It dynamically adjusts the trigger and limit structure based on the instrument’s minimum price increment, contract constraints, and current spread conditions. This approach preserves execution discipline while significantly improving execution quality and overall system stability.
The engine is well suited for Expert Advisors (EAs), algorithmic trading, and structured trading strategies, particularly breakout and confirmation-based entry logic, as well as capital management systems that are highly sensitive to execution quality. Rather than pursuing higher fill rates, its design philosophy emphasizes strict control of entry costs, providing a reliable execution foundation for long-term, sustainable automated trading.
The yellow dashed line on the chart represents the execution trigger price, typically corresponding to a local high or low. It is used to confirm the validity of a price breakout and serves as a reference point for execution logic, rather than the actual order placement price.
The cyan dashed line on the chart represents the actual execution price, which also functions as the pullback confirmation price. This level is usually where the pending order is ultimately placed, allowing the system to enter the market at a more controlled price after confirmation, thereby reducing slippage and unnecessary price chasing.
Input
[Language]
- InpDebugLanguage = DEBUG_LANG_ENGLISH —— Debug and log output language setting
[Dynamic Stop-Limit Order Configuration]
- MaxOrders = 5 —— Maximum number of orders, limits the total active dynamic stop-limit orders
- OrderExpirationHours = 24 —— Order expiration time (hours); unfilled orders will be automatically canceled
- MagicNumber = 7102023 —— Magic number used to identify and manage orders generated by this strategy
[Buy Dynamic Stop-Limit Order]
- Buy_ExecutionDistance = 2.0 —— Buy execution distance (price value), limits the worst acceptable entry price
- Buy_Volume = 0.01 —— Trading volume for buy orders
- Buy_SL_Distance = 6.0 —— Stop loss distance for buy orders (price value), used to control maximum risk
- Buy_TP_Distance = 6.0 —— Take profit distance for buy orders (price value), defines target profit range
[Sell Dynamic Stop-Limit Order]
- EnableSellDynamic = true —— Enable dynamic stop-limit logic for sell orders
- Sell_TriggerDistance = 3.0 —— Sell trigger distance (price value), used to confirm downward breakout
- Sell_ExecutionDistance = 2.0 —— Sell execution distance (price value), limits the worst acceptable entry price
- Sell_Volume = 0.01 —— Trading volume for sell orders
- Sell_SL_Distance = 6.0 —— Stop loss distance for sell orders (price value), used to control maximum risk
- Sell_TP_Distance = 6.0 —— Take profit distance for sell orders (price value), defines target profit range
[Control Panel Settings]
- PanelWidth = 280 —— Control panel width
- PanelHeight = 380 —— Control panel height
- InpIsDisplayLinePrice = false —— Display price labels on the chart
- InpOffsetForCurrentPriceLable = 112 —— Offset distance for current price label
- PanelBackgroundColor = clrDarkSlateGray —— Panel background color
- PanelBorderColor = clrGoldenrod —— Panel border color
- PanelTitleColor = clrWhite —— Panel title text color
- PanelTextColor = clrWhite —— Panel content text color
