Could anyone give me some help?
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Paint bars after candle cross EMA
Collapse
X
-
Paint bars after candle cross EMA
I'm trying to develop an indicator that paint the bar in yellow color when it crosses EMA 10. If the candle is up, paint it in hollow. if the candle is down, paint it in solid yellow color.
Could anyone give me some help?
Tags: None
-
Thanks for you reply. I still not sure how to build an indicator from scratch. So, I found this indicator and made some modification
10/2/2011 Edit entry. Error in download file. Corrected now. V2. Added the option to also paint the wicks on candlesticks based on a second SMA (default is 50 periods). This indicator will color the price bar red when price closes below the SMA and green when price close above the SMA (default period is 20) […]
AddPlot(Brushes.Transparent, "SMAvg");
Also,
protected override void OnBarUpdate()
{
//Add your custom indicator logic here.
// Use this method for calculating your indicator values. Assign a value to each
// plot below by replacing 'Close[0]' with your own formula.
double ttt = EMA(Close, sMA)[0];
SMAvg[0] = (ttt);
if (CrossBelow(Close, ttt, 1))
{
// Paint solid yellow
CandleOutlineBrush = Brushes.LimeGreen;
BarBrush = Brushes.LimeGreen;
}
// Check if price crosses up the EMA8
else if (CrossAbove(Close, ttt, 1))
{
// Paint hollow yellow (outline yellow, but no fill)
CandleOutlineBrush = Brushes.Yellow;
BarBrush = Brushes.Transparent;
Now, I'm not sure if it's EMA or SMA. In addition, I was wondering how to make the color selection in the indicator importing phase.like, select the color of the bull candle that crosses up EMA8. Select the color of the bear candle that crosses down EMA 8
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Mindset, 04-21-2026, 06:46 AM
|
0 responses
49 views
0 likes
|
Last Post
by Mindset
04-21-2026, 06:46 AM
|
||
|
Started by M4ndoo, 04-20-2026, 05:21 PM
|
0 responses
69 views
0 likes
|
Last Post
by M4ndoo
04-20-2026, 05:21 PM
|
||
|
Started by M4ndoo, 04-19-2026, 05:54 PM
|
0 responses
36 views
0 likes
|
Last Post
by M4ndoo
04-19-2026, 05:54 PM
|
||
|
Started by cmoran13, 04-16-2026, 01:02 PM
|
0 responses
96 views
0 likes
|
Last Post
by cmoran13
04-16-2026, 01:02 PM
|
||
|
Started by PaulMohn, 04-10-2026, 11:11 AM
|
0 responses
59 views
0 likes
|
Last Post
by PaulMohn
04-10-2026, 11:11 AM
|

Comment