Doing back Testing with Super Trend

Hi all,

Please share the syntax of Supertrend indicator. I want to check the effectiveness before using it for trading.
Even the calculation of supertrend indicator will suffice.

Thanks in advance,
Satyendra