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

Horizontal Ray is drawn vertically. Why?

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

    Horizontal Ray is drawn vertically. Why?

    Hello! I have some strange problem with NT7 DrawRay() method. Somewhere it works fine, somewhere turns a Ray supposed to be horizontal vertically. The code is the same everywhere:
    Code:
    DrawRay("highRay" + highBar, false,
                    CurrentBar - highBar, highValue, 0, highValue,
                    trendHighColor, rayStyle, rayWidth);
    So on the same chart I have horizontal Rays and vertical Rays drawn with the same code. Debugger shows that all the variables have proper values in any case.

    Can it be some well known issue, which I don't know?
    Attached Files

    #2
    What are you setting your field highValue to before you draw it?

    Comment


      #3
      It's set to Open or Close of the anchor bar. Look at the picture: the beginnings of vertical rays are started properly. So the endings should be drawn at the same level.
      Last edited by quicktrick; 10-14-2015, 10:04 AM.

      Comment


        #4
        Hello quicktrick,

        Thank you for your patience.

        What calculates highBar? Could this ever return 0?

        Comment


          #5
          Hello, Patrick!

          highBar is the zero based anchor1 bar number. The starting point of every vertical ray is drawn properly.

          Comment


            #6
            Originally posted by NinjaTrader_PatrickH View Post
            Hello quicktrick,
            Thank you for your patience.
            What calculates highBar? Could this ever return 0?
            Patrick, please, have a look at the attached code. It's some early test version of the indicator I'm developing. Now it's rewritten completely, but the problem is the same. The old version gives some vertical rays too. I got the source code from some indicator found on BMT forums. I can't find where the problem is. I'd be very grateful if you can help me.
            Last edited by NinjaTrader_PatrickH; 10-14-2015, 12:47 PM.

            Comment


              #7
              Hello quicktrick,

              Thank you for your response.

              I would ask the developer Edge on the forum you downloaded that from. Also, to respect the details in that file I am removing it from your post as it is requested in the file that it not be distributed outside of said forum.

              Comment


                #8
                Patrick,

                Do you mean the problem is in the code I posted? I can't find the problem there. And while debugging in Visual Studio the debugger shows proper values of the parameters being sent to DrawRay() method. I'm afraid the problem is in DrawRay() itself.

                Comment


                  #9
                  Hello quicktrick,

                  Would you mind sending over the full package you are working with here to platformsupport[at]ninjatrader[dot]com?
                  Make sure to reference this thread: "http://ninjatrader.com/support/forum/showthread.php?t=79210"

                  Keep in mind we don not provide debugging services. While we can look into the case further it is unlikely a problem with the DrawRay() method.

                  I look forward to assisting you further.

                  Comment


                    #10
                    Hello Patrick,

                    I made a simplified version of my indicator and sent it to platform support two days ago. But I didn't get any reply or notification if they received it. The DrawRay() problem is serious for me as it delays my work and I don't see any errors in my own code. Is there any hope for the solution?

                    Comment


                      #11
                      Hello quicktrick,

                      Can you send it over again? This time list 'ATTN: Patrick H' in the subject.

                      Comment


                        #12
                        Hello Patrick,

                        I resent my email to you a few days ago, but there was no reply again.

                        BTW, I've transferred my code to NT8, and there is no bug with Draw.Ray() in NT8 on the contrary to NT7.

                        Comment


                          #13
                          Hello quicktrick,

                          Thank you, I will send you a private message to see if we can grab the code in another way.

                          Comment


                            #14
                            Patrick,
                            I found the problem. It was coming from some misconception. I thought that to draw a horizontal ray it's sufficient to set 'Anchor1Y' and 'Anchor2Y' to the same value. Turns out that besides that 'Anchor1BarsAgo' and 'Anchor2BarsAgo' must not be set to the same value. In NT8 the requirements are the same, except in that case it doesn't draw a ray at all. It would be nice if you add that information to the manuals.
                            Last edited by quicktrick; 11-02-2015, 02:42 AM.

                            Comment


                              #15
                              Hello quicktrick,

                              Thank you for your update.

                              I will forward this information to Product Management.

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by cmtjoancolmenero, Yesterday, 03:58 PM
                              12 responses
                              42 views
                              0 likes
                              Last Post NinjaTrader_ChelseaB  
                              Started by FrazMann, Today, 11:21 AM
                              0 responses
                              5 views
                              0 likes
                              Last Post FrazMann  
                              Started by geddyisodin, Yesterday, 05:20 AM
                              8 responses
                              52 views
                              0 likes
                              Last Post NinjaTrader_Gaby  
                              Started by DayTradingDEMON, Today, 09:28 AM
                              4 responses
                              27 views
                              0 likes
                              Last Post DayTradingDEMON  
                              Started by George21, Today, 10:07 AM
                              1 response
                              22 views
                              0 likes
                              Last Post NinjaTrader_ChristopherJ  
                              Working...
                              X