Test
This commit is contained in:
@@ -2254,8 +2254,8 @@ int64_t komodo_pricecorrelated(uint64_t seed,int32_t ind,uint32_t *rawprices,int
|
||||
correlation = 0;
|
||||
i = (iter + seed) % daywindow;
|
||||
refprice = rawprices[i];
|
||||
highprice = (refprice * (COIN + PRICES_MAXCHANGE*3)) / COIN;
|
||||
lowprice = (refprice * (COIN - PRICES_MAXCHANGE*3)) / COIN;
|
||||
highprice = (refprice * (COIN + PRICES_MAXCHANGE*4)) / COIN;
|
||||
lowprice = (refprice * (COIN - PRICES_MAXCHANGE*4)) / COIN;
|
||||
if ( highprice == refprice )
|
||||
highprice++;
|
||||
if ( lowprice == refprice )
|
||||
@@ -2312,7 +2312,7 @@ int64_t komodo_pricecorrelated(uint64_t seed,int32_t ind,uint32_t *rawprices,int
|
||||
if ( (price= nonzprices[i]) != 0 )
|
||||
{
|
||||
den += (daywindow - i);
|
||||
sum += ((daywindow - i) * (price + firstprice*2)) / 3;
|
||||
sum += ((daywindow - i) * (price + firstprice*9)) / 10;
|
||||
n++;
|
||||
}
|
||||
}
|
||||
@@ -2369,7 +2369,7 @@ int64_t komodo_pricesmoothed(int64_t *correlated,int32_t daywindow,int64_t *nonz
|
||||
sum = den = 0;
|
||||
for (i=0; i<daywindow; i++)
|
||||
{
|
||||
sum += ((daywindow - i) * (correlated[i+iter] + firstprice))/2;
|
||||
sum += (daywindow - i) * correlated[i+iter];
|
||||
den += (daywindow - i);
|
||||
}
|
||||
smoothed[iter] = (sum / den);
|
||||
|
||||
Reference in New Issue
Block a user