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
Extend Line to right
Collapse
X
-
Hello nandhumca,
Thank you for your note.
You would need to call Draw.Line again if your condition is true using the same tag name and extend the line out using a negative number of bars for the BarsAgo end value.
I'm attaching a very simple indicator that demonstrates this - if the Extend line box is checked the line will extend 100 bars into the future from the current bar and 10 bars back. If not it will simply be drawn over the last 10 bars.
If the line isn't a straight horizontal line, you'll need to calculate where the Y value would be before extending the line. Please see the example script, YAxisProjectionOfLine, created by my colleague Paul in post #6 of this forum thread: https://ninjatrader.com/support/forum/forum/ninjatrader-8/add-on-development/107312-price-crossing-a-line#post828663
Please let us know if we may be of further assistance to you.
Attached FilesKate W.NinjaTrader Customer Service
-
Hello nandhumca,
Thank you for your reply.
For that you would need to look at the example script, YAxisProjectionOfLine that I linked in my initial reply to get the y value that would be at the desired extension of the bar and use that for the end Y position when drawing the extended version.
Please let us know if we may be of further assistance to you.Kate W.NinjaTrader Customer Service
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by puapwr, Today, 06:09 PM
|
0 responses
2 views
0 likes
|
Last Post
by puapwr
Today, 06:09 PM
|
||
Started by franciscog21, Today, 05:27 PM
|
0 responses
5 views
0 likes
|
Last Post
by franciscog21
Today, 05:27 PM
|
||
Started by hdge4u, 04-29-2024, 12:23 PM
|
5 responses
28 views
0 likes
|
Last Post
by MisterTee
Today, 04:26 PM
|
||
Started by llanqui, 01-25-2024, 06:15 PM
|
9 responses
64 views
0 likes
|
Last Post
by MisterTee
Today, 04:24 PM
|
||
Started by tradingnasdaqprueba, 05-07-2024, 03:42 AM
|
16 responses
67 views
0 likes
|
Last Post Today, 04:10 PM |
Comment