LockCL 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
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
===== How does LockCL built-in arbitrage strategy work? =====
===== Lock CL is adopted for netted accounts version of Lock CL2 strategy. It does not open hedging positions on the same accounts. =====
LockCL arbitrage is a type of [[Lock Arbitrage]].
We recommend this strategy for latency arbitrage on FIX API accounts.


Step 1. - It opens the first order by signal, trails it, and after the closing trigger is hit, opens a hedging position on the opposite account.
How it works:


Step 2. - It closes one of the open positions by arbitrage signal, trails the remaining one, and closes it by closing trigger.
Step 1)It opens the first order by signal, trails it and after closing trigger is hit opens a hedging position on opposite account.


After that, it starts over.
Step 2)It closes one of the open positions by arbitrage signal, trails the remaining one and closes it by closing trigger.


===== LockCL arbitrage Instruments & Orders =====
After that it proceeds to step 1.
[[File:LockCL.png|frameless|1338x1338px]]


'''Enabled''' - controls if the instrument is allowed to trade or not.
Instruments and orders parameters and strategy settings are completely the same with Lock CL2 strategy.
[[File:Cl22.png|center|frameless|1063x1063px]]
[[File:Cl222.png|center|frameless|739x739px]]


'''Name''' – instrument name on feeder.
Description of the parameters:


'''Lot size 1''' – lot size to be traded on the left side account.
'''Enabled –''' enables or disables trading on a selected instrument.


Lot size 2 - lot size to be traded on the right side account.
'''Name –''' symbol name on a fast feed.


'''Digits''' – how much digits instrument has in decimals.
'''Lot size 1 –''' lot size to be traded on side 1.


'''Spread SL''' - please check this box if you want to calculate Stop Los like percent from the spread.
'''Lot size 2 –''' lot size to be traded on side 2.


'''S/L''' – hidden stop loss for the position in points, if box "Spread SL" is not checked and in percent from the spread, if box "Spread SL" is checked.
'''Decimals''' – number of decimal places in symbol quotes.


'''T/P''' – hidden take profit 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.


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


'''Pips for Min Profit''' – reserved, not used.
'''T/P''' – hidden takeprofit for an arbitrage trade.


'''Trail distance''' – the distance (in points) that is used for trailing on position.
'''Min profit''' – starting point for trailing.


'''Trailing units''' - Points / Present . The software can calculate trailing stop in points or like percent from instrument's price.
'''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.


'''Order lifetime''' – the maximum time the position can be opened.
'''Trail distance''' – distance arbitrage trade is trailed at.


'''Slippage 1''' – for instant execution brokers or FIX API brokers if you use limit orders - maximum allowed distance from requested price for the left side account.
'''Trail units''' – allows to switch trailing units between points and percents.  


'''Slippage 2''' – for instant execution brokers or FIX API brokers if you use limit orders - maximum allowed distance from requested price for the right side account.
'''Order lifetime''' – maximum arbitrage deal duration (expressed in seconds)


'''Commissions1''' - you can set commissions for round turn for your left side account.
'''Slippage 1''' – max allowed deviation from the price order is sent at for side 1. 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.


'''Commissions2''' - you can set commissions for round turn for your right side broker.
'''Slippage 2''' – max allowed deviation from the price order is sent at for side 2.


'''Diff calculation method''' - please select one of 3: Standard, Reversed, SpreadCorrected.
'''Commissions 1''' –  commissions for side 1.  Should 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
'''Commissions 2 –''' commissions for side 2.
 
'''Initial direction  –''' allows to set initial directions for lock orders. If selected 'Buy on 1' or 'Sell on 1' it will open trades only by signals in allowed directions. 'Neutral' allows to open trades in any direction.
 
'''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 53: Line 60:
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


SpreadCorrected
'''Include spread''' – allows to include or exclude spreads from difference calculation. We recommend to keep this option checked.


BuyDiff = (FastBid - SlowAsk)
'''Diff to open 1'''– difference between prices on a slow broker and a fast feed for opening arbitrage deal on side 1.
 
'''Diff to open 2'''– difference between prices on a slow broker and a fast feed for opening arbitrage deal on side 2.
 
'''Min Spread Slow 1''' – minimal allowed spread for a slow broker 1. If actual spread is lower than Min spread slow 1 value, arbitrage signals are ignored.
 
'''Min Spread Slow 2'''– minimal allowed spread for a slow broker 2. If actual spread is lower than Min spread slow 2 value, arbitrage signals are ignored.
 
