Merge branch 'master' of bitbucket.org:bluetradesys/spark into prod

This commit is contained in:
Eric Harding committed 2019-12-17 15:36:40 -05:00
commit 8a210f39b6
2 files changed
+33 -28

No files matched your search

+10 -7
View File
@@ -12,19 +12,22 @@ env SDK_ROOT=/sdk \
SDK_VERSION=$SDK_VERSION \
SDK_BUILD_DATE=$SDK_BUILD_DATE
# copy sdk
COPY include/ /sdk/include/
COPY lib/ /sparkbin/
COPY externals /sdk/externals/
COPY spark.conf /sparkdata/conf/
COPY futures.coconut /sparkdata/data/replay/futures.coconut
# add user bts
RUN groupadd --gid 1000 $USERNAME && \
useradd -s /bin/bash --uid 1000 --gid 1000 -m $USERNAME && \
mkdir -p /sparkbin/plugins && \
mkdir /sparkdata && \
ln -s /sparkbin/ sdk/lib && \
echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME && \
chmod 0440 /etc/sudoers.d/$USERNAME && \
chown -R bts.bts /sparkbin/plugins && \
chown -R bts.bts /sparkdata
# copy sdk
COPY include/ /sdk/include/
COPY lib/ /sparkbin/
COPY externals /sdk/externals/
COPY spark.conf /sparkdata/conf/
COPY --chown=$USERNAME futures.coconut /sparkdata/data/replay/futures.coconut
@@ -212,30 +212,32 @@ void ICEListener::on_uds_future_spread(const Definition& def, bool& is_intereste
fsec.alt_symbol(def.strategySymbol);
const auto& legs = def.legs;
fsec.set_leg_count(legs.size());
for(size_t x = 0; x < fsec.leg_count(); ++x)
{
const auto& leg = legs[x];
if(leg.ratioPriceNumerator && leg.ratioPriceDenominator)
if (legs.size() > 0) {
fsec.set_leg_count(legs.size());
for(size_t x = 0; x < fsec.leg_count(); ++x)
{
auto num = *leg.ratioPriceNumerator;
auto denom = *leg.ratioPriceDenominator;
fsec.legs[x].leg_price = num / (double) denom;
const auto& leg = legs[x];
if(leg.ratioPriceNumerator && leg.ratioPriceDenominator)
{
auto num = *leg.ratioPriceNumerator;
auto denom = *leg.ratioPriceDenominator;
fsec.legs[x].leg_price = num / (double) denom;
}
if(leg.ratioQtyNumerator && leg.ratioQtyDenominator)
{
auto num = *leg.ratioQtyNumerator;
auto denom = *leg.ratioQtyDenominator;
fsec.legs[x].leg_delta = num / (double) denom;
}
fsec.legs[x].leg_quantity = leg.ratio;
fsec.legs[x].leg_side = leg.side == onixs_ice::Side::Bid ? api::SIDE_BUY : api::SIDE_SELL;
fsec.legs[x].exchange_key = ExchangeKey(leg.marketId);
fsec.legs[x].key = invalid_security_key;
}
if(leg.ratioQtyNumerator && leg.ratioQtyDenominator)
{
auto num = *leg.ratioQtyNumerator;
auto denom = *leg.ratioQtyDenominator;
fsec.legs[x].leg_delta = num / (double) denom;
}
fsec.legs[x].leg_quantity = leg.ratio;
fsec.legs[x].leg_side = leg.side == onixs_ice::Side::Bid ? api::SIDE_BUY : api::SIDE_SELL;
fsec.legs[x].exchange_key = ExchangeKey(leg.marketId);
fsec.legs[x].key = invalid_security_key;
add_security(fsec);
is_interested = true;
}
add_security(fsec);
is_interested = true;
}