I want to flip a horizontal trendline to a vertical trendline. Baslically change the slope of the trendline from 0 to 90 degrees up or down. Any ideas on how i can do this in ninjascript?
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
flipping trendlines
Collapse
X
-
Hello russ123,
Thank you for your post.
Please answer the following questions so we may be of further assistance.- Are you using DrawHorizontalLine or DrawTrendChannel? - http://ninjatrader.com/support/helpG...t7/drawing.htm
- Is this your own code or a third party's?
- Is this a manually placed Trend Line and if so what drawing object did you use?
-
hello,
I am using the drawlinefunction within ninjascript which basically takes the X1 X2 and the Y1 Y2 coordinates. I am specifying the X1 Y1 and X2 Y2 coordinates to draw a horizontal trendline.
Now I need to create a VERTICAL trendline of the same length. The X1 and X2 coordinates are the same and they are known because I specified them for the horizontal trendline. The Y1 coordinate is also known. The problem is the Y2 coordinate for the vertical trendline. The Y2 coordinate is the distance/length of the horizontal line, which is (X2-X1). How can i get this distance and plot it on the Y axis to create a vertical trendline ?
There maybe another way to do it if there is a method that accepts Slope. If I can specify a slope of 90 degreess for a horizontal trendline, then that line would become a vertical line. I am not sure if there is something like this available ?
thank you,
Rassul
Comment
-
hello Patrick,
I dont think it can be done like this because x2 - x1 will give the number of bars across the x axis,not the actual distance in cm or inches.
for example, If the number of bars is 10 and i substitute this for the Y2 parameter, it will not work because adding 10 to a contract like the yen or the euro will be way too much. Even if i multiply it by the tick size, it will be inaccurate.
The only way to do this is by capturing the distance/length in cm or inches and then using that distance/length to get Y2.
other ideas that come to mind are
1) changing the slope to 90 degrees
2) see if it Is possible to draw a big square instead by just giving the parameters for the length of the square. One side is all you need for a square. Maybe there is a method to do this ?
let me know if you have any more input
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
581 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
338 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
103 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
554 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
552 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment