Contents
This sample demonstrates the use of the StreamBase FXall Relationship Trading adapter.
In StreamBase Studio, import this sample with the following steps:
-
From the top menu, click → .
-
Select this sample from the Embedded Input Adapters list.
-
Click OK.
StreamBase Studio creates a project for this sample.
By default, the sample files are installed in:
- On Windows
-
C:\Program Files\StreamBase Systems\StreamBase.n.m\sample\adapter\embedded\fxall\ - On UNIX
-
/opt/streambase/sample/adapter/embedded/fxall/
When you load the sample into StreamBase Studio, Studio copies the
sample project's files to your Studio workspace. StreamBase Systems
recommends that you use the workspace copy of the sample, especially on UNIX, where
you may not have write access to /opt/streambase. In
the default installation, the path to this sample in your Studio workspace is:
UNIX: ~/streambase-studio-n.m-workspace/sample_adapter_embedded_fxall Windows XP: C:\Documents and Settings\username\My Documents\StreamBase Studion.mWorkspace\ sample_embedded_fxall Windows Vista: C:\Users\username\Documents\StreamBase Studion.mWorkspace\ sample_embedded_fxall
-
In the Package Explorer, double-click
fxall.sbapp. -
Select the Parameters tab.
-
Enter site-specific values for your FXall host (typically an HTTPS URI), username, and password. Enter the absolute path of the directory containing your FXall keystore files.
-
Click the
Run button. This opens the SB
Test/Debug perspective and starts the application.
-
In the Test/Debug Perspective, open the Application Output view. If connectivity is configured correctly, look for tuples emitted on the
Statusstreams indicating a connection has been opened to your FXall server. -
In the Manual Input view, select the
QueryRequeststream, enter a value in theTagfield, and click . A tuple is emitted on theQueryResponsestream containing information retrieved from the FXall server, including the set of valid accounts, providers, currencies, tenors. -
Select the
SubmitDealstream, enter values in the following required fields, and click . Missing or invalid input will result in a tuple from theFXallOutputStatusstream describing the invalid input.-
UserId (note: the sample application appends a sequence number to the UserId to ensure its uniqueness)
-
TwoWay
-
Providers (enter at least one)
-
Order.InstrumentOrders (create at least one)
-
Order.InstrumentOrder.Type
-
Order.InstrumentOrder.BaseCurrency
-
Order.InstrumentOrder.TermsCurrency
-
Order.InstrumentOrder.DealtCurrency
-
Order.InstrumentOrder.Legs (one required for SPOT deals)
-
Order.InstrumentOrder.Leg.ValueDateType
-
Order.InstrumentOrder.Leg.Requirements (create at least one)
-
Order.InstrumentOrder.Leg.Requirement.TakerBuysBase (required for one-way deals)
-
Order.InstrumentOrderLeg.Requirement.Account
-
Order.InstrumentOrderLeg.Requirement.DealAmount
-
-
Assuming a valid deal was entered, one or more tuples are emitted on the
FXallEventsstream indicating the deal was submitted successfully (EventType=SubmitOk) and, possibly, that the deal was picked up by one or more providers (EventType=DealPickup), which start providing quotes (EventType=NewPrice). -
Select the
AcceptDealstream, enter in theQuoteIdfield the corresponding value from one of the NewPrice tuples, entertrueorfalsein theTakerBuysBaseField(if the corresponding field had not been set when submitting the deal), and click . -
Assuming the deal is accepted, a deal logged tuple (
EventType=DealLogged) is emitted on theFXallEventsstream. -
When done, press F9 or click the
Stop Running Application button.
This section describes how to run the sample in UNIX terminal windows or Windows command prompt windows. On Windows, be sure to use the StreamBase Command Prompt from the Start menu as described in the Test/Debug Guide, not the default command prompt.
Note
Because of the complexity of the input and output schemas used by this adapter, it is not practical to submit deals from terminal windows.
-
Open three terminal windows on UNIX, or three StreamBase Command Prompts on Windows. In each window, navigate to your workspace copy of the sample, as described above.
-
In window 1, type:
sbd fxall.sbapp -
In window 2, type:
sbc dequeue -vThis window will display the tuples dequeued from the adapters' output ports.
-
In window 3, issue a query request :
echo MyTag,null,null,null,null,null,null,null,null,null,null | sbc enqueue QueryRequest -
Observe in windows 2 a tuple emitted from the QueryResponse stream.
-
In window 3, type the following command to terminate the server and dequeuer:
sbadmin shutdown
