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!
See more
See less

Partner 728x90

Collapse

Draw a line at a 45 degree angle...

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    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.

    #2
    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

    Comment


      #3
      Originally posted by funk101 View Post
      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.
      Angles 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.

      You are coming 30 years late.

      Comment


        #4
        Ha, what a crazy response! How bold of you to assume my intentions.
        Best of luck trading, Harry.

        Comment


          #5
          Originally posted by funk101 View Post
          Ha, what a crazy response! How bold of you to assume my intentions.
          Best of luck trading, Harry.
          I have seen too many indicators based on angles, and none of them worked correctly. Scalability and angles do not go together. Also angles do not pass the consistency test (C-Test) as suggested by trader and mathematician William Eckhardt.

          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


            #6
            Yes 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.

            Comment


              #7
              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


                #8
                Originally posted by funk101 View Post
                Yes 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.
                If I may poke my nose in here. Actually Harry did give you a technical response. He just also added a humorous comment, with which it appears that you take umbrage. His response is pretty much driven by the same reasons that we gave in this thread. ref: http://www.ninjatrader.com/support/f...22460#poststop.

                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


                  #9
                  Well I'll leave you guys to it.
                  Thanks.
                  Peace.

                  Comment


                    #10
                    Originally posted by funk101 View Post
                    Well 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


                      #11
                      Originally posted by koganam View Post
                      If I
                      Originally posted by Harry View Post
                      Angles 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 Post
                      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.
                      So how does something like http://www.integrity-traders.com/ind..._category_id/9 work?

                      Comment


                        #12
                        Originally posted by MarsOptimus View Post
                        I dunno...no access..

                        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


                          #13
                          Originally posted by MarsOptimus View Post
                          No access to that to which you point. If you want information about such, try sending a PM to eDanny.

                          Comment

                          Latest Posts

                          Collapse

                          Topics Statistics Last Post
                          Started by quantismo, Yesterday, 05:13 PM
                          1 response
                          12 views
                          0 likes
                          Last Post NinjaTrader_Gaby  
                          Started by The_Sec, 04-16-2024, 02:29 PM
                          3 responses
                          16 views
                          0 likes
                          Last Post NinjaTrader_ChristopherS  
                          Started by hurleydood, 09-12-2019, 10:45 AM
                          15 responses
                          1,098 views
                          0 likes
                          Last Post Leeroy_Jenkins  
                          Started by danieldunn2024, Today, 03:06 AM
                          1 response
                          5 views
                          0 likes
                          Last Post NinjaTrader_Erick  
                          Started by cre8able, Yesterday, 04:16 PM
                          1 response
                          16 views
                          0 likes
                          Last Post NinjaTrader_Gaby  
                          Working...
                          X