TradingView
EvoCrypto
20 jul 2020 09:37

Trends & Ranges 

Bitcoin / US Dollar Perpetual Inverse Swap ContractBitMEX

Beskrivning

Trends & Ranges uses EMA ATR bands as a SuperTrend indicator.

How to use:
This indicator can be used to give you a direction bias, with the added function to create ranges which often lead to reversals or flat trading periods. Trade the break-out or wait for pull backs in the direction of the trend.

I'm not great at explaining stuff and will probably make things only more complicated, so I won't bother for now,
but if you have a question on how the script works I will gladly give it a try.

The option "Flexible Trends" will disable the min/max function (trailing or non trailing).

Flexible Trends enabled:


Flexible Trends disabled:


Settings are not optimized for any asset or time frame, you will have to do that for yourself. Feel free to share them in the comments.
Thanks for showing interest, enjoy and good luck! :)

Versionsinformation

Fixed a typo

Versionsinformation

Update:
- New alerts
- New moving average options
- New extend line function
Kommentarer
haikustar
Congratulations on this excellent indicator! I've been trying to understand it but this line eludes me, how does the value of up get passed between the conditionals?
up := up != 1 and close > (showRange ? downRange : downTrend) ? 1 : up == 1 and close < upTrend ? -1 : up
EvoCrypto
@azohar, Good one, it doesn't really make sense. At the time, I couldn't get it working so when it finally did I just went with it and never looked back lol.. Can also be shorter like this I think:
up := close > (showRange ? downRange : downTrend) ? 1 : close < upTrend ? -1 : up

Many of my scripts need some fine-tuning when I get back into Pinecoding, as some of it is not the most efficient code or the best example for new coders. Thanks for the comment, I appreciate it a lot! :)
marvinbakyayita
Ue must be a genius 🥳. Ue just helped me complete a strategy I've been working on for some time 😅
EvoCrypto
@marvinbakyayita, haha good to hear that :)
SYKZ01R
Nice script and idea of flexible trend. I tried it out but in some parts, its showing both yello and red how to determine what the trend is?
sekhar6239
What values are taken in super trend sir
EvoCrypto
@sekhar6239, What do you mean ?
sekhar6239
@EvoCrypto, period and multiplier broo
ilesanmipepsi
Thanks for sharing, you're doing a great job! Can you share your best setting for BTC, thanks?
EvoCrypto
@ilesanmipepsi, Thank you! That depends on how you want to use it, simply to give you a bias and use other indicators or take signals right when the trend changes.. then there is the option "Flexible Trend" which works different for each time frame. Overall i like the default settings for the daily how they are, for time frames like 1 hour I would use flexible trends since the close is not that strong as on the daily.
Mer