ekrem6nel

Supertrend / Position Sizing

SuperTrend with position sizing calculator.

This is based on SuperTrend by Kivanc. I only added the position size calculation and displaying the result.
Release Notes: The SL precision is increased.
Release Notes: Now it is possible to take wicks into account, as per requested. By default wicks will be ignored.
Release Notes: Color of the label is based on the up or down trend now.
Skript med en öppen källkod

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.

Vill du använda det här skriptet i ett diagram?

Kommentarer

I really liked your work, tell me in more detail how the calculator works in the script, what do the numbers mean, what should you pay attention to?
+1 Svara
ekrem6nel golden-year
@golden-year, The first number in the blue label is the max position size one should have based on their available capital and risk. The second number is the price at which they should have their stop loss set for the trade.

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.
+3 Svara
golden-year ekrem6nel
@ekrem6nel, Thank you for your answer, tell me how the stop loss is calculated and where you can change the stop loss settings
Svara
ekrem6nel golden-year
@golden-year, The stop loss is calculated in the first half of the script which actually is developed by Kivanc Ozbilgic(https://www.tradingview.com/u/KivancOzbilgic/). But basically it calculates the stop loss from each candle based on a certain multiple of the recent volatility (one for up and one for down trend). And for each candle, it plots the larger of the last two values of this series for up trend stop loss and smaller thereof for the down trend. This is why the stop loss moves with the price movements and it flattens when the price stops moving very fast or it is in a range, or in a pullback.

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.
+1 Svara
Sir is it possible to add Entry , Tp1 and Tp 2 based on trend ?
Svara
Hello sir , is it possible to add high and low of the breakout candle of the trend ?
Svara
ekrem6nel nawazfaiz
@nawazfaiz, I have added the possibility to take the wicks into account when determining the trend direction. I am not sure whether this was what you actually asked for, but try it out if you wish. Do do that just open the settings for the indicator and uncheck the "Ignore the wicks ?" checkbox, which is selected by default.
Svara
nawazfaiz ekrem6nel
@ekrem6nel, Thankyou for replying , sir i ment as the trend changed to bullish the 1st candle that broke and closed above the Trailing SL .. I want that specific candle high and low line.. can it be plotted on the chart?
Svara
ekrem6nel nawazfaiz
@nawazfaiz, Do you mean instead of the currently drawn SL lines? Or in addition to these? And can you please explain the reason why you would need these lines?
Svara
nawazfaiz ekrem6nel
@ekrem6nel, As the trend changed from downtrend to uptrend Buy signal generates on bottom of the breakout candle , i want line to be drawn on high of the breakout candle and low of the previous low candle , as i can plot fib retracement on it . If suppose the candle retraced below 0.618 ill exit the trade of buy / sell side,,
Svara