Hi, I am trying to find a good formula for flag consolidation setups? (primarily buying stocks on daily timeframe)
For examples – please see attached.
Main filters would be…
1> a recent volume spike ( within 10 days)
2> gap up or sharp climb in price movement +3 daily candles (flagpole)
3> a sideways volume consolidation of at least 3 days ( flag)
Thanks very much
Neal
Here is how I coded it and should be more or less in accordance in what you need.
- there was a breakout of volume over its 20 periods average
- the squared percentage of the price close minus the 7 periods average made a breakout over its 200 periods average + 80% of its standard deviation
- the SMA 7 is over the SMA 200 and price is over the SMA 200
- the current candle high is below the highest high of the last 3 periods
c1 = summation[10](volume crosses over average[20](volume))>0
a = summation[3](close-average[7]/average[7])
diff = square(a-a[1])
avg = average[200](diff)+std[200](diff)*.8
c2 = summation[10](diff crosses over avg)>0
c3 = average[7]>average[200] and close>average[200]
c4 = high<highest[3](high)
c = c1 and c2 and c3 and c4
screener[c]