Is there a way to draw a dot or color a bar etc. when 2 lines "touched", but don't necessarily cross?
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
lines touching
Collapse
X
-
lines touching
Hello,
Is there a way to draw a dot or color a bar etc. when 2 lines "touched", but don't necessarily cross?Tags: None
-
-
Ryan,
The explanation seemed easy enough, but I'm still a rookie. This is what I coded and I'm not getting anything.
if ((ADX(10)[0]) == DM(10).DiPlus[0])
{
DrawDiamond("Lines Touch" + CurrentBar, true, 0, Low[0] - 2, Color.Blue);
}
Any suggestions?
Comment
-
Your code example looks good. Are there any occurrences on your chart where these exactly equal each other? You can pull up a data box (Ctrl + D) to confirm. You can also custom code a little give on each side if you want check if they're near each other but not exactly equal.Ryan M.NinjaTrader Customer Service
Comment
-
That data box is really cool. I didn't know it existed. I see that during the individual bars the ADX and the DiPlus are never really the same. Certainly they cross, but the concluding numerical values are different. Can you give me an example of that custom code you were referring to when you said, " You can also custom code a little give on each side if you want check if they're near each other but not exactly equal." Thanks
Comment
-
Instead of:
Add tolerance via a tick size nudge factor. You can decide what exactly you want to use as the nudge factor yourself:Code:if ((ADX(10)[0]) == DM(10).DiPlus[0])
Code:if (ADX(10)[0] >= (DM(10).DiPlus[0] - 1 * TickSize) && ADX(10)[0] <= (DM(10).DiPlus[0] + 1 * TickSize))
Josh P.NinjaTrader Customer Service
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
576 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
334 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
553 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
551 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment