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
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
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 frankthearm, Today, 09:08 AM
|
7 responses
29 views
0 likes
|
Last Post Today, 01:30 PM | ||
Started by NRITV, Today, 01:15 PM
|
1 response
5 views
0 likes
|
Last Post Today, 01:25 PM | ||
Started by maybeimnotrader, Yesterday, 05:46 PM
|
5 responses
25 views
0 likes
|
Last Post Today, 01:19 PM | ||
Started by quantismo, Yesterday, 05:13 PM
|
2 responses
17 views
0 likes
|
Last Post
by quantismo
Today, 01:07 PM
|
||
Started by adeelshahzad, Today, 03:54 AM
|
5 responses
33 views
0 likes
|
Last Post Today, 11:29 AM |
Comment