SPL File OpportunityRater.spl
SPL standard and specialized toolkits > com.ibm.streams.financial 2.1.0 > com.ibm.streams.financial.analytics.equity > OpportunityRater.spl
Content
- Operators
- OpportunityRater: The OpportunityRater operator uses use a fairly simple analytic for identifying opportunities.
- Types
Composites
composite OpportunityRater(output RatedQuotes; input Quotes, AugmentedTrades)
The OpportunityRater operator uses use a fairly simple analytic for identifying opportunities. Each time a quote for a specific equity comes in, it is paired with the volume-weighted average price, based on previous trades, for that equity. In typical usage, a stream of these volume-weighted average prices is generated by the TrailingPriceStatsCalculator operator.
If the "ask" price on an incoming quote is less than the current Weighted Average Trade Price, it represents an "opportunity" (possibly short-lived) for perhaps increasing holdings of the equity. To aid in determining whether to capitalize on that opportunity, an "opportunity level" is computed based on the ratio that the Weighted Average Price exceeds the asking price, and on the number of shares in the quote. If the WAP is not greater than the asking price, the opportunity level is zero.
opportunityLevelForIncrease=e1000(WeightedAvgPrice-askPrice)/askPrice * askSize
If the "bid" price on an incoming quote is greater than the current Weighted Average Trade Price, it represents an opportunity (possibly short-lived) for perhaps reducing holdings of the equity (or selling it short). To aid in determining whether to capitalize on that opportunity, an opportunity level is computed based on the ratio that the bid price exceeds the Weighted Average Price and on the number of shares in the quote. If the bid price is not greater than the WAP, the opportunity level is zero.
opportunityLevelForDecrease=e1000(bidPrice-WeightedAvgPrice)/WeightedAvgPrice * bidSize
The source code for the OpportunityRater operator can be found in the $STREAMS_INSTALL/toolkits/com.ibm.streams.financial/com.ibm.streams.financial/analytics/equity directory.
Input Ports
- Quotes: The TrailingPriceStatsCalculator operator has two input ports.
- AugmentedTrades: The TrailingPriceStatsCalculator operator has two input ports.
Output Ports
- RatedQuotes: The TrailingPriceStatsCalculator operator has one output port.
Types
RatedQuote
RatedQuote = Quote, tuple<float64 rating>;