TradingView
NorthStarDayTrading
6 avr. 2021 05:24

NSDT MA Colored Candles 

Micro E-mini Nasdaq-100 Index Futures (Jun 2021)CME

Description

A simple script that will change the color of the candle if it closes over/under the designated Moving Average. This makes it very easy to identify trends based on your selected Moving Average line length. You can choose EMA, SMA, or WMA and of course the length is adjustable as well. To see these candles, be sure to go into the Chart Settings and uncheck the candle Borders, Colors, and Wicks.

Notes de version

Updated code to Pinescript V5.

Notes de version

Added alerts per request of @Nxjbdbe92872728
Commentaires
AlishaK_
Great stuff! Is there a way to make it where this only alerts once. So when it is MA falling we won’t get another alert until it’s MA rising instead of every time it’s falls or every time it rises?
NorthStarDayTrading
@AlishaK_, Sure. Set the alert to trigger only once.
prnt.sc/5Dar1kJnjJl8
howard95
NSDT, thank you for sharing this . Please consider this request. Having added the indicator to a chart, chart shows correctly the candle colors based on candle being above or below the selected moving average. However, when you click again on the chart it reverts back to the original candle colors. You have to click again on the indicator in the objects list for the chart to again show the indicator's effect . Can you provide an option for the indicator to permanently show the indicator's effect? This would enable more easy viewing of 2 side by side charts (chart without indicator & chart with indicator) without having to keep re-clicking on the indicator in objects list.
NorthStarDayTrading
@howard95, Hi there. You can have it always take over the original candle colors by moving it above the instrument in the Object Tree found at the bottom of the panel on the right side of the chart.
howard95
@NorthStarDayTrading, Thank you for your fast response. I moved the indicator to the top of the objects list, & that locked in the color changes. Just what I needed. Thank you!
s0ar
Hi NSDT, this is great. The candle colour only changes when the cursor hovers over the MA line, could you make it so the candle colours appear all the time?
Thanks
NorthStarDayTrading
@s0ar, Hi Thanks. Actually, when you move over the MA line, it bring the indicator to the forefront. You can adjust that by moving the indicator IN FRONT OF the candles.
prnt.sc/vEy_FdEF5vbG
s0ar
@NorthStarDayTrading, I fixed it by going to the visual order and bring it to front, learn new thing everyday. Thanks again, bless you!
NorthStarDayTrading
@s0ar, Very good. Glad it worked out.
Nxjbdbe92872728
great work North Star Day Trading , can i add alert on color change is it possible ??
Plus