While I personally have no experience with any of these modules or stock modeling in general, it looks to me like
Math::Business::RSI implements something kinda like what you want. Worst case scenario, it should give you some helpful source material. You may want to check out
Math::Business, specifically
Math::Business::StockMonkey and
Math::Business::StockMonkey::Cookbook for some possibly helpful code as well.