What is the TradeScript code which will identify Tweezer Tops?

…where the first candle is bullish, the second bearish, and the top wicks of each candle are at least as long as the body of the the candle, and the high is the highest high in the last 20 periods…and, if the pattern is also a bearish engulfing pattern, that would be even more awesome.

Similarly, the code for a Tweezer Bottom with similar but opposite characteristics. Though I think if I had the first, I could do the second. I am new to TradeScript programming.

Many thanks,

Derek

hElLO tRaDeR,

SCRIPT:

REF(CLOSE,1) > REF(OPEN,1) AND 
REF(HIGH,1) - REF(CLOSE,1) >= REF(CLOSE,1) - REF(OPEN,1) AND 
CLOSE < OPEN AND 
HIGH - OPEN >= OPEN - CLOSE AND 
HIGH > REF(HIGH,1) AND 
LOW < REF(LOW,1) 

The last 2 lines of the codes relates to engulfing condition, you can remove these 2 lines if not needed .