One Leg Multi Algo
-
Admin
Keymaster3 weeks ago #5396🔹 OneLegMulti Algorithm: Technical Overview
OneLegMulti is a one-sided arbitrage strategy implemented in the Westernpips Private 7 platform. It is designed to enter trades in a single direction (Buy or Sell) based on the price divergence between Fast and Slow (or Signal) quote providers. The strategy evaluates gaps between quotes, applies spread filters, calculates take profit and stop loss levels, and manages trade exits with trailing and reverse-gap logic.
________________________________________⚙️ Core Logic
1. Signal Generation
• The strategy receives live quotes from multiple Fast, Slow, and Signal feeds.
• “Shifted” prices (ShiftedFastBid / ShiftedFastAsk) are calculated using the AutoShifter component, which applies both manual and automatic price alignment.
• Gaps are calculated between Fast and Slow/Signal providers for both Buy and Sell directions.
• A trade signal is created when the gap exceeds the defined threshold (MinOpenGapPt) and all spread filters are satisfied.2. Entry Conditions
A position is opened only when:
• The current and average spreads for Fast and Slow providers are below the user-defined limits.
• A minimum time (WaitBeforeNewSlotEntryMs) has passed since the last signal.
• Trade direction (Long/Short) is allowed by configuration.
• If the above conditions are met, a trade is initialized with a signal price, take profit, and stop loss.3. Exit Conditions
A trade is closed if:
• The take profit or stop loss is hit based on Slow provider quotes.
• If Trailing Stop is enabled, the stop level is dynamically updated when profit exceeds TrailingStartPt.
• TakeProfitMode and StopLossMode determine whether the distance is calculated from the signal price or the actual entry price.
• If Close Gap is enabled, the trade will also close if an opposite gap appears — e.g., a Sell signal will be closed if a strong Buy gap forms in the Fast feed.
• Closure is allowed only when spread thresholds are not violated at the moment of exit.
________________________________________🔍 Key Features
• Multi-Slot Execution
Supports parallel signal processing via multiple slots (SlotsCount). Each slot independently tracks its own trade state.
• Spread Averaging
Uses an Averager component to smooth real-time spread data, preventing false signals due to quote noise.
• AutoShifter
Aligns price data between Fast and Slow/Signal providers by applying time-based and manual shift settings.
• Trailing Stop Logic
Dynamically adjusts the stop loss after a certain profit threshold is reached, maintaining profits in volatile conditions.
• Dynamic Volume
If enabled, the strategy calculates lot size automatically based on balance and the DynamicVolumeEquityDivider parameter.
________________________________________🧪 Practical Use Case
• Fast and Slow brokers are configured and streaming data.
• The strategy monitors all incoming ticks in real time.
• When a gap between Fast and Slow exceeds the set threshold, and spreads are within limits, a position is opened.
• Stop Loss and Take Profit are placed based on signal or entry price, depending on configuration.
• The trade is monitored until closed by TP, SL, trailing stop, or reverse gap logic.
• The strategy ensures no new entries are triggered too quickly by enforcing a cooldown between signals.
________________________________________✅ Purpose
OneLegMulti is a latency arbitrage strategy optimized for one-direction execution using quote divergence between providers. It is ideal for exploiting micro-opportunities where the Fast feed temporarily outpaces the Slow feed — without requiring a hedge on the opposite side. The strategy offers fine control over entry, risk, execution filters, and exit behavior, making it suitable for stealthy and efficient arbitrage.
You must be logged in to reply to this topic.