0% found this document useful (0 votes)
81 views10 pages

AlgoTrader UML Model

The document describes the entities and relationships in an algorithmic trading system. It includes entities for securities, positions, orders, strategies, market data events, bars, ticks, trades, and quotes. Securities have attributes like name, market, and currency. Positions track quantity and market value. Strategies have a name, activation status, and allocation. Market data events contain date time stamps. Bars represent open, high, low, close prices over a time period. Ticks contain last trade details.

Uploaded by

XiuLi Wang
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
81 views10 pages

AlgoTrader UML Model

The document describes the entities and relationships in an algorithmic trading system. It includes entities for securities, positions, orders, strategies, market data events, bars, ticks, trades, and quotes. Securities have attributes like name, market, and currency. Positions track quantity and market value. Strategies have a name, activation status, and allocation. Market data events contain date time stamps. Bars represent open, high, low, close prices over a time period. Ticks contain last trade details.

Uploaded by

XiuLi Wang
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

*

<<Entity>> <<Entity>>
WatchListItem <<AlgoTraderEntity>>
Order
+persistent : boolean
+number : int
+@findByStrategyAndSecurity()
* +side : Side
* +quantity : long
1 +tif : TIF 1 <<Entity>>
+tifDate : Date [0..1] Strategy
<<Entity>> +ocoType : OCOType
Security +name : String
+underlaying *
1 +autoActivate : boolean
0..1 +isin : String +parentOrder +allocation : double
+symbol : String [0..1] +modules : String
<<Entity>>
+getCurrentValue() <<AlgoTraderEntity>> +isBase()
+getLastTrade() +getCashBalanceDouble()
Fill
+getLastBid() +getSecuritiesCurrentValueDouble()
+getLastAsk() +dateTime : Date +getMaintenanceMarginDouble()
+getLastTick() +side : Side +getInitialMarginDouble()
<<Entity>> * +underlaying +getLastBar() +quantity : long +getNetLiqValueDouble()
+getMargin() +price : Money +getAvailableFundsDouble()
SecurityFamily 0..1
+isOnWatchlist() +commission : Money +getPortfolioCashBalanceDouble()
+name : String * +@findByIdFetched() +getPortfolioSecuritiesCurrentValueDouble()
*
+market : Market +@findByIsin() +getPortfolioMaintenanceMarginDouble()
1
+currency : Currency +@findByIsinFetched() 0..1 * +getPortfolioInitialMarginDouble()
+contractSize : int +@findBySymbol() <<Entity>> +getPortfolioNetLiqValueDouble()
+tickSize : double +@findSecuritiesInPortfolio() +getPortfolioAvailableFundsDouble()
Transaction
+commission : Money [0..1] +@findSecuritiesOnWatchlist() +@findByName()
+marketOpen : Time +@findSecuritiesOnActiveWatchlist() +dateTime : Date +@findByNameFetched()
+marketClose : Time * +quantity : long +@findAutoActivateStrategies()
1
+tradeable : boolean +price : Money 0..1 1
+expirable : boolean <<Entity>> 0..1 * +commission : Money [0..1]
+currency : Currency *
+@findByIsin() Position
+type : TransactionType
+quantity : long
+getValue()
+exitValue : Double [0..1]
+getValueDouble()
+maintenanceMargin : Money [0..1]
+@findAllTrades()
+isOpen() +@findAllCashflows()
+isLong()
+isShort()
+isFlat()
+getMarketPriceDouble() *
+getMarketValueDouble()
+getMaintenanceMarginDouble()
+getExitValueDouble()
+@findOpenPositions()
+@findOpenPositionsByStrategy()
+@findByIdFetched()
+@findBySecurityAndStrategy()
<<Entity>> * 1
MarketDataEvent
<<Entity>>
+dateTime : Date
Security

<<Entity>> <<Entity>> <<Entity>>


<<AlgoTraderEntity>> Bar Tick
PriceEvent
+open : Money +last : Money [0..1]
+price : Money +high : Money +lastDateTime : Date [0..1]
+size : long +low : Money +vol : int
+close : Money +volBid : int
+adjClose : Money [0..1] +volAsk : int
+vol : int +bid : Money
+openInterest : int +ask : Money
<<Entity>> <<Entity>> +openIntrest : int
+getCurrentValueDouble() +settlement : Money [0..1]
<<AlgoTraderEntity>> <<AlgoTraderEntity>> +getCurrentValue()
Trade Quote +getCurrentValue()
+extId : String +getCurrentValueDouble()
+getBidAskSpread()
+valid : Date
+getBidAskSpreadDouble()
+@findLastTickForSecurityAndMaxDate()

