Westernpips DocsWesternpips Docs
  • Home
  • FAQ
  • Documentation
  • Forums
  • Home
  • FAQ
  • Documentation
  • Forums
  • Crypto Trader
    • Crypto Scanner - 1 Leg
    • Crypto Scanner - 2 Leg
    • Crypto Table
  • Getting Started
    • Web Portal my.westernpips.com
      • Web Portal Password Recovery
      • How to Buy Westernpips Products?
    • Products Installation
    • Prerequisites
      • .NET Desktop Runtime Installation
      • ASP.NET Core Runtime Installation
      • Microsoft Redistributable Installation
    • System Requirements
    • Installation Troubleshooting
  • Westernpips Golden Tools 3.5.7
    • Downloading
    • First Run
    • Installing a Westernpips Products Using WGT
    • Working with Installed Products
    • WGT Update
  • Westernpips Private 7
    • How to Check Which Quote Feed Is Faster
    • Installing and First Run
    • License Activation and Login
    • Change License IP, Add new IP
    • User Interface
      • Main Window
      • Dashboard
        • Options
        • Strategies
        • Connections
        • Schedulers
    • Trades Discovery, Check Orders Duration
    • WESTERNPIPS PRIVATE 7 ALGOS
      • OneLeg
        • OneLeg: Before You Start
        • OneLeg First Setup, Step by Step
        • OneLeg Key Parameters with an XAUUSD Example
        • OneLeg Troubleshooting
      • Two Leg Simple Hedge
      • Two Leg Lock
      • Multi Leg Spread
      • One Leg Multi
      • OneLegHidden
      • Two Leg Standard
      • Remote
      • Copier
      • Clicker in WesternPips Private 7
      • Session Control — Quick Guide
      • Exucution Control — Quick Guide
      • Slippage Control - Fast Guide
      • Add/Edit Provider Window Settings
      • BackTester
      • Setting up a connection with the Broker Terminal via the EA connector
    • Connectors
      • Common Settings and Operation
        • FIX Connection Settings
        • FIX Logs
      • Trading and Fast Sources Connectors
        • 24Exchange Connector
        • Active Financial API Connector
        • Binance Connector
        • Bitfinex Connector
        • CBOE FIX Connector
        • Celer FIX Connector
        • CFH FIX Connector
        • CTrader FIX Connector
        • DukasCopy FIX Connector
        • DxFeed FIX Connector
        • Euronext FIX Connector
        • Exante FIX Connector
        • FastMatch ITCH Connector
        • FlexTrade FIX Connector
        • Fortex FIX Connector
        • FXCM FIX Connector
        • FxPig FIX Connector
        • GCEX FIX Connector
        • Gold-i Matrix FIX Connector
        • Integral FIX Connector
        • LMAX API Connector
        • LMAX FIX Connector
        • MaxxTrader FIX Connector
        • MT EA Connector
        • M4 Server Connector
        • M5 Server Connector
        • OGM FIX Connector
        • OKX Connector
        • OneZero FIX Connector
        • PrimeXM FIX Connector
        • Remote Connector
        • Rithmic Connector
        • RoE FIX Connector
        • Saxo FIX Connector
        • SolidFX FIX Connector
        • Spotex FIX Connector
        • TraderMade FIX Connector
        • Universal Connector
        • Universal Fast Connector
        • XenFin FIX Connector
        • XTRD FIX Connector
  • Westernpips Webcliker
    • System Requirements
    • Installer
    • Agent
    • UI Settings
    • UI Logs
    • Start/Stop
    • Connections
    • Trade platforms
      • CMC Markets
      • M5 Web
      • M4 Web
      • TRADE NATION
      • Exness Web
      • Universal cliker
      • IG Trading Platform
      • MEX / MultiBank
      • ByBit
      • EXANTE
      • IQ Option
      • Plus500
      • Quotex
    • Risk Warning
  • Glossary
    • Latency Arbitrage
    • Fast Price Feed
    • Execution Latency
    • Slippage
    • FIX API
    • Requote
    • Forex Arbitrage
    • Toxic Flow
    • Last Look
    • B-Book
    • Forex VPS
    • Brokers That Allow Arbitrage
    • Low Latency

