From 1bdd83f1d1c690203ddfc0ea2a0a8f737fc4c23f Mon Sep 17 00:00:00 2001 From: dimxy Date: Mon, 22 Apr 2019 16:44:56 +0500 Subject: [PATCH] changed profits calc (prevent conversion to 0) --- src/cc/prices.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/cc/prices.cpp b/src/cc/prices.cpp index 188b773ef..a22c312b0 100644 --- a/src/cc/prices.cpp +++ b/src/cc/prices.cpp @@ -665,9 +665,10 @@ int64_t prices_syntheticprofits(int64_t &costbasis, int32_t firstheight, int32_t //std::cerr << "prices_syntheticprofits() profits double=" << (double)price / (double)costbasis -1.0 << std::endl; //double dprofits = (double)price / (double)costbasis - 1.0; - profits *= ((int64_t)leverage * (int64_t)positionsize) / (int64_t)SATOSHIDEN; + profits *= ((int64_t)leverage * (int64_t)positionsize); + profits /= (int64_t)SATOSHIDEN; //dprofits *= leverage * positionsize; - std::cerr << "prices_syntheticprofits() value of profits=" << profits << " leverage=" << leverage << " positionsize=" << positionsize << std::endl; + std::cerr << "prices_syntheticprofits() value of profits=" << profits << std::endl; //std::cerr << "prices_syntheticprofits() dprofits=" << dprofits << std::endl;