testing out bid based market value

This commit is contained in:
Manuel Simon Hirsig
2016-02-07 15:10:44 +01:00
parent 61efe10681
commit fae940cf9c
4 changed files with 26 additions and 8 deletions
+20
View File
@@ -19,6 +19,11 @@ function private.read_record(item_key)
last_daily_values = Aux.util.map(Aux.persistence.deserialize(record[3], ';'), function(value)
return tonumber(value)
end),
-- auction count
-- latest_buyout_dailies
-- latest_bid_dailies
-- current_day_max_bid
-- current_day_buyout_histogram
histogram = Aux.util.map(Aux.persistence.deserialize(record[4], ';', 'x'), function(value)
return tonumber(value)
end),
@@ -37,6 +42,21 @@ end
function public.process_auction(auction_info)
-- experimental
local unit_high_bid = auction_info.high_bid/auction_info.aux_quantity
aux_max_bids[auction_info.item_key] = max(aux_max_bids[auction_info.item_key] or 0, unit_high_bid)
if aux_max_bids[auction_info.item_key] > 0 then
snipe.log(auction_info.hyperlink..': '..Aux.money.to_string(aux_max_bids[auction_info.item_key]))
end
-- experimental
local snapshot = Aux.persistence.load_snapshot()
if not snapshot.contains(auction_info.signature) then
return
end
snapshot.add(auction_info.signature, auction_info.duration)
if auction_info.buyout_price == 0 then
return
end