Latency Arbitrage: Difference between revisions
Added Min move / Trend interval / Cooldown, Reverse factor %, Max Buy/Sell Diff Time; new section on impulse entry and reverse close; typo fixes |
Formatting cleanup: unified image layout (block, no float, border) |
||
| (10 intermediate revisions by the same user not shown) | |||
| Line 3: | Line 3: | ||
Latency arbitrage can be used for Forex brokers and crypto exchanges. [https://bjftradinggroup.com/latency-arbitrage Learn more about Latency Arbitrage] | Latency arbitrage can be used for Forex brokers and crypto exchanges. [https://bjftradinggroup.com/latency-arbitrage Learn more about Latency Arbitrage] | ||
== Instruments and orders tab == | |||
In this tab main trading parameters are set. | In this tab main trading parameters are set. | ||
[[File:2026-10-05_21.55.04.jpg|none|frameless|border|1280x1280px]] | |||
== Description of the parameters == | |||
Default values are the values of a newly added instrument (Add instrument). Values are in points unless Units is set to Percent. A parameter set to its value to ignore is switched off. | |||
''' | ; Enabled | ||
: enables or disables trading on a selected instrument. <br />'''Default:''' checked. | |||
; Name | |||
: symbol name on a fast feed. <br />'''Default:''' empty. | |||
; Lot size | |||
: lot size to be traded. <br />'''Default:''' 0.01. | |||
; Lot type | |||
: allows to switch between '''Fixed''' or '''Balance %''' lot type. Balance % lot type is calculated based on the following formula: | |||
: LotSize = (YourAccountBalance/1000)*(PercentValue/100). <br />'''Default:''' Fixed. | |||
; Decimals | |||
: number of decimal places in symbol quotes. <br />'''Default:''' 5. | |||
; Spread SL | |||
: allows to calculate SL based on spread. When Spread SL is enabled actual SL is calculated as a current spread multiplied by S/L value. <br />'''Default:''' off. | |||
; S/L | |||
: hidden stoploss for an arbitrage trade. <br />'''Default:''' 50. '''Value to ignore:''' 0 (no stop loss). With S/L 0 trailing does not work either, because trailing moves the stop loss. | |||
; T/P | |||
: hidden takeprofit for an arbitrage trade. <br />'''Default:''' 300. '''Value to ignore:''' 0 (no take profit). | |||
; Min profit | |||
: starting point for trailing. <br />'''Default:''' 10. '''Value to ignore:''' 0 together with Trail distance 0. With Trail distance above 0, Min profit 0 starts trailing as soon as the trade is in profit. | |||
; Pips for Min Profit | |||
: when set Min profit parameter comes into effect after price reaches Pips for Min profit value. Used for brokers with wide stop/freeze levels. <br />'''Default:''' 0. '''Value to ignore:''' 0. | |||
; Trail distance | |||
: distance arbitrage trade is trailed at. <br />'''Default:''' 20. '''Value to ignore:''' 0 (no trailing). Min profit then only moves the stop loss to the entry price plus Min profit once that profit is reached. | |||
; Trail units | |||
: allows to switch trailing units between points and percents. Trailing in % mostly used in crypto arbitrage. <br />'''Default:''' Points. | |||
; Order lifetime | |||
: maximum arbitrage deal duration (expressed in seconds) <br />'''Default:''' 60. '''Value to ignore:''' 0 (no time limit). | |||
; Slippage | |||
: max allowed deviation from the price order is sent at. If price goes beyond allowed deviation order gets reject or requote. Works only for instant execution accounts and limit orders on FIX API accounts. For market execution accounts it has no effect. <br />'''Default:''' 50. There is no value to ignore. | |||
; Commissions | |||
: can be set if broker charges commissions. Commissions are calculated per million (10 standard lots) so if broker charges $7 per standard lot they should be set to 70. Parameter has no effect on trading, it affects only on profit display. <br />'''Default:''' 0. '''Value to ignore:''' 0. | |||
; Diff calculation method | |||
: allows to switch between several calculation modes of arbitrage difference: <br />'''Default:''' Standard. | |||
: '''''Standard (universal mode, suitable for most setups)''''' | |||
: BuyDiff = FastAsk - SlowAsk | |||
: SellDiff = SlowBid - FastBid | |||
: '''''SpreadCorrected (recommended when spreads on a slow broker are lower than on a fast feed)''''' | |||
: BuyDiff = (FastBid - SlowAsk) | |||
: SellDiff = (SlowBid – FastAsk) | |||
: '''''Reversed (experimental mode)''''' | |||
: BuyDiff = FastBid - SlowBid | |||
: SellDiff = SlowAsk – FastAsk | |||
; Include spread | |||
: allows to include or exclude spreads from difference calculation. We recommend to keep this option checked. <br />'''Default:''' checked. Ignored when Units is set to Percent. | |||
; Diff to open | |||
: difference between prices on a slow broker and a fast feed for opening arbitrage deal. <br />'''Default:''' 30. There is no value to ignore: with Min move 0, Diff to open 0 opens a trade on any positive difference. With Min move above 0, Diff to open 0 opens a trade on the impulse alone. | |||
; Units | |||
: allows to switch trailing units between points and percents for all the parameters except Trail distance. Percents are used for crypto arbitrage. <br />'''Default:''' Points. | |||
; Direction | |||
: allows to set directions for orders. If selected 'Buy only' or 'Sell only' it will open trades only by signals in allowed directions. 'Both' allows to open trades in any direction. <br />'''Default:''' Both. | |||
; Min Spread Slow | |||
: minimal allowed spread for a slow broker. If actual spread is lower than Min spread slow value, arbitrage signals are ignored. <br />'''Default:''' 0. '''Value to ignore:''' 0. A negative value does not switch it off: it turns on a different check based on the average spread. | |||
; Max Spread Slow | |||
: maximum allowed spread for a slow broker. If actual spread is higher than Max spread slow value, arbitrage signals are ignored. <br />'''Default:''' -1. '''Value to ignore:''' -1. Do not use 0: it blocks almost all signals. Signals are also ignored when the spread equals this value. | |||
; Max Spread Fast | |||
: maximum allowed spread for a fast feed. If actual spread is higher than Max spread fast value, arbitrage signals are ignored. <br />'''Default:''' 20. '''Value to ignore:''' -1. Do not use 0: it blocks almost all signals. Signals are also ignored when the spread equals this value. | |||
; Bid offset | |||
: constant distance between bid on a fast and bid on a slow broker (in points). <br />'''Default:''' 0. '''Value to ignore:''' 0. | |||
; Ask offset | |||
: constant distance between ask on a fast and ask on a slow broker (in points). <br />'''Default:''' 0. '''Value to ignore:''' 0. | |||
; Offset Calc | |||
: allows to enable automatic offset calculation. <br />'''Default:''' off. When it is on, no trades open until the first offset calculation is finished (one offset recalculation Interval, 60 seconds by default). | |||
; Comment | |||
: internal order identifier. If several instances of the same instrument are used in the strategy, comments for each instance should be different. <br />'''Default:''' created automatically, different for each instrument. | |||
; Diff limit | |||
: maximum allowed difference for opening arbitrage trade. If actual difference is higher, signal is ignored. <br />'''Default:''' 0. '''Value to ignore:''' 0. Do not use -1: unlike Max spread, a negative Diff limit blocks entries. | |||
; Reverse factor % | |||
: closes an open position early when the fast/slow difference turns against it. The threshold is the larger of Reverse factor % of Diff to open (of Min move when Diff to open is 0) and one third of the difference the position was opened on. 0 = disabled. See [[#Reverse factor %: close on an opposite signal|Reverse factor %: close on an opposite signal]]. <br />'''Default:''' 0. '''Value to ignore:''' 0. | |||
; Min move | |||
: minimum move of the fast feed within Trend interval required to detect an impulse (in the instrument's units, points or %). 0 = disabled, entries work as before. See [[#Min move: entry on a fast-feed impulse|Min move: entry on a fast-feed impulse]]. <br />'''Default:''' 0. '''Value to ignore:''' 0. | |||
; Trend interval (ms) | |||
: time window in milliseconds in which the fast feed must move by at least Min move. <br />'''Default:''' 100. Used only when Min move is above 0. | |||
; Cooldown (ms) | |||
: minimum time in milliseconds between two impulse signals on the same symbol. <br />'''Default:''' 0. '''Value to ignore:''' 0 (no pause between impulse signals). | |||
' | == Statistical parameters (can't be modified) == | ||
; Curr Buy Diff | |||
: current buy difference between a fast feed and a slow broker. | |||
; Curr Sell Diff | |||
: current sell difference between a fast feed and a slow broker. | |||
; Max Buy Diff | |||
: maximum buy difference between a fast feed and a slow broker detected since the last software restart or the last Max diff values reset. | |||
; Max Sell Diff | |||
: maximum sell difference between a fast feed and a slow broker detected since the last software restart or the last Max diff values reset. | |||
; Curr Spread Slow | |||
: current spread on a slow broker (in points) | |||
; Curr Spread Fast | |||
: current spread on a fast broker (in points) | |||
; Max Buy Diff Time | |||
: time when the current Max Buy Diff value was detected. | |||
; Max Sell Diff Time | |||
: time when the current Max Sell Diff value was detected. | |||
== Right-click menu parameters == | |||
[[File:Q.png|none|frameless|border]] | |||
; Columns | |||
: allows to hide or show selected symbol columns. | |||
; Clear max diff | |||
: resets Max diff values. | |||
; Add instrument | |||
: allows to add a new instrument to table. | |||
; Remove instrument | |||
: removes selected instrument from table. | |||
<div style="clear:both"></div> | ; Adjust settings automatically | ||
: automatic configuration based on spreads. | |||
; Reset settings to default | |||
: changes settings back to the default preset. | |||
; Save as template | |||
: allows to set current symbol configuration to template file. | |||
; Enable all | |||
: enables all the symbols in the settings table | |||
; Disable all | |||
: disables all the symbols in the settings table | |||
: <div style="clear:both"></div> | |||
== Fast impulse entry and close on reverse == | == Fast impulse entry and close on reverse == | ||
The Latency arbitrage (OneLeg) strategy has two per-instrument options: an entry triggered by a sharp move of the fast feed ('''Min move''') and an early exit when the difference turns against an open position ('''Reverse factor %'''). Both are off by default (value 0), so existing strategies keep working exactly as before. Both work in live trading, emulator mode, backtesting and optimization. | The Latency arbitrage (OneLeg) strategy has two per-instrument options: an entry triggered by a sharp move of the fast feed ('''Min move''') and an early exit when the difference turns against an open position ('''Reverse factor %'''). Both are off by default (value 0), so existing strategies keep working exactly as before. Both work in live trading, emulator mode, backtesting and optimization. | ||
=== Min move: entry on a fast-feed impulse === | === Min move: entry on a fast-feed impulse === | ||
Parameters: '''Min move''', '''Trend interval (ms)''', '''Cooldown (ms)'''. | Parameters: '''Min move''', '''Trend interval (ms)''', '''Cooldown (ms)'''. | ||
The strategy watches the fast feed's own movement. An impulse is a move of at least '''Min move''' (in the instrument's diff units, points or %) within '''Trend interval (ms)''', measured from the price at the start of the interval to the current price. A spike that goes up and comes back inside the interval does not count. The direction of the impulse is the trade direction, and Reverse trading still applies. | The strategy watches the fast feed's own movement. An impulse is a move of at least '''Min move''' (in the instrument's diff units, points or %) within '''Trend interval (ms)''', measured from the price at the start of the interval to the current price. A spike that goes up and comes back inside the interval does not count. The direction of the impulse is the trade direction, and Reverse trading still applies. | ||
== When a trade opens == | |||
{| class="wikitable" | {| class="wikitable" | ||
! Min move !! Diff to open !! Entry condition | ! Min move !! Diff to open !! Entry condition | ||
| Line 161: | Line 152: | ||
=== Reverse factor %: close on an opposite signal === | === Reverse factor %: close on an opposite signal === | ||
When a position is open and the fast/slow difference turns against it by at least the threshold, the position is closed at market right away, without waiting for TP, SL or order lifetime. The signal that closed it does not open a new trade in the other direction. | When a position is open and the fast/slow difference turns against it by at least the threshold, the position is closed at market right away, without waiting for TP, SL or order lifetime. The signal that closed it does not open a new trade in the other direction. | ||
== Threshold is the larger of == | |||
* Reverse factor % of Diff to open (of Min move when Diff to open is 0); | * Reverse factor % of Diff to open (of Min move when Diff to open is 0); | ||
* one third of the difference the position was opened on. | * one third of the difference the position was opened on. | ||
Latest revision as of 19:55, 21 October 2026
Latency arbitrage or 1 leg arbitrage is a classic arbitrage strategy based on price discrepancies between single slow broker and a source of fast quotes (fast feed). It compares prices between a slow broker and a fast feed and once arbitrage difference detected it places trade in the direction of arbitrage difference. For instance, if EURUSD price on a slow broker is 1.08567 and 1.08540 on a fast feed it enters sell position on EURUSD. After that position is trailed and closed by one of the closing trigger (SL, TP, trailing stop, time stop).
Latency arbitrage can be used for Forex brokers and crypto exchanges. Learn more about Latency Arbitrage
Instruments and orders tab
In this tab main trading parameters are set.

Description of the parameters
Default values are the values of a newly added instrument (Add instrument). Values are in points unless Units is set to Percent. A parameter set to its value to ignore is switched off.
- Enabled
- enables or disables trading on a selected instrument.
Default: checked. - Name
- symbol name on a fast feed.
Default: empty. - Lot size
- lot size to be traded.
Default: 0.01. - Lot type
- allows to switch between Fixed or Balance % lot type. Balance % lot type is calculated based on the following formula:
- LotSize = (YourAccountBalance/1000)*(PercentValue/100).
Default: Fixed. - Decimals
- number of decimal places in symbol quotes.
Default: 5. - Spread SL
- allows to calculate SL based on spread. When Spread SL is enabled actual SL is calculated as a current spread multiplied by S/L value.
Default: off. - S/L
- hidden stoploss for an arbitrage trade.
Default: 50. Value to ignore: 0 (no stop loss). With S/L 0 trailing does not work either, because trailing moves the stop loss. - T/P
- hidden takeprofit for an arbitrage trade.
Default: 300. Value to ignore: 0 (no take profit). - Min profit
- starting point for trailing.
Default: 10. Value to ignore: 0 together with Trail distance 0. With Trail distance above 0, Min profit 0 starts trailing as soon as the trade is in profit. - Pips for Min Profit
- when set Min profit parameter comes into effect after price reaches Pips for Min profit value. Used for brokers with wide stop/freeze levels.
Default: 0. Value to ignore: 0. - Trail distance
- distance arbitrage trade is trailed at.
Default: 20. Value to ignore: 0 (no trailing). Min profit then only moves the stop loss to the entry price plus Min profit once that profit is reached. - Trail units
- allows to switch trailing units between points and percents. Trailing in % mostly used in crypto arbitrage.
Default: Points. - Order lifetime
- maximum arbitrage deal duration (expressed in seconds)
Default: 60. Value to ignore: 0 (no time limit). - Slippage
- max allowed deviation from the price order is sent at. If price goes beyond allowed deviation order gets reject or requote. Works only for instant execution accounts and limit orders on FIX API accounts. For market execution accounts it has no effect.
Default: 50. There is no value to ignore. - Commissions
- can be set if broker charges commissions. Commissions are calculated per million (10 standard lots) so if broker charges $7 per standard lot they should be set to 70. Parameter has no effect on trading, it affects only on profit display.
Default: 0. Value to ignore: 0. - Diff calculation method
- allows to switch between several calculation modes of arbitrage difference:
Default: Standard. - Standard (universal mode, suitable for most setups)
- BuyDiff = FastAsk - SlowAsk
- SellDiff = SlowBid - FastBid
- SpreadCorrected (recommended when spreads on a slow broker are lower than on a fast feed)
- BuyDiff = (FastBid - SlowAsk)
- SellDiff = (SlowBid – FastAsk)
- Reversed (experimental mode)
- BuyDiff = FastBid - SlowBid
- SellDiff = SlowAsk – FastAsk
- Include spread
- allows to include or exclude spreads from difference calculation. We recommend to keep this option checked.
Default: checked. Ignored when Units is set to Percent. - Diff to open
- difference between prices on a slow broker and a fast feed for opening arbitrage deal.
Default: 30. There is no value to ignore: with Min move 0, Diff to open 0 opens a trade on any positive difference. With Min move above 0, Diff to open 0 opens a trade on the impulse alone. - Units
- allows to switch trailing units between points and percents for all the parameters except Trail distance. Percents are used for crypto arbitrage.
Default: Points. - Direction
- allows to set directions for orders. If selected 'Buy only' or 'Sell only' it will open trades only by signals in allowed directions. 'Both' allows to open trades in any direction.
Default: Both. - Min Spread Slow
- minimal allowed spread for a slow broker. If actual spread is lower than Min spread slow value, arbitrage signals are ignored.
Default: 0. Value to ignore: 0. A negative value does not switch it off: it turns on a different check based on the average spread. - Max Spread Slow
- maximum allowed spread for a slow broker. If actual spread is higher than Max spread slow value, arbitrage signals are ignored.
Default: -1. Value to ignore: -1. Do not use 0: it blocks almost all signals. Signals are also ignored when the spread equals this value. - Max Spread Fast
- maximum allowed spread for a fast feed. If actual spread is higher than Max spread fast value, arbitrage signals are ignored.
Default: 20. Value to ignore: -1. Do not use 0: it blocks almost all signals. Signals are also ignored when the spread equals this value. - Bid offset
- constant distance between bid on a fast and bid on a slow broker (in points).
Default: 0. Value to ignore: 0. - Ask offset
- constant distance between ask on a fast and ask on a slow broker (in points).
Default: 0. Value to ignore: 0. - Offset Calc
- allows to enable automatic offset calculation.
Default: off. When it is on, no trades open until the first offset calculation is finished (one offset recalculation Interval, 60 seconds by default). - Comment
- internal order identifier. If several instances of the same instrument are used in the strategy, comments for each instance should be different.
Default: created automatically, different for each instrument. - Diff limit
- maximum allowed difference for opening arbitrage trade. If actual difference is higher, signal is ignored.
Default: 0. Value to ignore: 0. Do not use -1: unlike Max spread, a negative Diff limit blocks entries. - Reverse factor %
- closes an open position early when the fast/slow difference turns against it. The threshold is the larger of Reverse factor % of Diff to open (of Min move when Diff to open is 0) and one third of the difference the position was opened on. 0 = disabled. See Reverse factor %: close on an opposite signal.
Default: 0. Value to ignore: 0. - Min move
- minimum move of the fast feed within Trend interval required to detect an impulse (in the instrument's units, points or %). 0 = disabled, entries work as before. See Min move: entry on a fast-feed impulse.
Default: 0. Value to ignore: 0. - Trend interval (ms)
- time window in milliseconds in which the fast feed must move by at least Min move.
Default: 100. Used only when Min move is above 0. - Cooldown (ms)
- minimum time in milliseconds between two impulse signals on the same symbol.
Default: 0. Value to ignore: 0 (no pause between impulse signals).
Statistical parameters (can't be modified)
- Curr Buy Diff
- current buy difference between a fast feed and a slow broker.
- Curr Sell Diff
- current sell difference between a fast feed and a slow broker.
- Max Buy Diff
- maximum buy difference between a fast feed and a slow broker detected since the last software restart or the last Max diff values reset.
- Max Sell Diff
- maximum sell difference between a fast feed and a slow broker detected since the last software restart or the last Max diff values reset.
- Curr Spread Slow
- current spread on a slow broker (in points)
- Curr Spread Fast
- current spread on a fast broker (in points)
- Max Buy Diff Time
- time when the current Max Buy Diff value was detected.
- Max Sell Diff Time
- time when the current Max Sell Diff value was detected.
Right-click menu parameters

- Columns
- allows to hide or show selected symbol columns.
- Clear max diff
- resets Max diff values.
- Add instrument
- allows to add a new instrument to table.
- Remove instrument
- removes selected instrument from table.
- Adjust settings automatically
- automatic configuration based on spreads.
- Reset settings to default
- changes settings back to the default preset.
- Save as template
- allows to set current symbol configuration to template file.
- Enable all
- enables all the symbols in the settings table
- Disable all
- disables all the symbols in the settings table
Fast impulse entry and close on reverse
The Latency arbitrage (OneLeg) strategy has two per-instrument options: an entry triggered by a sharp move of the fast feed (Min move) and an early exit when the difference turns against an open position (Reverse factor %). Both are off by default (value 0), so existing strategies keep working exactly as before. Both work in live trading, emulator mode, backtesting and optimization.
Min move: entry on a fast-feed impulse
Parameters: Min move, Trend interval (ms), Cooldown (ms).
The strategy watches the fast feed's own movement. An impulse is a move of at least Min move (in the instrument's diff units, points or %) within Trend interval (ms), measured from the price at the start of the interval to the current price. A spike that goes up and comes back inside the interval does not count. The direction of the impulse is the trade direction, and Reverse trading still applies.
When a trade opens
| Min move | Diff to open | Entry condition |
|---|---|---|
| 0 | any | As before: the fast/slow difference is above Diff to open. |
| > 0 | > 0 | An impulse, and the fast/slow difference on the same side is still above Diff to open, so the slow broker has not caught up yet. |
| > 0 | 0 | The impulse alone. |
- Cooldown (ms) is the minimum time between two impulse signals on the same symbol.
- All other conditions still apply: spread limits, trade pause, allowed direction, diff limit, trading hours, news filter and one position per instrument.
- Starting values for Trend interval: 50–100 ms for FX, 30–50 ms for gold, indices and crypto. Set Min move above the slow broker's usual spread.
Reverse factor %: close on an opposite signal
When a position is open and the fast/slow difference turns against it by at least the threshold, the position is closed at market right away, without waiting for TP, SL or order lifetime. The signal that closed it does not open a new trade in the other direction.
Threshold is the larger of
- Reverse factor % of Diff to open (of Min move when Diff to open is 0);
- one third of the difference the position was opened on.
Example: Diff to open 10 points, Reverse factor 50%. A position opened on a 30-point difference closes when the opposite difference reaches 10 points (30 / 3, which is larger than 50% of 10 = 5). An opposite difference of 7 points does nothing.
- A reverse close can happen below Diff to open and outside trading hours, like a TP or SL close. It is not sent while spreads are over their limits, during trade pause or when the slow broker is disconnected. Trade pause applies again after a reverse close.
- These closes are marked in the strategy log with
Reason: Reverse signal. - Do not combine it with the older Reverse closing option. When that option is on, Reverse factor % is ignored.
- Not used by copy-trading (slave) strategies, clicker mode or UDP signals.
All four new columns (Min move, Trend interval, Cooldown, Reverse factor %) can be included in optimization.