<<Entity>> <<Entity>>
<<AlgoTraderEntity>> <<AlgoTraderEntity>>
Bid Ask
<<Entity>>
Strategy
1
0..1
+parentOrder *
<<Entity>>
<<AlgoTraderEntity>> <<Entity>>
+childOrders * 1
<<Entity>> <<AlgoTraderEntity>>
Order
<<AlgoTraderEntity>> 0..* <<Entity>> Fill
OrderStatus +number : int Security
+side : Side +dateTime : Date * 1
+status : Status 1 +quantity : long 1 +side : Side
+quantity : long <<Entity>>
+filledQuantity : long +parentOrder +tif : TIF +parentOrder +price : Money Transaction
+remainingQuantity : long +tifDate : Date [0..1]
+ocoType : OCOType +commission : Money

<<Entity>> <<Entity>> <<Entity>> <<Entity>> <<Entity>>


<<AlgoTraderEntity>> <<AlgoTraderEntity>> <<AlgoTraderEntity>> <<AlgoTraderEntity>> <<AlgoTraderEntity>>
MarketOrder LimitOrder StopOrder StopLimitOrder TrailingStopOrder

+limit : Money +stop : Money +limit : Money +trailingAmount : Money


+stop : Money

StopOrderInterface

+stop : Money

LimitOrderInterface

+limit : Money
<<Service>> <<Service>>
MarketDataService RuleService

