Latency Arbitrage: Difference between revisions

From SharpTrader Arbitrage Software Wiki: A Detailed Overview of High-Speed Trading Technology
Jump to navigation Jump to search
No edit summary
No edit summary
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
===== Latency Arbitrage Description =====
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 is a [https://bjftradinggroup.com/high-frequency-trading/ high-frequency trading strategy] that capitalizes on price discrepancies arising from delays or "latency" in the transmission of market information. These time delays occur because of the physical distances between markets and the time it takes for data to travel from one location to another.


In a typical latency arbitrage strategy, high-frequency traders use sophisticated algorithms and high-speed networks to gain early access to market price information. They then use this information to execute trades before other market participants have received the same information.
Latency arbitrage can be used for Forex brokers and crypto exchanges.


'''Here is a simplified example to illustrate how latency arbitrage might work:'''
'''Latency arbitrage strategy Instruments and orders Tab'''


# A trader with advanced technology receives information that a particular stock's price has risen to $101 on Exchange A.
In this tab main trading parameters are set.
# The same stock is still priced at $100 on Exchange B due to latency, so Exchange B's price hasn't been updated yet.
[[File:1l.png|center|frameless|1188x1188px]]
# The trader quickly buys the stock at $100 on Exchange B before the price information from Exchange A has had a chance to reach Exchange B.
# When the price on Exchange B updates to $101, the trader can sell the stock, making a $1 profit per share minus any trading costs.


Latency arbitrage has risks and complexities. The strategy requires substantial investments in technology and infrastructure, including proximity hosting, algorithmic trading platforms, and real-time data feeds. Additionally, the strategy is only profitable if there are sufficient price discrepancies to take advantage of, which can disappear in highly efficient markets. Finally, the strategy is often criticized for contributing to market instability, and there's an ongoing debate about the fairness of giving some market participants preferential access to price information.
Description of the parameters:


===== Latency Arbitrage Instruments & Orders =====
'''Enabled –''' enables or disables trading on a selected instrument.
[[File:Latency.png|frameless|1372x1372px]]


'''Enabled''' - controls if the instrument is allowed to trade or not.
'''Name –''' symbol name on a fast feed.


'''Name''' – instrument name on feeder.
'''Lot size –''' lot size to be traded.


'''Lot size''' lot size to be traded.
'''Lot type –''' allows to switch between '''Fixed''' or '''Balance %''' lot type. Balance % lot type is calculated based on the following formula:


'''Lot type''' - You can select from the list 2 type of the lot size. The lot size can be Fixed or Balance %.  Fixed - software will trade set lot size. Balance % - software will calculate lot size like set percent from the current balance on the account.
LotSize = (YourAccountBalance/1000)*(PercentValue/100).  


'''Digits''' – how much digits instrument has in decimals.
'''Decimals''' – number of decimal places in symbol quotes.


'''S/L''' – hidden stop loss for the position.
'''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.


'''T/P''' – hidden take profit for the position.
'''S/L''' – hidden stoploss for an arbitrage trade.


'''Min profit''' – how much profit the order should get (in points) for system to start trailing on this position.
'''T/P''' – hidden takeprofit for an arbitrage trade.


'''Pips for Min Profit''' – reserved, not used.
'''Min profit''' – starting point for trailing.


'''Trailing distance''' – the distance (in points) that is used for trailing on position.
'''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.


'''Trailing units''' - Points / Present . The software can calculate trailing stop in points or like percent from instrument's price.
'''Trail distance''' – distance arbitrage trade is trailed at.


'''Order lifetime''' – the maximum time the position can be opened.
'''Trail units''' – allows to switch trailing units between points and percents. Trailing in % mostly used in crypto arbitrage.


'''Slippage''' – for instant execution brokers - maximum allowed distance from requested price.
'''Order lifetime''' – maximum arbitrage deal duration (expressed in seconds)


'''Commissions''' - you can set commissions for round turn for your broker.
'''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.


'''Diff calculation method''' - please select one of 3: Standard, Reversed, SpreadCorrected.
'''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.


Standard
'''Diff calculation method''' – allows to switch between several calculation modes of arbitrage difference:
 
'''''Standard (univeral mode, suitable for most setups)'''''


BuyDiff = FastAsk - SlowAsk
BuyDiff = FastAsk - SlowAsk
Line 52: Line 50:
SellDiff = SlowBid - FastBid
SellDiff = SlowBid - FastBid


Reversed
'''''SpreadCorrected (recommened 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
BuyDiff = FastBid - SlowBid


SellDiff = SlowAsk - FastAsk
SellDiff = SlowAsk FastAsk
 
'''Include spread''' – allows to include or exclude spreads from difference calculation. We recommend to keep this option checked.
 
'''Diff to open''' – difference between prices on a slow broker and a fast feed for opening arbitrage deal.


SpreadCorrected
'''Units''' – allows to switch trailing units between points and percents for all the parameters except Trail distance. Percents are used for crypto arbitrage.


BuyDiff = (FastBid - SlowAsk)
'''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.
 
'''Min Spread Slow''' – minimal allowed spread for a slow broker. If actual spread is lower than Min spread slow value, arbitrage signals are ignored.
 
'''Max Spread Slow''' – maximum allowed spread for a slow broker. If actual spread is higher than Max spread slow value, arbitrage signals are ignored.
 
'''Max Spread Fast''' – maximum allowed spread for a fast feed. If actual spread is higher than Max spread fast value, arbitrage signals are ignored.
 
'''Bid offset''' – constant distance between bid on a fast and bid on a slow broker (in points).
 
'''Ask offset''' – constant distance between ask on a fast and ask on a slow broker (in points).
 
'''Offset Calc''' – allows to enable automatic offset calculation.
 
'''Comment''' – internal order identifier. If several instances of the same instrument are used in the strategy, comments for each instance should be different.


SellDiff = (SlowBid - FastAsk)
'''Diff limit''' – maximum allowed difference for opening arbitrage trade. If actual difference it higher, signal is ignored.


'''Include spread''' - check this box if you want to include the spread for differ to open calculation. The slow broker's spread will be extracted from the difference to open.
'''''Statistical parameters (can't be modified):'''''


'''Diff to open''' – distance between price on slow and fast to open the position.
'''Curr Buy Diff''' current buy difference between a fast feed and a slow broker.


'''Units''' - select units points or percent for difference to open calculation. the percent is useful for crypto currencies arbitrage.
'''Curr Sell Diff''' – current sell difference between a fast feed and a slow broker.


'''Bid offset''' - constant distance between bid on fast and bid on slow (in points)
'''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.


'''Ask offset''' - constant distance between ask on fast and ask on slow (in points)
'''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.


'''Offset Calc''' – controls if the offset recalculation is used on instrument or not.
'''Curr Spread Slow''' – current spread on a slow broker (in points)


'''Comment''' - internal identifier. The comment should be different for similar instruments.
'''Curr Spread Fast''' – current spread on a fast broker (in points)


'''Diff limit''' – maximum allowed difference for arbitrage signal.
'''''Right-click menu parameters:'''''
[[File:Q.png|left|frameless]]
'''Columns''' – allows to hide or show selected symbol columns.


'''Curr Buy Diff-''' current difference for buy arbitrage signal.
'''Clear max diff''' – resets Max diff values.


'''Curr Sell Diff'''- current difference for sell arbitrage signal.
'''Add instrument''' – allows to add a new instrument to table.


'''Max Buy Diff''' – the maximum difference for buy arbitrage signal that was detected during software was
'''Remove instrument''' – removes selected instrument from table.


running
'''Adjust settings automatically''' – automatic configuration based on spreads.


'''Max Sell Diff''' – the maximum difference for sell arbitrage signal that was detected during software was
'''Reset settings to default''' – changes settings back to the default preset.


running.
'''Save as template''' – allows to set current symbol configuration to template file.


'''Curr Spread Slow''' – current spread on slow broker (in points)
'''Enable all''' – enables all the symbols in the settings table


'''Curr Spread Fast''' – current spread on feeder (in points)
'''Disable all''' – disabled all the symbol in the settings table

Latest revision as of 21:55, 18 December 2023

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.

Latency arbitrage strategy Instruments and orders Tab

In this tab main trading parameters are set.

Description of the parameters:

Enabled – enables or disables trading on a selected instrument.

Name – symbol name on a fast feed.

Lot size – lot size to be traded.

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).

