Creating an arrow on each bar by looking into the previous bar

 


Can any body please help me by providing code for drawing arrow on each bar by looking into previous bar.

If previous bar is bearish then sell arrow will be appeared on start on next bar

if previous bar is bullish then buy arrow will be appeared on start of next bar

if previous bar is doji then no arrow will be appeared on next bar