Soft-update, CTRL+F5 in the sidebar to get the latest version and restarting excel recommended, will be visible in the sidebar as 1.4 in the top left corner.
Marketplace update will follow to sync that version as the latest and prompt users to update if a version mismatch is detected (Will take some days to be released)
New Functions and parameters
.MARKET_ORDERS_STATS(region_id, type_id, [location_id])
*location_id can be a station or a solarsystem to filter results down to (npc stations in system, and npc stations support to being with). Common use case → Jita 4-4 only
-
Will return an entity containing data about the order set from a normal MARKET_ORDERS call.
Data is split into .buy and .sell cards, making it easier to get the lowest sell order via the fields .sell.min and highest buy via .buy.max -
Additionally a 5% percentile price is being returned done by omitting outliers (100/highest buy, 100*lowest sell) and iterating through the prices until a 5% volume number is reached, the formula used exactly will be posted below.
-
Includes .stddev, .median, .volume and .numorders fields.
.MARKET_HISTORY(region_id, type_id, [latest_only])
-
latest_only now accepts a number, will aggregate the market_history data for the past X days based on the number entered. (Old version of latest obtained with TRUE = 1 now, without average data but just the latest market history data entity)
Exposes the values as direct fields to call upon. (fx. .average_average, .lowest, .highest, .volume, .average_volume) -
Note that when days are omitted from the results they are exposed via .days_without_data and don’t count for the average calculations.
TYPE(type_id, [include_dogma])
- New optional parameter for .TYPE calls that will expose dogma attributes of types into a .dogma field on the card.
It’s outputting the raw data so in some cases it’s not the exact attributes you see in-game.
But slot layout numbers are fx. shown as normal.
.CHARACTER(character_id, [fetch_location_and_ship])
- fetch_location_and_ship = TRUE will fetch, if signed in, the characters current location and ship data and append any values returned to the card as fields. (location_solar_system_id, location_station_id, location_structure, ship_item_id, ship_name, ship_type_id)
Data and misc changes
- Character/corporation blueprints will now return type_id instead of a type card, and not return blueprint_data if the results are going to exceed 500 blueprints to better support large character/corporation blueprint results.
- Skill queue entries now display .active Boolean fields to match when it outputs (paused) and (active), if a skill has finished and the character hasn’t logged in the list is likely not going to display this value and text, being looked into to improve it more.
- Filter assets by location_filter and type_id will now expose items nested inside containers, previous version only returned those one level down if the .final_location wasn’t used. Best example is using the id of an office and having things inside a container. Now that will return the expected results.UI
- Added an error notification to the sidebar if the access token is invalid, so you can reauthorize the character affected.
- Same error notification will attempt to alert on any ESI errors from functions.
- Added a link to the function parameter helper website to the sidebar.
- Added more functions to the try it out section.
- Fixed a rare issue of market_history sort order being sometimes from oldest date or from the newest date, now it will always return the order as new → old
5% percentile logic in TypeScript (forums display isn’t great here sorry)
First it filter out outliers.
const filteredSellOrders = sellOrders.filter((order: any) => order.price <= minvalSell * 100);
const filteredBuyOrders = buyOrders.filter((order: any) => order.price >= maxvalBuy / 100);
Find the 5% percentile price (orders are already sorted based on buy/sell price)
calculatePercentile(orders: IGet_markets_region_id_orders_200_ok[], percentile: number): number {
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;
}
This returns pretty close to fuzzworks market percentile numbers, but not exactly as fuzz’s version has a weighted percentile of all orders, instead of stepping through the orders until we find the >=5% volume and return the first order price found.
Any feedback on the percentile or changes in the approach to it are encouraged.
Edit: 23:03
Functions parameter website updated for 1.4