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 Barry Milan, Yesterday, 10:35 PM
                5 responses
                16 views
                0 likes
                Last Post NinjaTrader_Manfred  
                Started by DanielSanMartin, Yesterday, 02:37 PM
                2 responses
                13 views
                0 likes
                Last Post DanielSanMartin  
                Started by DJ888, 04-16-2024, 06:09 PM
                4 responses
                12 views
                0 likes
                Last Post DJ888
                by DJ888
                 
                Started by terofs, Today, 04:18 PM
                0 responses
                11 views
                0 likes
                Last Post terofs
                by terofs
                 
                Started by nandhumca, Today, 03:41 PM
                0 responses
                8 views
                0 likes
                Last Post nandhumca  
                Working...
                X