This is very close to a filter made in StockFetcher by a member Kevin_in_Ga has many great filters. So, if inclined to view his filter to review his program (different language) I'll either copy it over to here or you can see it on the stockfetcher website and and search the forum for: A LITTLE PIECE OF VOLATILITY. He uses Historical Volatility along with Average Volume for 3 days. Its very good at getting in and out of 3x etfs. Plz let me know if you need anything I can do. Great indicator.