TradingView
ekrem6nel
15 мар 2021 г., 13:21

Supertrend / Position Sizing 

United States Oil FundArca

Описание

SuperTrend with position sizing calculator.

This is based on SuperTrend by Kivanc. I only added the position size calculation and displaying the result.

Информация о релизе

The SL precision is increased.

Информация о релизе

Now it is possible to take wicks into account, as per requested. By default wicks will be ignored.

Информация о релизе

Color of the label is based on the up or down trend now.
Комментарии
golden-year
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?
ekrem6nel
@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.
golden-year
@ekrem6nel, Thank you for your answer, tell me how the stop loss is calculated and where you can change the stop loss settings
ekrem6nel
@golden-year, The stop loss is calculated in the first half of the script which actually is developed by Kivanc Ozbilgic(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.
faizannawaz1
Sir is it possible to add Entry , Tp1 and Tp 2 based on trend ?
nawazfaiz
Hello sir , is it possible to add high and low of the breakout candle of the trend ?
ekrem6nel
@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.
nawazfaiz
@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?
ekrem6nel
@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?
nawazfaiz
@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,,
Ещё