From b297400d6c700bb09d9bbce772458ad96455396f Mon Sep 17 00:00:00 2001 From: dimxy Date: Thu, 9 May 2019 20:23:51 +0500 Subject: [PATCH] corr isup calc --- src/cc/prices.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/cc/prices.cpp b/src/cc/prices.cpp index 8380a2010..18a496a54 100644 --- a/src/cc/prices.cpp +++ b/src/cc/prices.cpp @@ -2043,23 +2043,25 @@ static bool prices_ispositionup(BetInfo p) { int32_t value = (opcode & (KOMODO_MAXPRICES - 1)); // index or weight - if ((opcode & KOMODO_PRICEMASK)) { + if ((opcode & KOMODO_PRICEMASK) == 0) { char name[65]; if (komodo_pricename(name, value)) { std::string upperquote, bottomquote; prices_splitpair(std::string(name), upperquote, bottomquote); + + uint16_t opcode1 = p.vecparsed[1]; if (upperquote == "BTC" || bottomquote == "BTC") { // it is relatively btc - if (upperquote == "BTC" && (p.leverage > 0 || (opcode & KOMODO_PRICEMASK) != PRICES_INV) || - bottomquote == "BTC" && (p.leverage < 0 || (opcode & KOMODO_PRICEMASK) == PRICES_INV)) + if (upperquote == "BTC" && (p.leverage > 0 || (opcode1 & KOMODO_PRICEMASK) != PRICES_INV) || + bottomquote == "BTC" && (p.leverage < 0 || (opcode1 & KOMODO_PRICEMASK) == PRICES_INV)) return true; else return false; } if (upperquote == "USD" || bottomquote == "USD") { // it is relatively usd - if (upperquote == "USD" && (p.leverage > 0 || (opcode & KOMODO_PRICEMASK) != PRICES_INV) || - bottomquote == "USD" && (p.leverage < 0 || (opcode & KOMODO_PRICEMASK) == PRICES_INV)) + if (upperquote == "USD" && (p.leverage > 0 || (opcode1 & KOMODO_PRICEMASK) != PRICES_INV) || + bottomquote == "USD" && (p.leverage < 0 || (opcode1 & KOMODO_PRICEMASK) == PRICES_INV)) return true; else return false;