Two Leg Standard

1067 views 0

Strategy TwoLegStandard

What the strategy does

TwoLegStandard is a two-leg relative-value strategy. Instead of trading one symbol in isolation, it tracks two instruments as a pair and reacts when their behavior diverges.

When an entry condition is met, the strategy opens a hedged pair:

  • buy one instrument and sell the other;
  • or the opposite direction, depending on the signal type.

This structure is designed to focus more on the relationship between instruments (spread/divergence) and less on pure market direction. In practical terms, you are trading whether the pair should move back toward balance, not just whether one symbol goes up or down.

The lifecycle is straightforward for users:

  • the strategy waits for a valid divergence signal (Gap or Basket mode);
  • opens both legs as one combined position;
  • manages the position using your risk and exit settings (spread filters, TP/SL, confirmations, close rules);
  • optionally adds more slots in grid mode if drawdown conditions are met.

The overall goal is to capture the recovery of the pair after divergence while keeping execution controlled through filters, confirmations, and position-management rules.

Typical professional use cases:

  • Same instrument, different brokers: for example, EURUSD feed/execution on Broker A versus EURUSD feed/execution on Broker B. This is commonly used for cross-broker relative-value and execution-quality opportunities.
  • Spot versus Futures structure: pairing a spot symbol with its futures equivalent to trade temporary dislocations in the spot-futures relationship.
  • Cross-symbol correlation trading: using historically related instruments such as EURUSD-GBPUSD, US30-US100, or US100-DAX to trade short-term divergence and potential re-convergence.

In all three scenarios, the strategy should be viewed as a relationship-driven model: success depends on selecting pairs with stable behavior, tuning scaling correctly, and applying disciplined risk controls.

Customization

First of all, it is necessary to specify the brokers between which (accounts) will go. It is also necessary to specify the traded symbol.

Need Add 2 Providers here

Two Leg Standard - word image 3262 49

Two Leg Standard - word image 3262 58    starting/stopping the strategy

Two Leg Standard - word image 3262 59          cloning a strategy to a new tab

Control panel

Two Leg Standard - word image 3262 50Two Leg Standard - word image 3262 51

Parameter Simple explanation
View Chart Shows the chart and strategy visualization (Chart Tab).
View Orders Shows open/closed orders in the interface (Orders Tab).
View Debug Shows additional technical diagnostics (Debug Tab).
Save Trace to File Saves the strategy run history ticks for later review in BackTester.
Scheduler Limits trading by time, if configured. (Can set on Dashboard>>>Shedulers)
Allow Open Long Allows open long-direction entries.
Allow Open Short Allows open short-direction entries.
Send signals: Long / Short / Close Manual open/close orders from the software buttons.

 

Using this buttons you can save/load preset (set file) of algorithm settings.

Two Leg Standard - word image 3262 52

Algorithm Settings – all parameters giude

