Pin Bar Detection: The script defines functions for detecting bullish and bearish pin bars based on the proportions of the candlestick body and wicks.
Bullish Pin Bar: Has a long upper wick relative to the body and a body-to-wick ratio below a certain threshold.
Bearish Pin Bar: Has a long lower wick relative to the body and a body-to-wick ratio below a certain threshold.
Arrows: Green "BUY" arrows are plotted below bullish pin bars, and red "SELL" arrows are plotted above bearish pin bars.