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 bc24fl, 08-30-2019, 01:58 PM
|
3 responses
253 views
0 likes
|
Last Post
by PaulMohn
Today, 03:04 AM
|
||
Started by tradingnasdaqprueba, 04-09-2024, 09:52 AM
|
6 responses
26 views
0 likes
|
Last Post Today, 02:15 AM | ||
Started by PaulMohn, Today, 02:06 AM
|
1 response
3 views
0 likes
|
Last Post
by PaulMohn
Today, 02:12 AM
|
||
Started by Mindset, Today, 01:27 AM
|
0 responses
5 views
0 likes
|
Last Post
by Mindset
Today, 01:27 AM
|
||
Started by EB Worx, 03-07-2023, 05:05 AM
|
4 responses
99 views
1 like
|
Last Post
by cls71
Today, 01:17 AM
|
Comment