Tradescript Code : Bear Flag Pattern on Zerodha Pi Scanner

Tradescript code to work on the Zerodha Pi Scanner. This code generates trade signals on bear flag pattern formation on your favorite stocks.

This Tradescript code can be used to generate  intraday trade signals in a Bear Market. Use on the Zerodha Pi scanner on 1 min time frames.

Use the signal to trade:

  1. The second leg of bear flag formation or
  2. A possible reversal with strength.

These code works similar to THE BULL FLAG code to identify market volatility and requires careful supervision when implemented. Practice before you start trading with these code.

Tradescript code for the Bear Flag Pattern :

CLOSE >= REF(CLOSE,1) AND REF(CLOSE,1) < REF(CLOSE,2) AND
REF(CLOSE,2) < REF(CLOSE,3) AND
REF(CLOSE,3) <= REF(CLOSE,4) AND DIN(14) > DIP(14) AND
REF(ADX(14),1) > REF(ADX(14),2) AND
REF(ADX(14),2) > REF(ADX(14),3) AND
REF(VOLUME,1) > REF(VOLUME,4) * 2 

Generates trade alert on the first correcting candle of the downward bear pole.