How to make code for identification of multiple continuous doji or weak body candles in chart

Hello Experts, Kindly help me to make code for identification of multiple continues doji or weak body candles in chart. Thx in advance.

For the above query you can check this link with tradescript code which has continues stars

the buy script for bullish 3 starts in south is throwing an error when I use it in scanner

REF(OPEN,1)=REF(HIGH,1) AND
REF(CLOSE,1)=REF(LOW,1) AND
REF(OPEN,1)>REF(CLOSE,1) AND
REF(OPEN,2)>REF(CLOSE,2) AND
REF(OPEN,2)=REF(HIGH,2) AND
REF(CLOSE,2)>REF(LOW,2) AND
REF(OPEN,3)>REF(CLOSE,3) AND
REF(OPEN,3)=REF(HIGH,3) AND
REF(CLOSE,3)>REF(LOW,3) AND
REF(CLOSE,2)>REF(CLOSE,1) AND
REF(CLOSE,3)>REF(CLOSE,2) AND
REF(OPEN,2)>REF(OPEN,1) AND
REF(OPEN,3)>REF(OPEN,2) AND
REF(LOW,1)>REF(LOW,2) AND
REF(LOW,2)>REF(LOW,3)

AFL or Tradescript?

I have tested it on my side , to rectify the error, refer to point 2 of the checklist:
http://tradingqna.com/46073/wiki-zerodha-backtest-scanner-error-troubleshoot-checklist