Capital Markets Adapters 10.3 | Apama Capital Markets Adapters Documentation 10.3 | Barclays FX FIX Adapter | Example quote subscriptions and unsubscriptions
 
Example quote subscriptions and unsubscriptions
For Market Data (Quotes Requests) the below are valid examples of Legacy mode scenarios.

For Streaming 2-way SPOT prices for GBP/USD for 1M GBP (streaming prices in base currency)
com.apama.marketdata.SubscribeDepth("FIX", "BARX_MARKET_DATA", "GBP/USD",
{"Quote":"Y","40":"C","167":"FOR","15":"GBP","38":"1000000","64":"SP","6065":"0"})
com.apama.marketdata.UnsubscribeDepth("FIX", "BARX_MARKET_DATA", "GBP/USD",
{"Quote":"Y","40":"C","167":"FOR","15":"GBP","38":"1000000","64":"SP","6065":"0"})

For Streaming 2-way SPOT prices for GBP/USD for 3M GBP (streaming prices in base
currency in different volume band )
com.apama.marketdata.SubscribeDepth("FIX", "BARX_MARKET_DATA", "GBP/USD",
{"Quote":"Y","40":"C","167":"FOR","15":"GBP","38":"3000000","64":"SP","6065":"0"})
com.apama.marketdata.UnsubscribeDepth("FIX", "BARX_MARKET_DATA", "GBP/USD",
{"Quote":"Y","40":"C","167":"FOR","15":"GBP","38":"3000000","64":"SP","6065":"0"})

For Streaming 2-way SPOT prices for GBP/USD for 1M USD (streaming prices in
secondary currency)
com.apama.marketdata.SubscribeDepth("FIX", "BARX_MARKET_DATA", "GBP/USD",
{"Quote":"Y","40":"C","167":"FOR","15":"USD","38":"1000000","64":"SP","6065":"0"})
com.apama.marketdata.UnsubscribeDepth("FIX", "BARX_MARKET_DATA", "GBP/USD",
{"Quote":"Y","40":"C","167":"FOR","15":"USD","38":"1000000","64":"SP","6065":"0"})

For Streaming 1-way SPOT prices for GBP/USD for 1M GBP (streaming prices in base currency)
com.apama.marketdata.SubscribeDepth("FIX", "BARX_MARKET_DATA", "GBP/USD",
{"Quote":"Y","54":"1","40":"C","167":"FOR","15":"GBP","38":"1000000","64":"SP","6065":"0"})
com.apama.marketdata.UnsubscribeDepth("FIX", "BARX_MARKET_DATA", "GBP/USD",
{"Quote":"Y","54":"1","40":"C","167":"FOR","15":"GBP","38":"1000000","64":"SP","6065":"0"})

For Snapshot 2-way SPOT prices for GBP/USD for 1M GBP (snapshot prices
in base currency for 10 sec)
com.apama.marketdata.SubscribeDepth("FIX", "BARX_MARKET_DATA", "GBP/USD",
{"Quote":"Y","54":"1","40":"C","167":"FOR","15":"GBP","38":"1000000","64":"SP","6065":"10"})
com.apama.marketdata.UnsubscribeDepth("FIX", "BARX_MARKET_DATA", "GBP/USD",
{"Quote":"Y","54":"1","40":"C","167":"FOR","15":"GBP","38":"1000000","64":"SP","6065":"10"})

For Streaming 2-way FORWARD 2M prices for GBP/USD for 1M GBP (streaming prices in base currency)
com.apama.marketdata.SubscribeDepth("FIX", "BARX_MARKET_DATA", "GBP/USD",
{"Quote":"Y","40":"C","167":"FOR","15":"GBP","38":"1000000","64":"2M","6065":"0"})
com.apama.marketdata.UnsubscribeDepth("FIX", "BARX_MARKET_DATA", "GBP/USD",
{"Quote":"Y","40":"C","167":"FOR","15":"GBP","38":"1000000","64":"2M","6065":"0"})

For Streaming 2-way FORWARD broken date prices for GBP/USD for 1M GBP
(streaming prices in base currency)
com.apama.marketdata.SubscribeDepth("FIX", "BARX_MARKET_DATA", "GBP/USD",
{"Quote":"Y","40":"C","167":"FOR","15":"GBP","38":"1000000","64":"20091118","6065":"0"})
com.apama.marketdata.UnsubscribeDepth("FIX", "BARX_MARKET_DATA", "GBP/USD",
{"Quote":"Y","40":"C","167":"FOR","15":"GBP","38":"1000000","64":"20091118","6065":"0"})
NewOrders
*SecurityType(tag 167) and HandlInst(tag 21) must be specified in extra parameters for all orders. (Ex: "167":"FOR","21":"2")
*At-market orders example:

SELL 1M GBP
com.apama.oms.NewOrder("124","GBP/USD",0, "SELL", "FOREX MARKET", 1000000, "FIX",
"","","BARX_TRADING","","",{"167":"FOR","21":"2","15":"GBP","64":"SP"})
BUY 1M GBP, date 20091113
com.apama.oms.NewOrder("128","GBP/USD",0, "BUY", "FOREX MARKET", 2000000, "FIX",
"","","BARX_TRADING","","",{"167":"FOR","21":"2","15":"GBP","64":"20091113"})
*Previously-quoted orders:
*SettlDate(Tag 64), QuoteID (Tag 117) must be copied from the Quote (reported to the application as com.apama.marketdata.Depth) to NewOrder.
*Orders can be placed in the base or secondary currency. The section "Determining whether to use Bid or Offer Price" in the specification tells the appropriate price to be used when placing an order.
*Examples

SELL 2M GBP in base currency.
com.apama.oms.NewOrder("BARX:1","GBP/USD",1.65614,"SELL","PREVIOUSLY QUOTED",2000000,
"FIX","","","BARX_TRADING","","",{"117":"ZZOAXJPR15574031999897416",
"15":"GBP","167":"FOR","21":"2","64":"SP"})
BUY 1M USD in secondary currency.
com.apama.oms.NewOrder("BARX:28","GBP/USD",1.65763,"BUY","PREVIOUSLY QUOTED",1000000,
"FIX","","","BARX_TRADING","","",{"117":"FNLHTMMK15574031999845857",
"15":"USD","167":"FOR","21":"2","64":"SP"})