'''Max Spread Slow''' – maximum allowed spread for both slow brokers. 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 1''' – constant distance between bid on a fast and bid on a slow 1 broker (in points).
 
'''Bid offset 2''' – constant distance between bid on a fast and bid on a slow 2 broker (in points).
 
'''Ask offset 1'''– constant distance between ask on a fast and ask on a slow 1 broker (in points).
 
'''Ask offset 2'''– constant distance between ask on a fast and ask on a slow 2 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.
 
'''Min Time''' – no effect in Lock CL2 strategy.


SellDiff = (SlowBid - FastAsk)
'''Min Pips''' – no effect in Lock CL2 strategy.


'''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 Diff 2''' – current buy difference between a fast feed and a slow broker 1.


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


'''Max spread slow 1''' - maximum allowed spread for the left side broker.
'''Max Diff 1''' maximum buy difference between a fast feed and a slow broker 1 detected since the last software restart or the last Max diff values reset.


'''Max spread slow 2''' - maximum allowed spread for the right side broker.
'''Max Diff 2''' maximum sell difference between a fast feed and a slow broker 2 detected since the last software restart or the last Max diff values reset.


'''Max spread slow''' -
'''Curr Spread Slow 1'''– current spread on a slow broker 1 (in points)


'''Max spread Fast''' - maximum allowed spread for the fast feed.
'''Curr Spread Slow 2'''– current spread on a slow broker 2 (in points)


'''Bid offset 1''' - constant distance between bid on fast and bid on the slow left side broker (in points)
'''Curr Spread Fast''' – current spread on a fast broker (in points)


'''Bid offset 2''' - constant distance between bid on fast and bid on the slow right side broker (in points)
'''''Right-click menu parameters:'''''
[[File:W.png|left|frameless]]
'''Columns''' – allows to hide or show selected symbol columns.


'''Ask offset 1''' - constant distance between ask on fast and ask on the slow left side broker (in points)
'''Clear max diff''' – resets Max diff values.


'''Ask offset 2''' - constant distance between ask on fast and ask on the slow right side broker (in points)
'''Add instrument''' – allows to add a new instrument to table.


'''Offset Calc''' – controls if the offset recalculation is used on instrument or not.
'''Remove instrument''' – removes selected instrument from table.


'''Comment''' - internal identifier. The comment should be different for similar instruments.
'''Save instrument settings''' – force save of current configuration to database.


'''Diff limit''' – maximum allowed difference for arbitrage signal.
'''Open lock on selected instrument''' – allows to open initial lock manually on selected instrument.


'''Curr Diff 1-''' current difference for between fast feed and the left side broker.
'''Close lock on selected instrument''' – allows to close lock manually on selected instrument.


'''Curr Diff 2'''- current difference for between fast feed and the right side broker.
'''Open locks on all enabled instruments''' – allows to open initial locks manually on all active instruments.


'''Max Diff 1''' – the maximum difference between the fast feed and the left side broker that was detected during software was running.
'''Adjust settings automatically''' – automatic configuration based on spreads.


'''Max Diff 2''' – the maximum difference between the fast feed and the right side broker that was detected during software was running.
'''Reset settings to default''' – changes settings back to the default preset.


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


'''Curr Spread Slow 2''' – current spread on the right side broker (in points)
'''Disable all''' – disables all the symbols in the settings table.


'''Curr Spread Fast''' – current spread on feeder (in points)
'''Save as template''' – allows to set current symbol configuration to template file.

Latest revision as of 21:56, 18 December 2023

Lock CL is adopted for netted accounts version of Lock CL2 strategy. It does not open hedging positions on the same accounts.

We recommend this strategy for latency arbitrage on FIX API accounts.

How it works:

Step 1)It opens the first order by signal, trails it and after closing trigger is hit opens a hedging position on opposite account.

Step 2)It closes one of the open positions by arbitrage signal, trails the remaining one and closes it by closing trigger.

After that it proceeds to step 1.

Instruments and orders parameters and strategy settings are completely the same with Lock CL2 strategy.

Description of the parameters:

Enabled – enables or disables trading on a selected instrument.

Name – symbol name on a fast feed.

Lot size 1 – lot size to be traded on side 1.

Lot size 2 – lot size to be traded on side 2.

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.

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

Slippage 1 – max allowed deviation from the price order is sent at for side 1. 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.

Slippage 2 – max allowed deviation from the price order is sent at for side 2.

Commissions 1 – commissions for side 1. Should 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.

Commissions 2 – commissions for side 2.

Initial direction – allows to set initial directions for lock orders. If selected 'Buy on 1' or 'Sell on 1' it will open trades only by signals in allowed directions. 'Neutral' allows to open trades in any direction.

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 1– difference between prices on a slow broker and a fast feed for opening arbitrage deal on side 1.

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

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

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

Max Spread Slow – maximum allowed spread for both slow brokers. 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 1 – constant distance between bid on a fast and bid on a slow 1 broker (in points).

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

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

Ask offset 2– constant distance between ask on a fast and ask on a slow 2 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.

Min Time – no effect in Lock CL2 strategy.

Min Pips – no effect in Lock CL2 strategy.

Statistical parameters (can't be modified):

Curr Diff 2 – current buy difference between a fast feed and a slow broker 1.

Curr Diff 2 – current sell difference between a fast feed and a slow broker 2.

Max Diff 1 – maximum buy difference between a fast feed and a slow broker 1 detected since the last software restart or the last Max diff values reset.

Max Diff 2 – maximum sell difference between a fast feed and a slow broker 2 detected since the last software restart or the last Max diff values reset.

Curr Spread Slow 1– current spread on a slow broker 1 (in points)

Curr Spread Slow 2– current spread on a slow broker 2 (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.

Save instrument settings – force save of current configuration to database.

Open lock on selected instrument – allows to open initial lock manually on selected instrument.

Close lock on selected instrument – allows to close lock manually on selected instrument.

Open locks on all enabled instruments – allows to open initial locks manually on all active instruments.

Adjust settings automatically – automatic configuration based on spreads.

Reset settings to default – changes settings back to the default preset.

Enable all – enables all the symbols in the settings table.

Disable all – disables all the symbols in the settings table.

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