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

Degrees of angle

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

    Degrees of angle

    Hi is there a way to print the angle of a regression channel?

    #2
    Hello brucelevy,

    Thank you for your note.

    I put together a sample which will draw text in the upper right hand corner of the chart, the angle of the regression line which is drawn by the indicator between 0 and 10 bars ago.

    The method used to calculate the angle was found here.

    Please let us know if you need further assistance.
    Attached Files
    Alan P.NinjaTrader Customer Service

    Comment


      #3
      Dear Alan,
      Thanks for the sample. How could I adjust the code so it only shows the first 3 digits, and not the digits after the decimal point?



      sandman

      Comment


        #4
        Hello sandman,

        You could use the following,

        string AngleString= GetAngle(StartBarsAgo, Close[StartBarsAgo], EndBarsAgo, Close[EndBarsAgo]).ToString("n0");

        Please let us know if you need further assistance.
        Alan P.NinjaTrader Customer Service

        Comment


          #5
          Angle tool

          Hi - is there a tool to draw lines at a certain angle e.g. 45 degrees?

          I tried the Ray Tool but it doesn't appear to have the option to specify the angle. Any ideas/ suggestions are welcome. Thanks

          Comment


            #6
            Hello zoetuck,

            I am not aware of an existing tool that does this specifically.

            You could of course create this yourself. The method that Alan used the calculate an angle would be a great place to start in that regard.
            Josh G.NinjaTrader Customer Service

            Comment


              #7
              Alan.

              I have tried several times to import your sample indicator (DrawRegressionChannelWithAngle...) but each time I am getting an error message. I am using NT7.0.1000.39
              Help please.

              sandman
              Attached Files

              Comment


                #8
                Hello sandman,

                It appears this thread is in the wrong sub forum, I will move this to the correct location I am sorry for the inconvenience.

                The file you are trying to import is for NT8 so this would not work with NT7.


                I look forward to being of further assistance.
                JesseNinjaTrader Customer Service

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by CortexZenUSA, Today, 12:53 AM
                0 responses
                1 view
                0 likes
                Last Post CortexZenUSA  
                Started by CortexZenUSA, Today, 12:46 AM
                0 responses
                1 view
                0 likes
                Last Post CortexZenUSA  
                Started by usazencortex, Today, 12:43 AM
                0 responses
                5 views
                0 likes
                Last Post usazencortex  
                Started by sidlercom80, 10-28-2023, 08:49 AM
                168 responses
                2,266 views
                0 likes
                Last Post sidlercom80  
                Started by Barry Milan, Yesterday, 10:35 PM
                3 responses
                13 views
                0 likes
                Last Post NinjaTrader_Manfred  
                Working...
                X