+completeRawTick( tick : RawTickVO ) : Tick {@algoTrader.service.client,


+completeBar( bar : BarVO ) : Bar andromda_spring_service_remoting_type=none}
+propagateMarketDataEvent( marketDataEvent : MarketDataEvent ) : void +initServiceProvider( strategyName : String ) : void
+initWatchlist() : void +isInitialized( strategyName : String ) : boolean
+reinitWatchlist() : void +destroyServiceProvider( strategyName : String ) : void
+putOnWatchlist( strategy : Strategy, security : Security ) : void{andromda_spring_transaction_type=PROPAGATION_REQUIRED} +deployRule( strategyName : String, moduleName : String, ruleName : String ) : void
+putOnWatchlist( strategyName : String, securityId : int ) : void +deployRule( strategyName : String, moduleName : String, ruleName : String, targetId : Integer ) : void
+removeFromWatchlist( strategy : Strategy, security : Security ) : void{andromda_spring_transaction_type=PROPAGATION_REQUIRED} +deployModule( strategyName : String, moduleName : String ) : void
+removeFromWatchlist( strategyName : String, securityId : int ) : void +deployAllModules( strategyName : String ) : void
+putOnExternalWatchlist( security : Security ) : int +isDeployed( strategyName : String, ruleName : String ) : boolean
+removeFromExternalWatchlist( security : Security ) : void +undeployRule( strategyName : String, ruleName : String ) : void
<<Service>> +undeployRuleByTarget( strategyName : String, ruleName : String, targetId : int ) : void
OrderService +undeployModule( strategyName : String, moduleName : String ) : void
+sendEvent( strategyName : String, object : Object ) : void
+sendOrder( order : Order ) : void{andromda_spring_transaction_type=PROPAGATION_REQUIRED} +routeEvent( strategyName : String, object : Object ) : void
+sendExternalOrder( order : Order ) : void +getLastEvent( strategyName : String, ruleName : String ) : Object
+cancelOrder( orderId : int ) : void +getLastEventProperty( strategyName : String, ruleName : String, property : String ) : Object
+cancelExternalOrder( orderId : int ) : void +getAllEvents( strategyName : String, ruleName : String ) : List
+modifyOrder( orderId : int, order : Order ) : void +getAllEventsProperty( strategyName : String, ruleName : String, property : String ) : List
+modifyExternalOrder( orderId : int, order : Order ) : void +executeQuery( strategyName : String, query : String ) : List
+propagateOrder( order : Order ) : void +setInternalClock( strategyName : String, internal : boolean ) : void
<<Service>>
+propagateOrderStatus( orderStatus : OrderStatus ) : void +isInternalClock( strategyName : String ) : boolean
PositionService
+setCurrentTime( currentTime : CurrentTimeEvent ) : void
+closePosition( positionId : int ) : void +getCurrentTime( strategyName : String ) : long
+reducePosition( positionId : int, quantity : long ) : void +initCoordination( strategyName : String ) : void
+setExitValue( positionId : int, exitValue : double, force : boolean ) : void{andromda_spring_transaction_type=PROPAGATION_REQUIRED} +coordinate( strategyName : String, csvInputAdapterSpec : CSVInputAdapterSpec ) : void
+setMargins() : void +startCoordination( strategyName : String ) : void
+setMargin( positionId : int ) : void +setProperty( strategyName : String, key : String, value : String ) : void
+setMargin( position : Position ) : void{andromda_spring_transaction_type=PROPAGATION_REQUIRED}
<<Service>>
<<Service>> LookupService
TransactionService +getSecurity( id : int ) : Security
+createTransaction( fill : Fill ) : void{andromda_spring_transaction_type=PROPAGATION_REQUIRED} +getSecurityByIsin( isin : String ) : Security
+propagateTransaction( transaction : Transaction ) : void +getSecurityBySymbol( symbol : String ) : Security
+propagateFill( fill : Fill ) : void +getSecurityFetched( id : int ) : Security
+getAllSecurities() : Security[]
<<Service>> +getAllSecuritiesInPortfolio() : Security[]
SimulationService +getSecuritiesOnWatchlist() : Security[]
+getStrategy( id : int ) : Strategy
{andromda_spring_service_remoting_type=none} +getStrategyByName( name : String ) : Strategy
+resetDB() : void{andromda_spring_transaction_type=PROPAGATION_REQUIRED} +getStrategyByNameFetched( name : String ) : Strategy
+inputCSV() : void +getAutoActivateStrategies() : List
+runByUnderlayings() : SimulationResultVO +getAllStrategies() : Strategy[]
+simulateWithCurrentParams() : void +getSecurityFamily( id : int ) : SecurityFamily
+optimizeSingleParamLinear( strategyName : String, parameter : String, min : double, max : double, increment : double ) : void +getPosition( id : int ) : Position
+getSimulationResultVO( startTime : long ) : SimulationResultVO +getPositionFetched( id : int ) : Position
+getAllPositions() : Position[]
+getOpenPositions() : Position[]
<<Service>> +getOpenPositionsByStrategy( strategyName : String ) : Position[]
StrategyService +getTransaction( id : int ) : Transaction
+getAllTransactions() : Transaction[]
+registerStrategy() +getAllTrades() : Transaction[]
+unregisterStrategy() +getAllCashFlows() : Transaction[]
+isStrategyRegistered() +getLastTick( securityId : int ) : Tick
+sendEvent() +getPortfolioValue() : PortfolioValueVO
+getPositionBySecurityAndStrategy( securityId : int, strategyName : String ) : Position
<<Service>> <<Service>>
<<Service>> <<Service>> <<Service>> <<Service>>
TransactionService SessionFactory
SessionFactory MarketDataService RuleService RuleService
<<Entity>> <<Entity>> <<Entity>> <<Entity>>
Tick Strategy <<AlgoTraderEntity>> Bar
Order

<<Entity>> <<Entity>> <<Entity>> <<Entity>>


<<Entity>> Security Strategy Position Transaction
<<Entity>> <<Entity>> <<Entity>> <<Entity>> <<Entity>> <<Entity>> <<Entity>>
Bar <<Entity>> <<Entity>>
Security Tick Strategy WatchListItem Security Transaction Position
Security Security

<<Service>>
LookupService
<<Service>>
<<Service>> <<Service>>
StrategyService
RuleService SimulationService

<<Entity>>
<<Entity>> <<Entity>> <<Entity>> <<Entity>> <<Entity>> <<Entity>> <<Entity>> <<Entity>> <<Entity>> <<Entity>> <<Entity>>
Strategy
Position Strategy Tick Security Transaction SecurityFamily Security Transaction Position WatchListItem Strategy

<<Service>>
<<Service>> <<Service>> <<Service>> <<Service>> <<Service>>
<<Service>> RuleService
OrderService PositionService RuleService RuleService TransactionService
OrderService

<<Service>> <<Service>> <<Service>>


<<Service>>
SessionFactory LookupService StrategyService
MarketDataService
<<Entity>>
Position <<Entity>> <<Entity>>
Strategy Security

