From 79397bbe88b05a23be828430250967ab9eba0d8a Mon Sep 17 00:00:00 2001 From: dimxy Date: Mon, 29 Apr 2019 16:58:05 +0500 Subject: [PATCH] corrected costbasis is the latest minmax value --- src/cc/prices.cpp | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/cc/prices.cpp b/src/cc/prices.cpp index 3584190f0..1b174a770 100644 --- a/src/cc/prices.cpp +++ b/src/cc/prices.cpp @@ -775,17 +775,14 @@ int32_t prices_syntheticprofits(int64_t &costbasis, int32_t firstheight, int32_t //else { //-> use the previous value // std::cerr << "prices_syntheticprofits() unchanged costbasis=" << costbasis << " price=" << price << " leverage=" << leverage << std::endl; //} - } else { if (height == firstheight + PRICES_DAYWINDOW) { // if costbasis not set, just set it - costbasis = price; - std::cerr << "prices_syntheticprofits() permanent costbasis=" << costbasis << " height=" << height << std::endl; - } - else { - // use provided costbasis - //std::cerr << "prices_syntheticprofits() provided costbasis=" << costbasis << " price=" << price << std::endl; + //costbasis = price; + + // use calculated minmax costbasis + std::cerr << "prices_syntheticprofits() use permanent costbasis=" << costbasis << " height=" << height << std::endl; } }