Never did any coding, this is my first Ninja script and it started just two days ago. No credit on my part, but big THANKS to NinjaTrader_Chelsea who got me started by providing me with all the links I need, and to NinjaTrader_Kate who followed through later on, and more so to eDanny who provided more instructions beyond just coding (I prefer to skip all the details here).
This indicator paints bars with the same color for as long as the trend remains. It does not change the bar shape like Heikin-Ashi indicator does, which I do not prefer. The simple logic of the indicator is to compare Close(current) with (Average Close - ATR*Percent). If greater, bullish trend. If less, bearish trend. You have two parameters to control the look of the chart. One is how many bars you want to look back for the average close, and the other is how much (in terms of percent) ATR you want to include in the formula. You can choose 0% ATR if you want to and it becomes a simple comparison between current close and the average close of certain amount of bars.
Generally, the more bars you use the longer the trend remains. The less bars you use the more frequent changes of the trend. Likewise, the more ATR (say 1 or 100%) applied the less changes of the trend. I attached a screenshot with looking back bars set at 6 and 20, respectively. ATR was 0.5 for both.
Again, big THANKS to Chelsea, Kate and eDanny. It's your baby.
Last but not the least, c stands for Chelsea, d for eDanny and k for Kate.

Comment