Hello, I want to test a strategy of buying 20day Highs and 52 weeks highs.. I know how to grab the H L O C from yahoo. I need help in the formulas on calculating 20 days high and 52 week H/L and i dont know how to write the formula to buy and sell Preferable i like buy when it exceed either 20 day or 52 week high and sell at a 4% profit or sell when its 2% loss. any ideas Thanks in advance
I think www.InvestExcel.net has something similar to what you're looking for. If it's not exactly what you want, toss the guy a few bucks and he'll unlock the VBA code.
Financially, you're better off not being able to test such a strategy lest you are tempted to engage in it.