BaseEntity
+toString() : String

<<Entity>> <<Entity>> <<Entity>> <<Entity>> <<Entity>> <<Entity>> <<Entity>> <<Entity>>


<<AlgoTraderEntity>> Position Strategy Transaction WatchListItem MarketDataEvent Security SecurityFamily
Order
<<Enumeration>> <<Enumeration>> <<Enumeration>> <<Enumeration>> <<Enumeration>>
Market Currency Side OptionType ConnectionState

+AMEX : String +CHF : String +BUY : String +CALL : String +DISCONNECTED : String
+AUTO : String +EUR : String +SELL : String +PUT : String +CONNECTED : String
+CBOE : String +USD : String +READY : String
+CBOT : String +GBP : String +SUBSCRIBED : String
+CFE : String
<<Enumeration>> <<Enumeration>>
+CME : String <<Enumeration>>
+DTB : String TIF MarketDataType
Status
+GLOBEX : String +DAY : String +TICK : String
+ECBOT : String +OPEN : String +GTC : String +BAR : String
+IDEALPRO : String +SUBMITTED : String +GTD : String
+NYBOT : String +PARTIALLY_EXECUTED : String
+NYMEX : String +EXECUTED : String
+NASDAQ : String +CANCELED : String
+NYSE : String +AUTOMATIC : String
+OTCBB : String +PREARRANGED : String
+PINK : String
+SMART : String <<Enumeration>>
+SOFFEX : String TransactionType <<Enumeration>>
+LMAX : String OCOType
+BUY : String
+SELL : String +NONE : String
+EXPIRATION : String +CANCEL_OTHERS : String
+CREDIT : String +REDUCE_OTHERS : String
+DEBIT : String
+INTREST : String
+FEES : String
+REBALANCE : String
<<Entity>> <<Entity>>
Tick Bar

<<ValueObject>> <<ValueObject>> <<ValueObject>> <<ValueObject>> <<ValueObject>> <<ValueObject>>


RawTickVO BarVO SimulationResultVO PerformanceKeysVO PortfolioValueVO SubscribeTickEvent
+isin : String +isin : String +mins : double +n : long +securitiesCurrentValue : double +tick : Tick
+dateTime : Date +dateTime : Date +dataSet : String +avgM : double +cashBalance : double +tickerId : int
+last : Money [0..1] +open : Money +netLiqValue : double +stdM : double +maintenanceMargin : double
+lastDateTime : Date [0..1] +high : Money +monthlyPerformanceVOs : List +avgY : double +netLiqValue : double
+vol : int +low : Money +performanceKeysVO : PerformanceKeysVO +stdY : double <<ValueObject>>
+volBid : int +close : Money +maxDrawDownVO : MaxDrawDownVO +sharpRatio : double UnsubscribeTickEvent
+volAsk : int +adjClose : Money [0..1]
+bid : Money [0..1] +vol : int +securityId : int
+midpoint : Money [0..1] +openInterest : int <<ValueObject>> <<ValueObject>> <<ValueObject>>
+ask : Money [0..1] MonthlyPerformanceVO ExitValueVO MaxDrawDownVO
+openIntrest : int
+settlement : Money [0..1] +date : Date +value : double +amount : double
+value : double +period : long
<<Service>> <<Service>>
OrderService MarketDataService

+sendOrder() +completeRawTick()
+sendExternalOrder() +completeBar()
+cancelOrder() +propagateMarketDataEvent()
+cancelExternalOrder() +initWatchlist()
+modifyOrder() +reinitWatchlist()
+modifyExternalOrder() +putOnWatchlist()
+propagateOrder() +putOnWatchlist()
+propagateOrderStatus() +removeFromWatchlist()
+removeFromWatchlist()
+putOnExternalWatchlist()
+removeFromExternalWatchlist()

<<Service>> <<Service>>
IBOrderService IBMarketDataService
0..1
+underlaying
<<Entity>>
*
Security
<<Entity>>
+isin : String
SecurityFamily
+symbol : String [0..1] +underlaying *
0..1 +name : String
+getCurrentValue()
+market : Market
+getLastTrade()
+currency : Currency
+getLastBid()
+contractSize : int
+getLastAsk() *
+tickSize : double
+getLastTick()
+commission : Money [0..1]
+getLastBar()
+marketOpen : Time
+getMargin()
+marketClose : Time
+isOnWatchlist()
+tradeable : boolean
+@findByIdFetched()
+expirable : boolean
+@findByIsin()
+@findByIsinFetched() +@findByIsin()
+@findBySymbol()
+@findSecuritiesInPortfolio()
+@findSecuritiesOnWatchlist()
+@findSecuritiesOnActiveWatchlist()

