spark-577 get cash-per-point from market data feed.
This commit is contained in:
1 parent
206f2d3c3c
commit
8d62eaf15e
5 files changed
+14
-3
No files matched your search
@@ -133,11 +133,13 @@ void get_contract_spec(const FixedSecurity& source, api::ContractSpecification&
|
||||
spec.set_price_break(source.price_break);
|
||||
spec.set_low_tick(source.low_tick);
|
||||
spec.set_high_tick(source.high_tick);
|
||||
spec.set_cash_per_point(source.cash_per_point);
|
||||
// Account for price multiplier
|
||||
spec.set_price_multiplier(pow10(source.display_factor));
|
||||
spec.set_price_break(spec.price_break() * spec.price_multiplier());
|
||||
spec.set_low_tick(spec.low_tick() * spec.price_multiplier());
|
||||
spec.set_high_tick(spec.high_tick() * spec.price_multiplier());
|
||||
spec.set_cash_per_point(spec.cash_per_point() * spec.price_multiplier());
|
||||
}
|
||||
|
||||
Security convert_security(const FixedSecurity& security) {
|
||||
@@ -268,6 +270,7 @@ void convert_security(const Security& src, FixedSecurity& dest, bool set_securit
|
||||
dest.price_break = src.contract_spec().price_break() / src.contract_spec().price_multiplier();
|
||||
dest.low_tick = src.contract_spec().low_tick() / src.contract_spec().price_multiplier();
|
||||
dest.high_tick = src.contract_spec().high_tick() / src.contract_spec().price_multiplier();
|
||||
dest.cash_per_point = src.contract_spec().cash_per_point();
|
||||
|
||||
switch(securitytype_of(src)) {
|
||||
case SECURITYTYPE_FUTURE: {
|
||||
|
||||
Reference in new issue
Block a user