Decimals – number of decimal places in symbol quotes.

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.

S/L – hidden stoploss for an arbitrage trade.

T/P – hidden takeprofit for an arbitrage trade.

Min profit – starting point for trailing.

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.

Trail distance – distance arbitrage trade is trailed at.

Trail units – allows to switch trailing units between points and percents. Trailing in % mostly used in crypto arbitrage.

Order lifetime – maximum arbitrage deal duration (expressed in seconds)

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.

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.

Diff calculation method – allows to switch between several calculation modes of arbitrage difference:

Standard (univeral mode, suitable for most setups)

BuyDiff = FastAsk - SlowAsk

SellDiff = SlowBid - FastBid

SpreadCorrected (recommened 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.

Diff to open – difference between prices on a slow broker and a fast feed for opening arbitrage deal.

Units – allows to switch trailing units between points and percents for all the parameters except Trail distance. Percents are used for crypto arbitrage.

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.

Min Spread Slow – minimal allowed spread for a slow broker. If actual spread is lower than Min spread slow value, arbitrage signals are ignored.

Max Spread Slow – maximum allowed spread for a slow broker. If actual spread is higher than Max spread slow value, arbitrage signals are ignored.

Max Spread Fast – maximum allowed spread for a fast feed. If actual spread is higher than Max spread fast value, arbitrage signals are ignored.

Bid offset – constant distance between bid on a fast and bid on a slow broker (in points).

Ask offset – constant distance between ask on a fast and ask on a slow broker (in points).

Offset Calc – allows to enable automatic offset calculation.

Comment – internal order identifier. If several instances of the same instrument are used in the strategy, comments for each instance should be different.

Diff limit – maximum allowed difference for opening arbitrage trade. If actual difference it higher, signal is ignored.

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)

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 – disabled all the symbol in the settings table