This commit is contained in:
jl777
2019-04-02 01:45:33 -11:00
parent 7b0d2efa74
commit a18d49991b
2 changed files with 4 additions and 4 deletions

View File

@@ -2235,9 +2235,9 @@ int64_t komodo_pricecorrelated(uint32_t *rawprices,int32_t numprices)
{ {
if ( (price= rawprices[i]) == 0 ) if ( (price= rawprices[i]) == 0 )
return(0); return(0);
fprintf(stderr,"%.0f ",(double)price/10000); //fprintf(stderr,"%.0f ",(double)price/10000);
sum += (int64_t)price * 10000; sum += (int64_t)price * 10000;
} }
fprintf(stderr," ave %.8f [%d]\n",((double)sum/numprices)/COIN,numprices); //fprintf(stderr," ave %.8f [%d]\n",((double)sum/numprices)/COIN,numprices);
return(sum / numprices); return(sum / numprices);
} }

View File

@@ -1229,7 +1229,7 @@ UniValue prices(const UniValue& params, bool fHelp)
ret.push_back(Pair("timestamps",timestamps)); ret.push_back(Pair("timestamps",timestamps));
ret.push_back(Pair("firstheight", (int64_t)nextheight-1-i)); ret.push_back(Pair("firstheight", (int64_t)nextheight-1-i));
} }
for (j=1; j<2; j++) for (j=1; j<numpricefeeds; j++)
{ {
UniValue item(UniValue::VOBJ),p(UniValue::VARR); UniValue item(UniValue::VOBJ),p(UniValue::VARR);
if ( (str= komodo_pricename(name,j)) != 0 ) if ( (str= komodo_pricename(name,j)) != 0 )
@@ -1245,7 +1245,7 @@ UniValue prices(const UniValue& params, bool fHelp)
offset = j*width + i; offset = j*width + i;
smoothed = komodo_pricesmoothed(&correlated[i],daywindow); smoothed = komodo_pricesmoothed(&correlated[i],daywindow);
UniValue parr(UniValue::VARR); UniValue parr(UniValue::VARR);
parr.push_back(ValueFromAmount(prices[offset]*10000)); parr.push_back(ValueFromAmount((int64_t)prices[offset]*10000));
parr.push_back(ValueFromAmount(correlated[i])); parr.push_back(ValueFromAmount(correlated[i]));
parr.push_back(ValueFromAmount(smoothed)); parr.push_back(ValueFromAmount(smoothed));
p.push_back(parr); p.push_back(parr);