Is there a way to draw a dot or color a bar etc. when 2 lines "touched", but don't necessarily cross?
Announcement
Collapse
Looking for a User App or Add-On built by the NinjaTrader community?
Visit NinjaTrader EcoSystem and our free User App Share!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less
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:
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 sofortune, Today, 10:05 AM
|
3 responses
15 views
0 likes
|
Last Post Today, 01:37 PM | ||
Started by ETFVoyageur, 05-07-2024, 07:05 PM
|
23 responses
184 views
0 likes
|
Last Post
by ETFVoyageur
Today, 01:35 PM
|
||
Started by reynoldsn, 05-10-2024, 07:04 PM
|
7 responses
39 views
0 likes
|
Last Post Today, 01:35 PM | ||
Started by ETFVoyageur, Today, 02:15 AM
|
5 responses
31 views
0 likes
|
Last Post Today, 01:06 PM | ||
Started by drnoggin, Today, 12:19 PM
|
1 response
14 views
0 likes
|
Last Post Today, 12:46 PM |
Comment