spark-577 get cash-per-point from market data feed.

This commit is contained in:
Eric Harding committed 2018-03-05 11:23:11 -05:00
1 parent 206f2d3c3c
commit 8d62eaf15e
5 files changed
+14 -3

No files matched your search

@@ -214,7 +214,11 @@ void MDP3Listener::onDefinition(onixs::Handler&, const onixs::Security& osec, co
set_security_common(sec, fsec);
fsec.price_break = 0;
// low/high tick are stored non-premultiplied and multiplied in conversion to api::Secutity
fsec.low_tick = fsec.high_tick = double_of_price(sec.minPriceIncrement(), 0);
double min_tick = double_of_price(sec.minPriceIncrement(), 0);
fsec.low_tick = fsec.high_tick = min_tick;
onixs::PRICE min_tick_amount;
sec.minPriceIncrementAmount(min_tick_amount);
fsec.cash_per_point = double_of_price(min_tick_amount, 0) / min_tick;
auto expiration = date_of_maturity(sec);
fsec.expiration_year = expiration.year;
fsec.expiration_month = expiration.month;
@@ -247,13 +251,15 @@ void MDP3Listener::onDefinition(onixs::Handler&, const onixs::Security&, const o
bts_assert(sec.strikePrice(strike_price));
fsec.strike = double_of_price(strike_price, fsec.display_factor);
onixs::PRICE min_tick;
onixs::PRICE min_tick, min_tick_amount;
sec.minPriceIncrement(min_tick);
sec.minPriceIncrementAmount(min_tick_amount);
int8_t tick_rule;
if (sec.tickRule(tick_rule)) {
decode_ticks(tick_rule, double_of_price(min_tick, 0), fsec);
}
fsec.cash_per_point = double_of_price(min_tick_amount, 0) / fsec.low_tick;
fsec.call_put = sec.putOrCall() == onixs::PutOrCall::Call ? api::PUTORCALL_CALL : api::PUTORCALL_PUT;