Package org.marketcetera.trade.client
Interface TradeClient
-
- All Superinterfaces:
AutoCloseable,BaseClient,Closeable,TradeMessagePublisher
public interface TradeClient extends BaseClient, TradeMessagePublisher
Provides trading-related services.- Since:
- $Release$
- Version:
- $Id$
- Author:
- Colin DuPlantis
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddReport(HasFIXMessage inReport, BrokerID inBrokerID)Add the given report to the system data flow.voidaddSuggestionListener(SuggestionListener inSuggestionListener)Add the given suggestion listener.voiddeleteReport(ReportID inReportId)Removes the given report from the persistent report store.OrderIDfindRootOrderIdFor(OrderID inOrderID)Find the root order ID for the order chain of the given order ID.Map<PositionKey<? extends Instrument>,BigDecimal>getAllPositionsAsOf(Date inDate)Returns all positions based on reports generated and received on or before the supplied date in UTC.CollectionPageResponse<AverageFillPrice>getAveragePriceFills(PageRequest inPageRequest)Get average price fills values.CollectionPageResponse<ExecutionReportSummary>getFills(PageRequest inPageRequest)Get fills with the given page request.ExecutionReportgetLatestExecutionReportForOrderChain(OrderID inOrderId)Get the most recent execution report for the order chain represented by the given order id.Collection<OrderSummary>getOpenOrders()Get open orders.CollectionPageResponse<OrderSummary>getOpenOrders(PageRequest inPageRequest)Get open orders.Map<PositionKey<Option>,BigDecimal>getOptionPositionsAsOf(Date inDate, String... inRootSymbols)Returns all positions of options with the given root symbols based on reports generated and received on or before the supplied date in UTC.Collection<String>getOptionRoots(String inUnderlying)Get the option roots for the given underlying.BigDecimalgetPositionAsOf(Date inDate, Instrument inInstrument)Returns the position of the supplied instrument based on reports generated and received on or before the supplied date in UTC.CollectionPageResponse<Report>getReports(PageRequest inPageRequest)Get reports with the given page request.StringgetUnderlying(String inOptionRoot)Get the underlying for the given root.List<ActiveFixSession>readAvailableFixInitiatorSessions()Get the currently available FIX initiator sessions.voidremoveSuggestionListener(SuggestionListener inSuggestionListener)Remove the given suggestion listener.InstrumentresolveSymbol(String inSymbol)Resolves the given symbol to anInstrument.SendOrderResponsesendOrder(Order inOrder)Submit the given order.List<SendOrderResponse>sendOrders(List<Order> inOrders)Submit the given orders.voidsendOrderSuggestion(Suggestion inSuggestion)Submit a trade suggestion.-
Methods inherited from interface org.marketcetera.core.BaseClient
addClientStatusListener, close, isRunning, removeClientStatusListener, start, stop
-
Methods inherited from interface org.marketcetera.trade.TradeMessagePublisher
addTradeMessageListener, removeTradeMessageListener
-
-
-
-
Method Detail
-
readAvailableFixInitiatorSessions
List<ActiveFixSession> readAvailableFixInitiatorSessions()
Get the currently available FIX initiator sessions.- Returns:
- a
List<ActiveFixSession>value
-
getOpenOrders
Collection<OrderSummary> getOpenOrders()
Get open orders.- Returns:
- a
Collection<OrderSummary>value
-
getOpenOrders
CollectionPageResponse<OrderSummary> getOpenOrders(PageRequest inPageRequest)
Get open orders.- Parameters:
inPageRequest- aPageRequestvalue- Returns:
- a
CollectionPageResponset<OrderSummary>value
-
sendOrders
List<SendOrderResponse> sendOrders(List<Order> inOrders)
Submit the given orders.- Parameters:
inOrders- aList<Order>value- Returns:
- a
List<SendOrderResponse>value
-
sendOrderSuggestion
void sendOrderSuggestion(Suggestion inSuggestion)
Submit a trade suggestion.- Parameters:
inSuggestion- aSuggestionvalue
-
sendOrder
SendOrderResponse sendOrder(Order inOrder)
Submit the given order.- Parameters:
inOrder- anOrdervalue- Returns:
- a
SendOrderResponsevalue
-
getPositionAsOf
BigDecimal getPositionAsOf(Date inDate, Instrument inInstrument)
Returns the position of the supplied instrument based on reports generated and received on or before the supplied date in UTC.- Parameters:
inDate- aDatevalueinInstrument- anInstrumentvalue- Returns:
- a
BigDecimalvalue
-
getAllPositionsAsOf
Map<PositionKey<? extends Instrument>,BigDecimal> getAllPositionsAsOf(Date inDate)
Returns all positions based on reports generated and received on or before the supplied date in UTC.- Parameters:
inDate- aDatevalue- Returns:
- a
Map<PositionKey<? extends Instrument>,BigDecimal>value
-
getOptionPositionsAsOf
Map<PositionKey<Option>,BigDecimal> getOptionPositionsAsOf(Date inDate, String... inRootSymbols)
Returns all positions of options with the given root symbols based on reports generated and received on or before the supplied date in UTC.- Parameters:
inDate- aDatevalueinRootSymbols- aString[]value- Returns:
- a
Map<PositionKey<Optiont>,BigDecimal>value
-
addReport
void addReport(HasFIXMessage inReport, BrokerID inBrokerID)
Add the given report to the system data flow.Reports added this way will be added to the system data bus. Reports will be persisted and become part of the system record. The report will be owned by the user logged in to the client.
This will affect reported positions
.- Parameters:
inReport- aHasFIXMessagevalueinBrokerID- aBrokerIDvalue
-
deleteReport
void deleteReport(ReportID inReportId)
Removes the given report from the persistent report store.Reports removed this way will not be added to the system data bus and no clients will receive this report.
This will affect reported positions
.- Parameters:
inReportId- aReportIDvalue
-
resolveSymbol
Instrument resolveSymbol(String inSymbol)
Resolves the given symbol to anInstrument.- Parameters:
inSymbol- aStringvalue- Returns:
- an
Instrumentvalue
-
findRootOrderIdFor
OrderID findRootOrderIdFor(OrderID inOrderID)
Find the root order ID for the order chain of the given order ID.- Parameters:
inOrderID- anOrderIDvalue- Returns:
- an
OrderIDvalue
-
getOptionRoots
Collection<String> getOptionRoots(String inUnderlying)
Get the option roots for the given underlying.- Parameters:
inUnderlying- aStringvalue- Returns:
- a
Collection<String>value
-
getUnderlying
String getUnderlying(String inOptionRoot)
Get the underlying for the given root.- Parameters:
inOptionRoot- aStringvalue- Returns:
- a
Stringvalue
-
getLatestExecutionReportForOrderChain
ExecutionReport getLatestExecutionReportForOrderChain(OrderID inOrderId)
Get the most recent execution report for the order chain represented by the given order id.The given
OrderIDcan be either from any order in the chain or the root order id for the chain. In either case, the most recent execution report for the entire chain will be returned, not the given order necessarily.If no execution report exists for any order in the given chain, the call will return null.
- Parameters:
inOrderId- anOrderIDvalue- Returns:
- an
ExecutionReportvalue ornull
-
getReports
CollectionPageResponse<Report> getReports(PageRequest inPageRequest)
Get reports with the given page request.- Parameters:
inPageRequest- aPageRequestvalue- Returns:
- a
CollectionPageResponse<Report>value
-
getFills
CollectionPageResponse<ExecutionReportSummary> getFills(PageRequest inPageRequest)
Get fills with the given page request.- Parameters:
inPageRequest- aPageRequestvalue- Returns:
- a
CollectionPageResponse<ExecutionReportSummary>value
-
getAveragePriceFills
CollectionPageResponse<AverageFillPrice> getAveragePriceFills(PageRequest inPageRequest)
Get average price fills values.- Parameters:
inPageRequest- aPageRequestvalue- Returns:
- a
CollectionPageResponse<AveragePriceFill>value
-
addSuggestionListener
void addSuggestionListener(SuggestionListener inSuggestionListener)
Add the given suggestion listener.- Parameters:
inSuggestionListener- aSuggestionListenervalue
-
removeSuggestionListener
void removeSuggestionListener(SuggestionListener inSuggestionListener)
Remove the given suggestion listener.- Parameters:
inSuggestionListener- aSuggestionListenervalue
-
-