Block trades

Block Trade tickets allow users to perform a single amalgamated FX trade that is split across several accounts.

They implement "pre-trade allocations", enabling the user to import the required account allocations from a spreadsheet.

Spot, forward and swap trades are supported.

Block Trade tickets consist of a blade where the code is under the directory <YOURAPP>/fxexecution-bladeset/blades/blocktrade. They are implemented as a Presenter component whose main presentation model class is caplinx.fxexecution.blocktrade.manager.Manager and HTML template is <blade-home>/html/resources/manager/template.html.

GUI Structure

The image below shows the Block Trade ticket with two blocks of trades one for EURGBP the other GBPUSD. Each block displays how the trade will be split between accounts. The Import/Export buttons allow blocks to be loaded from and saved to a spreadsheet.

block trade entry

The Netted tab displays the single resultant amalgamated trade for each block as shown below:

block trade netted

Finally clicking the Quote button displays the Trading Mode tab. To execute trades within the block, click the Accept button. The trade is then executed as a single transaction where each account allocation is represented as a trade-leg.

block trade trading

Code Architecture

The Manager class is responsible for the overall control of the ticket. Every time it is displayed, a new instance is instantiated. Each block is managed by an instance of the caplinx.fxexecution.blocktrade.block.presentation.BlockTrade class which in turn creates an instance of caplinx.fxexecution.blocktrade.block.presentation.BlockTradeLeg for each allocation row. Each BlockTrade creates an instance of the trade model from the trade service. The caplinx.fxexecution.blocktrade.BlocktradeBootstrap class registers caplinx.fxexecution.blocktrade.block.trademodel.FXBlockTradeFactory as the factory for the caplinx.fxexecution.blocktrade.block.trademodel.FXBlockTrade trade model class which in turn uses instances of caplinx.fxexecution.blocktrade.block.trademodel.FXBlockTradeLeg to model each allocation row. The trade model contains trade legs for both allocation rows and a single row for the netted values. Changing the mode (from input to netted or trading) simply toggles the visibility of those trade legs. See the Block Trade Message Specifications for details about the messages sent to the eserver when the trade is executed.


See more: