MARKET_ORDERS_STATS and how it works.
Market orders stats is a helper function wrapping the data from MARKET_ORDERS You can specify which location_id to only get the data from, such as stations or solarsystems
It collates information into fields more easy to consume and includes additional features such as the approx 5% percentile prices of each orderset. You can obtain the min sell and max buy prices directly via,
=EVEONLINE.MARKET_ORDERS_STATS(region_id,type_id).sell.min and
=EVEONLINE.MARKET_ORDERS_STATS(region_id,type_id).buy.max
Instead of having to do a =MAX(EVEONLINE.MARKET_ORDERS(region_id,type_id).price) and such. mean, median and stddev are rather straight forward.
Volume is the total listed items in the orderset, removing outliers.
Outliers logic is as follows:
Buy orders that are 100
/highest buy order
Sell orders that are 100*lowest sell order
5% Percentile logic is as follows:
const
totalVolume =
orders
.reduce((
sum
,
order
)
=>
sum
+
order
.volume_remain, 0);
const
percentileVolume = (
percentile
/ 100) * totalVolume;
let
cumulativeVolume = 0;
let
percentilePrice = 0;
for (
const
order of
orders
) {
cumulativeVolume += order.volume_remain;
if (cumulativeVolume >= percentileVolume) {
percentilePrice = order.price;
break;
}
}
return percentilePrice;
P.S.
For true "volume" numbers we recommend the market_history function, which also contains a 3rd optional parameter that will either show the most latest available entry directly, or average together the history entries back X number of days, while exposing if any days are missing due to low volume.
Fx. =EVEONLINE.MARKET_HISTORY(10000002,587,7)
will go back 7 days and average the datapoints from those days
Fx. =EVEONLINE.MARKET_HISTORY(10000002,587,TRUE)
will show the latest card available