Во. Пофиксил.
--- diatest.old 2012-03-09 10:12:03.000000000 +0200
+++ diatest 2012-03-09 10:56:24.178976763 +0200
@@ -9,8 +9,8 @@
winestim = 600
-check_prev = 0
-check_preprev = 0
+check_prev = 1
+check_preprev = 1
prices = []
checks = []
@@ -32,12 +32,12 @@
def reprice(h):
print "=====checkpoint @", h
- if h == 0:
+ if h <= 1:
return old_price
- if h == 2016:
+ if h <= 2017:
return old_price
- n_prev = h - check_prev
- n_preprev = check_prev - check_preprev
+ n_prev = h - check_prev - 1
+ n_preprev = check_prev - check_preprev - 1
if n_prev ==0 and n_preprev ==0:
return old_price/4
if n_prev == 0:
@@ -45,7 +45,7 @@
if n_preprev == 0:
return old_price * 4;
ts_prev = times[h-1] - times[check_prev]
- ts_preprev = times[check_prev] - times[check_preprev]
+ ts_preprev = times[check_prev-1] - times[check_preprev]
print "check_prev=",check_prev," check_preprev=",check_preprev
print "nprev=", n_prev, " npprev=",n_preprev
print "tsprev=", ts_prev, " tspprev=",ts_preprev
@@ -67,11 +67,11 @@
for x in range(0, last):
times.append(0)
-for z in range(0, last):
+for z in range(1, last):
times[z] = set_time(z)
# if z !=0:
# print "Block #",z," time=", times[z], "diff=", times[z]-times[z-1]
- if z < 2016:
+ if z < 2016 or (times[z] - times[1]) < 1209600:
continue
if ((z - check_prev) % 2016 == 0):
Результат: при равномерном распределении спроса (random) и стартовой цене 0.02, за 200к блоков
min & max prices were = 0.0199220322999 0.0200676816951
checkpoints were :
[2016, 3907, 5800, 7692, 9586, 11486, 13373, 15262, 17154, 19048, 20941, 22834, 24727, 26623, 28515, 30409, 32301, 34193, 36088, 37980, 39867, 41759, 43651, 45539, 47432, 49321, 51212, 53102, 54992, 56885, 58777, 60667, 62562, 64455, 66347, 68239, 70131, 72025, 73913, 75804, 77695, 79586, 81478, 83367, 85260, 87153, 89043, 90934, 92824, 94714, 96606, 98494, 100386, 102276, 104167, 106059, 107950, 109842, 111737, 113630, 115522, 117414, 119306, 121200, 123090, 124985, 126876, 128766, 130657, 132548, 134438, 136333, 138226, 140121, 142012, 143904, 145797, 147690, 149583, 151476, 153369, 155262, 157153, 159046, 160937, 162828, 164721, 166609, 168503, 170396, 172287, 174176, 176067, 177960, 179855, 181745, 183635, 185525, 187419, 189312, 191200, 193091, 194982, 196875, 198770]
http://pastebin.com/8UDWrXfp0.78% изменение за 4 года. Вполне себе ничего для рэнда. Удивительная стабильность в наше то время =)