This is based on SuperTrend by Kivanc. I only added the position size calculation and displaying the result.
I sann TradingView-anda har författaren till detta skript publicerat det som öppen källkod, så att handlare kan förstå och verifiera det. Skål för författaren! Du kan använda den gratis men återanvändning av den här koden i en publikation regleras av våra Ordningsregler. Du kan göra den till favorit för att använda den i ett diagram.
If your question was actually regarding the SuperTrend lines, then this is also easy: when it is green the sentiment for the asset is bullish and the green line shows you your stop loss level. When the price drops below the green line, the indicator switches direction to indicate bearish sentiment in which case the line would turn red and it would be on top of the price to show the stop loss level for shorting. Hope this helped.
The settings affecting the stop loss level are basically the ATR period, ATR Multiplier and the ATR calculation method. Larger period will give you late changes whereas a larger multiplier will widen your stop losses. The calculation method will change the way the volatility is calculated so it will have some impact on where the stop loss is drawn as well. I would say that these are a bit more of a personal kind settings.
And each trader will have slightly different favorite settings. I myself don't change these settings. But if the security you are trading is too volatile then of course some adjustments may be needed to avoid too many signals being generated. Or maybe changing the timeframe might help.