removed failed experiment of bid market price, small simplification in high bid calculation

This commit is contained in:
Manuel Simon Hirsig
2016-02-10 03:22:15 +01:00
parent 5ce55bdd1d
commit a910719c06
5 changed files with 5 additions and 40 deletions
+1 -30
View File
@@ -27,9 +27,6 @@ function private.read_record(item_key)
market_values = Aux.util.map(Aux.persistence.deserialize(fields[5], ';'), function(value)
return tonumber(value)
end),
max_bids = Aux.util.map(Aux.persistence.deserialize(fields[6], ';'), function(value)
return tonumber(value)
end),
}
else
record = private.new_record()
@@ -51,7 +48,6 @@ function private.write_record(item_key, record)
record.daily_min_buyout or '',
record.daily_max_price or '',
Aux.persistence.serialize(record.market_values, ';'),
Aux.persistence.serialize(record.max_bids, ';', 'x'),
},'#')
end
@@ -78,18 +74,10 @@ end
function public.price_data(item_key)
local item_record = private.read_record(item_key)
return item_record.daily_max_bid, item_record.daily_min_buyout, item_record.daily_max_price, item_record.market_values, item_record.max_bids
return item_record.daily_max_bid, item_record.daily_min_buyout, item_record.daily_max_price, item_record.market_values
end
function public.value(item_key)
if aux_conservative_history then
return private.conservative_historical_value(item_key)
else
return private.historical_value(item_key)
end
end
function private.historical_value(item_key)
local item_record = private.read_record(item_key)
if getn(item_record.market_values) > 0 then
@@ -99,16 +87,6 @@ function private.historical_value(item_key)
end
end
function private.conservative_historical_value(item_key)
local item_record = private.read_record(item_key)
if getn(item_record.max_bids) > 0 then
return private.median(item_record.max_bids)
else
return item_record.daily_max_bid
end
end
function private.market_value(item_record)
local estimate
@@ -151,13 +129,6 @@ function private.push_record(item_record)
end
end
if item_record.daily_max_bid then
tinsert(item_record.max_bids, item_record.daily_max_bid)
while getn(item_record.max_bids) > 11 do
tremove(item_record.max_bids, 1)
end
end
item_record.daily_max_bid = nil
item_record.daily_min_buyout = nil
item_record.daily_max_price = nil