OPEN-SOURCE SCRIPT

Moving Average - fade when crossed [cajole]

Updated
This indicator simply provides a moving average (SMA, EMA, etc. can be selected) which hides itself when touched by the price.

Two potential uses:
  • Set the growth rate to be slow, to highlight only very rapid moves on a chart.
  • Use the default settings and change the averaging period until the MA line remains bright. This MA can then act as a good trailing stop for the specific security.


TradingView does not remember indicator settings for specific charts. Consider adding a text label to your chart after you identify the ideal trailing stop. Similar trailing-stop methods are recommended by Kristjan Qullamagie is identical to Jesse Stine's "magic line" concept.
Release Notes
Add an option to label the last value. Useful when using the script as a trail stop.
Exponential Moving Average (EMA)LINEmagicqullamagieSimple Moving Average (SMA)trailingstopWeighted Moving Average (WMA)

Open-source script

In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in publication is governed by House rules. You can favorite it to use it on a chart.

Want to use this script on a chart?


Also on:

Disclaimer