<<Entity>> <<Entity>> <<Entity>> <<Entity>> <<Entity>> <<Entity>>


Stock Forex IntrestRate Future StockOption EquityIndex

+baseCurrency : Currency +duration : long +expiration : Date +expiration : Date


+strike : Money
+type : OptionType
<<ValueObject>> <<ValueObject>> <<ValueObject>>
Connection
and Server CurrentTime ConnectionClosed Error
+time : long +id : int
+errorCode : int
+errorString : String

<<ValueObject>> <<ValueObject>> <<ValueObject>> <<ValueObject>> <<ValueObject>> <<ValueObject>> <<ValueObject>>


Market Data
TickPrice TickSize TickOptionComputation TickGeneric TickString TickEFP TickSnapshotEnd
+tickerId : int +tickerId : int +tickerId : int +tickerId : int +tickerId : int +tickerId : int +reqId : int
+field : int +field : int +field : int +tickType : int +field : int +field : int
+price : double +size : int +impliedVol : double +value : double +value : String +basisPoints : double
+canAutoExecute : int +delta : double +formattedBasisPoints : String
+optPrice : double +impliedFuture : double
+pvDividend : double +holdDays : int
+gamma : double +futureExpiry : String
+vega : double +dividendImpact : double
+theta : double +dividendsToExpiry : double
+undPrice : double

<<ValueObject>> <<ValueObject>> <<ValueObject>> <<ValueObject>>


Orders OrderStatus OpenOrder NextValidId OpenOrderEnd
+orderId : int +orderId : int +orderId : int
+status : String +contract : Contract
+filled : int +order : Order
+remaining : int +orderState : OrderState
+avgFillPrice : double
+permId : int
+parentId : int
+lastFillPrice : double
+clientId : int
+whyHeld : String

<<ValueObject>> <<ValueObject>> <<ValueObject>> <<ValueObject>>


Account and
Portfolio UpdateAccountValue UpdatePortfolio UpdateAccountTime AccountDownloadEnd
+key : String +contract : Contract +timeStamp : String +s : String
+value : String +position : int
+currency : String +marketPrice : double
+accountName : String +marketValue : double
+averageCost : double
+unrealizedPNL : double
+realizedPNL : double
+accountName : String

<<ValueObject>> <<ValueObject>>
Contract ContractDetailsCommon ContractDetailsEnd
Details
+reqId : int +reqId : int
+contractDetails : ContractDetails

<<ValueObject>> <<ValueObject>>
Executions ExecDetails ExecDetailsEnd
+reqId : int +reqId : int
+contract : Contract
+execution : Execution

<<ValueObject>> <<ValueObject>>
Market Depth UpdateMktDepth UpdateMktDepthL2
+tickerId : int +tickerId : int
+position : int +position : int
+operation : int +marketMaker : String
+side : int +operation : int
+price : double +side : int
+size : int +price : double
+size : int

<<ValueObject>>
News UpdateNewsBulletin
Bulletins
+msgId : int
+msgType : int
+message : String
+origExchange : String

<<ValueObject>> <<ValueObject>>
Financial
Advisors ManagedAccounts ReceiveFA
+accountsList : String +faDataType : long
+xml : String

<<ValueObject>>
HistoricalData
+reqId : int
Historical +date : String
Data +open : double
+high : double
+low : double
+close : double
+volume : int
+count : int
+WAP : double
+hasGaps : boolean

<<ValueObject>> <<ValueObject>> <<ValueObject>>


Market
Scanners ScannerParameters ScannerData ScannerDataEnd
+xml : String +reqId : int +reqId : int
+rank : int
+contractDetails : ContractDetails
+distance : String
+benchmark : String
+projection : String
+legsStr : String

<<ValueObject>>
Real Time RealtimeBar
Bars
+reqId : int
+time : long
+open : double
+high : double
+low : double
+close : double
+volume : long
+WAP : double
+count : int

<<ValueObject>>
Fundamental
Bars FundamentalData

+reqId : int
+data : String

<<ValueObject>>
DeltaNeutralValidation
+i : int
+underComp : UnderComp

You might also like