Thanks for your larger explanation, Peter, but it didn't really address my 3 questions :-(
My TF+ code included Morris's criteria that the hammer's lower shadow be > 2x the body -- too messy in QP so used a variation of Monty's below. Morris tested various TA candle filters and recommended using stoc [or RSI] levels; I tested and settled on Stoc(15,3) <20 [and >80 for bearish-reversal patterns].
Have you found MACD(12,26) <= 0 in combination with a 26-day ema that has monotonically decreased for the last 30 days tests well?
Bob --- exchange = nyse, amex, nasdaq; //input = "100k.lst"; output = "hammer bob.lst"; float maxPr, minPr, top; minPr := 5; maxPr := 20; top := .67; integer tbar; tbar := -20; //float temp, last; DaysToLoad = 100 -tbar; set Stochastic = 15,3,3; printhdrln " Symbol,Stoch%D,MACD,tbar,date"; if close(tbar) <= maxPr and close(tbar) >= minPr then if StochasticPctD(tbar) < 20 then if open(tbar) >= high(tbar) - top*range(tbar) and close(tbar) >= high(tbar) - top*range(tbar) and range(tbar)> 0 and open(tbar) != close(tbar) then println symbol,",",StochasticPctD(tbar):4:3,",", MACD(tbar),",",tbar,",",date(tbar); endif; endif; endif; |