Setting What it controls Practical tip
Digits Price precision of leg 1. Must match the quote format of instrument 1.
Digits 2 Price precision of leg 2. Must match the quote format of instrument 2.
PriceMultipliers Scales both legs into a comparable price range before signal evaluation. Critical for cross-asset pairs and cross-broker setups.
Volume1 Base transaction volume for leg 1 (Broker/Provider 1). In grid mode, volume can increase by slot.
Volume2 Base transaction volume for leg 2 (Broker/Provider 2). Keep leg sizing aligned with your hedge logic.
Contract Size 1 Contract size for leg 1, used in money P/L calculation. Always verify with broker symbol specification.
Contract Size 2 Contract size for leg 2, used in money P/L calculation. Incorrect values will distort total P/L behavior.
EntryMode Selects entry signal family: Gap or Basket. Gap is usually easier for initial tuning.
Slots Count Maximum number of simultaneously managed trade combinations (grid slots). 1 = single-entry mode, 2+ = multi-slot/grid mode.
Execution Control Execution-speed and order-handling control module settings (if available in your build/UI). Use stricter execution constraints in volatile sessions.
Drowdawn(pt) Drawdown threshold that allows opening the next slot. Lower value means faster slot expansion and higher risk.
Wait Before New Slot Combination(ms) Minimum time gap between new entries. Helps prevent overtrading during noisy ticks.
Use Auto Shift Enables automatic quote alignment between providers. Use this when your pair has a dynamic quote offset.
Auto Shift Period Update period for automatic alignment. Lower value = faster reaction, higher value = smoother behavior.
Manual Shift Bid(pt) Manual Bid shift (points) for alignment when auto shift is disabled. Use only in manual alignment mode.
Manual Shift Ask(pt) Manual Ask shift (points) for alignment when auto shift is disabled. Keep Bid/Ask shifts consistent to avoid signal bias.
Use Max Spread Enables spread filter for new entries. Recommended in live trading conditions.
Max Spread(pt) Maximum allowed spread for entry eligibility. Tune per symbol and session liquidity.
OpenGap(pt) Minimum gap value required to open a trade in Gap mode. Primary trigger threshold for Gap entries.
OpenGapConfirmation.* Time-persistence filter for Gap signals. It confirms sustained divergence, not only short spikes. Example: with OpenGap=100, Period=300ms, Threshold=80, the signal must reach 100 and remain above 80 for at least 300 ms.
OpenBasket(pt) Entry threshold for the synthetic Basket indicator. Used only when EntryMode = Basket.
OpenBasketConfirmation.* Confirmation filter for Basket entries. Same confirmation concept as Gap (period + threshold persistence).
SmartClose Dynamically adjusts close behavior with respect to current trade slippage. Helps make TP/SL handling more execution-aware.
SameMarginAccount Special logic for shared-margin environments. Enable only if this reflects your account structure.
TakeProfit(pt) Profit target in points. Most relevant for single-slot operation.
Total TakeProfit($) Total money-based take-profit for all open slots. Main close target for multi-slot/grid mode.
TakeProfitConfirmation.* Time-based confirmation for profit exit. Closes only when profit condition persists for the configured period.
StopLoss(pt) Loss threshold in points. Mandatory risk boundary; validate on history.
StopLossConfirmation.* Time-based confirmation for stop-loss exit. Reduces exits caused by brief price spikes.
UseCloseGap Allows exit using reverse-gap conditions. Useful as an additional close mechanism.
CloseGapPt Gap threshold used by the close-gap logic. Active only when UseCloseGap is enabled.
MinLockDuration(secs) Minimum holding time before close conditions are allowed. Prevents premature exits right after entry.

 

EntryMode options

Entry Mode this main option using for calculation signals.

Two Leg Standard - entry mode

Gap

Entry based on current divergence in pips between instruments with shift and filters applied. This is usually the most straightforward mode for beginners.

Use OpenGap(pt) for set open orders using Gap mode.

Two Leg Standard - gap chart

Basket

Entry based on basket behavior relative to a baseline pair state. This mode typically needs more careful threshold tuning.

If you are starting from scratch, use Gap first, then move to Basket after you get stable backtest results.
Use OpenBasket(pt) for set open orders using Basket mode.
Two Leg Standard - basket chart

