So the first step is to assume that your historical market data will look something like this:
Low: 1 isk, Avg: 5 isk. High: 12 isk
And just use ratios to derive the data you want.
Unfortunately, often you’ll have data that looks like this:
Low: 5 isk, Avg: 5 isk, High: 5 isk
A good answer to this problem is to look at the previous and following days and try to figure out whether that’s a high price or a low price. One strategy to do so is to check whether the previous or following days have a normal spread, and try to assume that the problem day had very similar pricing. Another strategy, complementary not supplementary, is to look over a big window of time (~300 days) and try to determine whether the item you’re looking at tends to sell entirely to buy orders or tends to be bought entirely from sell orders.
Unfortunately, sometimes you’ll have data that looks like this:
Low: 0.01isk, Avg: 4 isk, High: 6 isk.
Again, you have to interpolate from other data points for the same item, but you can do a pretty decent job of it.
Unfortunately, all this calculation is slightly useless, because market history has an OVERZEALOUS TRIMMING ALGORITHM that tends to completely ruin the data and lie about the actual history. @rhivre @CCP_Quant