Which statistical methods could I use to determine if a price is good, based on a history of prices? I have the following scenario:


*

*A history of prices of a specific product;

*The current price of the same product.


The history of prices should contain prices with a certain amount of discount, very low prices (black friday prices) and "normal" retail prices.
Based on the history of prices, I want to determine if the current price is good for buying the product. The current price might not be the lowest price of the history, but still be a good price.
I have a very simple algorithm to do it:


*

*I have a minimum ammount of discount per product, say 15%

*Based on the history, I have an average price (sum(prices) / sum(quantity))

*If the current price is 15% (or the configured minimum discount) lower than the average price, it is a good price for buying.


This is very simple, but it does not always work.
The history of prices could contain older products with several months of data, or newer products with a few weeks of price data. It is acceptable that the final algorithm will work better for older products with more data.
Which statistical methods could I apply that would make the algorithm more precise?
 A: Build a good ARIMA model for your price history incorporating memory, events (e.g. Black Friday etc ...), day-of-the-week, seasonal dummies, level shifts , local time trends and the run a program that incorporates robust ARIMA (not AIC or BIC based as those procedures assume no outliers and restrict the model form to a list) and assess whether or not an intervention pulse has occurred at the last period. If it has then an exception has been detected ... if not then nothing exceptional in last data point.
To do science is to search for repeated  patterns.
To detect anomalies is to identify values that do not follow repeated patterns. 
For whoever knows the ways of Nature will more easily notice her deviations
and, on the other hand, whoever knows her deviations will more accurately
describe her ways.                                                              
One learns the rules by observing when the current rules fail.     
The problem is that you can't catch an outlier without a model (at least a mild one) for your data. Else how would you know that a point violated that model? In fact, the process of growing understanding and finding and examining outliers must be iterative. This isn't a new thought. Bacon, writing in Novum Organum about 400 years ago said: 
"errors of Nature, sports and monsters correct the understanding in regard to ordinary things, and reveal general forms. For whoever knows the ways of Nature will more easily notice her deviations; and, on the other hand, whoever knows her deviations will more accurately describe her ways." [ II 29] 
A: Clearly the answer depends on the dynamics of the prices, so having a model for that would be required, as a previous answer indicates. It seems to me that if one cannot assume anything about prices, this would be related to the secretary (or princess....) problem. 
If all, say $r$, suitors of a princess are summoned sequentially to her presence and she is able to rank them, the strategy that maximizes her chance of choosing the optimal candidate is to reject the first $\approx r/e$ and then pick the first one which dominates all the previously seen, in case there is one (otherwise, put up with the last one): see Billingsley, Probability Theory, for instance.
However, this is a strategy that maximizes her chances of getting the very best suitor, a more conservative princess might prefer a strategy that produces a good enough partner. Seeing all prices in sequence and acting likewise might give you the maximum chance to get the lowest one, but perhaps at the cost of missing quite often prices which are nearly as good.
Just a thought, probably irrelevant but which may give you some idea.
