One last thing-is it possible to not have the EMA's on the actual chart?
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
General Programming - (Indicator Development)
Collapse
X
-
General Programming - (Indicator Development)
OK, looking for any guidance here (I have attached a picture and labeled the areas I am talking about). No 1. I am using 2 EMA's one set at 14 and the other set at 25. What I am trying to do is that when the 2 EMA's are either similar (i would like to be able to adjust the inputs) or are at a certain close distance apart, the body of the bar changes to YELLOW (or any other color). basically to warn that the EMA's are on top of each other or getting close. Some significant moves tend to follow once this happens. No 2. I am trying to figure out how to produce an extreme signal once the security is a certain distance (again I would like to try to have this scale-able and input different variables for different markets) from these 2 EMA's. Again, I have attached a picture (it seems so) of an example of what I am trying to do. I have failed so far so looking for some help with the programming or suggestions.
One last thing-is it possible to not have the EMA's on the actual chart?Last edited by Labs905; 05-22-2015, 09:23 AM.Tags: None
-
Hello Labs905,
Thanks for your post.
For #1, one way to do this would be to use the tick difference between the EMAs and then you can set the minimum tick difference for the detection level. For example:
Using Math.Abs() to get the absolute difference between the EMAs then converting that to Ticks with TickSize (makes it work on all instruments) and then converting it to an integer (you could use as double if you want to skip conversion step). The variable detectionLevel would be something you could set in the user interface to find what works for you.Code:int tickdiff = Convert.ToInt32(Math.Abs(EMA(14)[0] - EMA(25)[0]) / TickSize); if (tickDiff < detectionLevel) { BarColor = Color.Yellow; // color the bar yellow when below detectionLevel }
TickSize: http://www.ninjatrader.com/support/h...l?ticksize.htm
Alternatively you might consider using CrossAbove() or CrossBelow();
For #2 again you could use the tick difference but this time between perhaps the close of the current bar to one or the other of the EMAs.
You do not need to show the EMAs on the chart.
Please let me know if I can be of further assistance.
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
571 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
331 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
101 views
0 likes
|
Last Post
by Mindset
02-09-2026, 11:44 AM
|
||
|
Started by Geovanny Suaza, 02-02-2026, 12:30 PM
|
0 responses
549 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
549 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment