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
Draw a line at a 45 degree angle...
Collapse
X
-
Draw a line at a 45 degree angle...
Looking for help in drawing a line at a 45 degree angle given just a starting point. eg: Low[x] then just calculate the 45 degree angle to, eg: CanvasRight for example. I realize this is probably "unsupported", any help from the C# programmers would be greatly appreciated.Tags: None
-
Hello funk101,
Basically, you would to start out by using some Geometry to be able to calculate 2nd Point from the point you would like to start at given and the desired angle.
Here is a good thread that talks about how this can be accomplished that you may view.
MFC project using Visual C++ 6.0 I'm looking for a function that has the ability to draw a line knowing only the starting X,Y (0,0) pixel coordinates, Radian or degree angle, length in pixels of line. EXAMPLE: void Drawline(int Xstartpoint, int Ystartpoint, float Radians, int Linelength); I have a designed a program with various x,y coordinates that baseline from their individual 0,0 reference. Knowing only the X,Y float values and the starting 0,0 point, I can
One of the things that you may have to modify is the"x" value might get too large so you can either use a DateTime variable or you may override the plot method to manually draw this on the chart.
For an example of how to override the plot method you may see a reference under Tools -> Edit NinjaScript -> Indicators -> CustomPlotSample.
JCNinjaTrader Customer Service
-
Originally posted by funk101 View PostLooking for help in drawing a line at a 45 degree angle given just a starting point. eg: Low[x] then just calculate the 45 degree angle to, eg: CanvasRight for example. I realize this is probably "unsupported", any help from the C# programmers would be greatly appreciated.
With modern charting software that allows you to change (or autoscale) the x-axis and y-axis, the concept of an angle as a substitute for momentum is useless.
You are coming 30 years late.
Comment
-
Originally posted by funk101 View PostHa, what a crazy response! How bold of you to assume my intentions.
Best of luck trading, Harry.
Of course I do not know, what you are going to do with the angles.Maybe you just wanted to embellish your chart ?
Angles are sort of a red flag which I cannot ignore. This explains my funnny response. Drawing lines from a starting point would usually require some normalization, that is dividing the vertical distance by the average true range or standard deviation of the bars shown on the chart.Last edited by Harry; 08-11-2013, 01:49 AM.
Comment
-
You need to replace "angle" with "rise over run", then define what is a unit of "rise" (for example a multiple of the average true range, a tick or a point) and what is the unit of "run" (1 bar or a time interval). Once the units for "rise" and "run" have been defined, you can introduce a concept of an artificial slope. An angle of 45 degrees would be represented by a number units of "rise" over an equal amount of units of "run".
The concept of rise-over-run is explained here:
Again on scalable charts there are no real invariant angles.
Comment
-
Originally posted by funk101 View PostYes my friend, a purely technical response would've been nice. However, if I need an *opinion* on some issue in the future I will be sure and seek you out.
Cheers.
The real point here is that angles really are meaningless on quantified scales, but at a time when charts were being drawn by hand on graph paper, they made a convenient shortcut to determining rise/run, and as charts were generally drawn to the same convenient scale, that made angles a viable quick visualization tool. On today's charts, that are often autoscaled by the computer, you no longer have fixed axes, so an angle drawn, while putatively remaining at the same visual slope, no longer represents that same rise/run ratio after the chart scale may have been changed by the software. Conversely, the same rise/run ratio may easily be shown at different visual angles as the chart axes change. The conclusion here then is that, on modern computerized charts, the visual angle is often not representative of the real world price/chart action, and may actually be misleading.
Comment
-
Originally posted by funk101 View PostWell I'll leave you guys to it.
Thanks.
Peace.
This only chance of this working is on a logarithmic chart with margin type on price.
This would not work on a linear chart, as any adjustment of the scale by NT or you makes it no where near a 45 degree angle anymore.
Comment
-
Originally posted by koganam View PostIf IOriginally posted by Harry View PostAngles are just a proxy for momentum. The concept of angles was useful when charts were printed on paper without ever changing the scales.
With modern charting software that allows you to change (or autoscale) the x-axis and y-axis, the concept of an angle as a substitute for momentum is useless.
.Originally posted by sledge View PostThis only chance of this working is on a logarithmic chart with margin type on price.
This would not work on a linear chart, as any adjustment of the scale by NT or you makes it no where near a 45 degree angle anymore.
Comment
-
Originally posted by MarsOptimus View PostSo how does something like http://www.integrity-traders.com/ind..._category_id/9 work?
Home
Please login first
User Name
Password
Remember me
Log in
Forgot your password?
Forgot your username?
Don't have an account?
edit:
Where are the indicators??
The indicators are in the Indicator Store (now including the free indicators) which is only accessable to registered users. You can register here or at the 'Login' tab at the top of the page.
Once registered and logged in, you will see the Indicators Store listed here under the Indicators menu or in the menu at the top of this page.
Comment
-
Originally posted by MarsOptimus View PostSo how does something like http://www.integrity-traders.com/ind..._category_id/9 work?
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by foxtrott21, Today, 08:27 AM
|
0 responses
1 view
0 likes
|
Last Post
by foxtrott21
Today, 08:27 AM
|
||
Started by jaypelle3, Today, 08:26 AM
|
0 responses
1 view
0 likes
|
Last Post
by jaypelle3
Today, 08:26 AM
|
||
Started by linkcou, Today, 07:01 AM
|
2 responses
18 views
0 likes
|
Last Post
by bltdavid
Today, 08:25 AM
|
||
Started by jaypelle3, Today, 08:25 AM
|
0 responses
1 view
0 likes
|
Last Post
by jaypelle3
Today, 08:25 AM
|
||
Started by jaypelle3, Today, 08:22 AM
|
0 responses
2 views
0 likes
|
Last Post
by jaypelle3
Today, 08:22 AM
|
Comment