3 ms·
Here's how I'd do it: Don't let the variable be the stock itself because otherwise your search space will be too big... limit the number of stocks you can opti
by ukoki 14y ago
Here's how I'd do it:
Don't let the variable be the stock itself because otherwise your search space will be too big... limit the number of stocks you can optimise on and constrict it to variables like "moving average duration". That way you can load the stock data onto the client side and do the processing there (presumably you're already doing this for your graphs anyway) - kick it off with a few generations of pretty loose genetic algorithm then when you get near your time limit switch to simulated annealing with the best handful of results to narrow down the answer as fast as possible. Keep it quick, say 2 seconds tops. Then what you can do is give the client a confidence rating so you can say something like "Found the following result with 89% confidence. Click here to perform a longer search for higher accuracy". Work out your confidence rating based on how bumpy the ride was.