PriceMultipliers mode (for trade between different instruments (pair trading)

Two Leg Standard - pricemultipliers

PriceMultipliers is used to compare instruments with very different price ranges.

Example idea:

  • if one instrument is around 1.10 and the other is around 42000, you cannot compare them directly;
  • with multipliers, you scale one leg up/down so the strategy can compare them correctly.

How to set it

Format: leg1_multiplier;leg2_multiplier

Ready calculation example (EURUSD + GBPUSD):

  • m1 = 1
  • m2 = Price1 / Price2
  • PriceMultipliers = "m1;m2"

For Example:

  • EURUSD Price = 1,14174
  • GBPUSD Price = 1.33553
  • m2 = 1,14174 / 1.33553 = 0.85
  • PriceMultipliers = "1;0.85"

Martingale mode via Slots

In TwoLegStandard, martingale logic is implemented as a slot sequence (grid steps). Each slot is an independent two-leg combination (Buy/Sell or Sell/Buy) managed by its own state.

How slot logic works step by step

  • Slot 0 (first slot) opens on the standard strategy signal (Gap or Basket).
  • Slot 1 and above can open only when the previous slot drawdown is below -Drowdawn(pt).
  • Every slot follows the same lifecycle: waiting for signal -> opening both legs -> locked management -> closing.
  • If pair integrity is broken inside a slot (one leg present, the other missing), the slot is moved to forced closing mode.

How volume grows (martingale multiplier)

In the current implementation, when Slots Count > 1, each next slot uses doubled size:

  • Slot 0: x1
  • Slot 1: x2
  • Slot 2: x4
  • Slot 3: x8

This multiplier is applied to both Volume1 and Volume2.

What “martingale when Slots >2” means

In practice, this is a configuration with at least 3 levels (for example slots 0-1-2). The strategy can average deeper during adverse movement, but this also increases margin load and floating risk significantly.

How the grid closes in multi-slot mode

  • Main automatic close condition for Slots Count > 1 is total basket profit reaching Total TakeProfit($).
  • Closing can also be triggered by manual Close signal or scheduler CloseAll action.
  • When SameMarginAccount is enabled, a dedicated (virtual-close) handling path is used.
Important: in the current implementation, classic per-slot exit checks (TakeProfit(pt)/StopLoss(pt)/UseCloseGap) are fully used mainly in single-slot mode. In grid mode (Slots Count > 1), the key automatic exit is Total TakeProfit($).

Safety recommendations

  • Start with Slots Count = 1 and validate stability on historical data.
  • Move to 2-3 slots only after stable single-slot behavior.
  • Do not set Drowdawn(pt) too low, or slots will stack too fast.
  • Always set a realistic Total TakeProfit($) and monitor margin headroom.
  • Before live deployment, test worst-case scenarios for maximum simultaneously open slots.
Recommended rollout sequence: tune entry/exit quality in single-slot mode first, then enable grid, and only then increase martingale aggressiveness.

Real practic of using martingale in TwoLegStandart Algo between XAUUSD and US30 pairs

First need add 2 Providers. 1 leg this XAUUSD and 2 leg this US30. You can use same account or different accounts.

Two Leg Standard - prov

Next we need calculate and set PriceMultipliers

Provider1 Price XAUUSD = 4053.30

Provider2 Price US30 = 52345.90

We do calculation Provider1 Price/Provider2 Price = 4053.30 / 52345.90 = 0,077

Next Set PriceMultipliers = "1;0,077"

If you click Start, you will see in the Diagnostics tab that Provider 1 and Provider 2 prices are now displayed in the same format.

Two Leg Standard - diagnostic

Next we need set Digits and Digits 2

In Market Watch we see that Prices are displayed with 2 decimal places.

Two Leg Standard - digits

So we need set.

Digits=2;

Digits2=2;

! Be careful: different instruments may have different Digits

Was this helpful?

Yes  No
Related Articles
  • Low Latency
  • Brokers That Allow Arbitrage
  • Forex VPS
  • B-Book
  • Last Look
  • Toxic Flow
Previously
OneLegHidden
Up Next
Remote
  • Copyright 2026 Westernpips.com. All Rights Reserved.

LiveInternet counter