corrected costbasis is the latest minmax value
This commit is contained in:
@@ -775,17 +775,14 @@ int32_t prices_syntheticprofits(int64_t &costbasis, int32_t firstheight, int32_t
|
|||||||
//else { //-> use the previous value
|
//else { //-> use the previous value
|
||||||
// std::cerr << "prices_syntheticprofits() unchanged costbasis=" << costbasis << " price=" << price << " leverage=" << leverage << std::endl;
|
// std::cerr << "prices_syntheticprofits() unchanged costbasis=" << costbasis << " price=" << price << " leverage=" << leverage << std::endl;
|
||||||
//}
|
//}
|
||||||
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (height == firstheight + PRICES_DAYWINDOW) {
|
if (height == firstheight + PRICES_DAYWINDOW) {
|
||||||
// if costbasis not set, just set it
|
// if costbasis not set, just set it
|
||||||
costbasis = price;
|
//costbasis = price;
|
||||||
std::cerr << "prices_syntheticprofits() permanent costbasis=" << costbasis << " height=" << height << std::endl;
|
|
||||||
}
|
// use calculated minmax costbasis
|
||||||
else {
|
std::cerr << "prices_syntheticprofits() use permanent costbasis=" << costbasis << " height=" << height << std::endl;
|
||||||
// use provided costbasis
|
|
||||||
//std::cerr << "prices_syntheticprofits() provided costbasis=" << costbasis << " price=" << price << std::endl;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user