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

DrawLine( ) disappears with chart scroll

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

    DrawLine( ) disappears with chart scroll

    I have a custom-coded indicator that plots lines using the DrawLine() function between two user-specified DateTime values.


    Depending on how I scroll and resize the chart, the lines will disappear and reappear for no apparent reason.


    Currently, the user-specified range is 10/10/13 16:00:00 to 10/14/13 15:00:00.
    If the entire timeframe is visible on the chart, the lines show up.
    If I zoom in on the time scale and scroll left and right, the lines will disappear at various times.


    Could this have something to do with the weekend, or is there another explanation?

    Autoscale? Issue with right time limit extending to a future time?

    If this is too ambiguous, just let me know and I'll clarify.

    Thanks all.


    I'm concerned this would cause a problem with order entry/exit should I decide to

    use this indicator in a strategy in which I might use line crosses to key events (even though I would probably use the value itself). Plus it's just annoying.

    #2
    Hello leestockz,

    Thank you for your post.

    Is the End Y value plotted in the future? If both Y values are in view on your chart, is the line then visible? If one Y value is out of view does the live disappear?

    If possible can you provide a screenshot of this event on the chart?

    I look forward to your response.

    Comment


      #3
      Patrick,

      Yes, the end Y value is plotted in the future. (See previous post for exact times
      Yes, when both Y values are visible on the chart, the lines are visible too.
      No, when one Y value is present, the lines don't always disappear.

      See screenshots.

      Click image for larger version

Name:	1.png
Views:	1
Size:	88.7 KB
ID:	869270

      Click image for larger version

Name:	2.png
Views:	1
Size:	81.4 KB
ID:	869271

      Click image for larger version

Name:	3.png
Views:	1
Size:	81.6 KB
ID:	869272

      Click image for larger version

Name:	4.png
Views:	1
Size:	77.0 KB
ID:	869273

      Click image for larger version

Name:	5.png
Views:	1
Size:	86.2 KB
ID:	869274)

      Comment


        #4
        Hello leestockz,

        Thank you for your response.

        So this occurs when scrolling back on the chart. For each line what is the start Y value? Does this only occur if you scroll back further the the view of the start Y value?

        Do you see an error message listed in the Log tab of the NinjaTrader Control Center when this occurs?

        I look forward to your response.

        Comment


          #5
          For each line what is the start Y value?
          The times below represent the starting Y values of each line.

          Code:
          Swing High 0: 1.59779 at 10/10/2013 5:35:00 PM
          Swing High 1: 1.59767 at 10/10/2013 6:45:00 PM
          Swing High 2: 1.59775 at 10/10/2013 8:20:00 PM
          Swing High 3: 1.59848 at 10/10/2013 9:30:00 PM
          Swing High 4: 1.59846 at 10/10/2013 10:40:00 PM
          Swing High 5: 1.59841 at 10/10/2013 11:45:00 PM
          Swing High 6: 1.59924 at 10/11/2013 12:55:00 AM
          Swing High 7: 1.59913 at 10/11/2013 1:50:00 AM
          Swing High 8: 1.60012 at 10/11/2013 3:05:00 AM
          Swing High 9: 1.59915 at 10/11/2013 4:50:00 AM
          Swing High 10: 1.59769 at 10/11/2013 6:05:00 AM
          Swing High 11: 1.59754 at 10/11/2013 6:40:00 AM
          Swing High 12: 1.59786 at 10/11/2013 7:20:00 AM
          Swing High 13: 1.59702 at 10/11/2013 8:15:00 AM
          Swing High 14: 1.59587 at 10/11/2013 10:20:00 AM
          Swing High 15: 1.59366 at 10/11/2013 12:00:00 PM
          Swing High 16: 1.59606 at 10/11/2013 2:10:00 PM
          Swing High 17: 1.59587 at 10/11/2013 3:10:00 PM
          Swing High 18: 1.59668 at 10/13/2013 5:55:00 PM
          Swing High 19: 1.59676 at 10/13/2013 6:25:00 PM
          Swing High 20: 1.59684 at 10/13/2013 7:20:00 PM
          Swing High 21: 1.59674 at 10/13/2013 8:05:00 PM
          Does this only occur if you scroll back further the the view of the start Y value?
          No. See attached images, paying attention to the rightmost bar.

          Do you see an error message listed in the Log tab of the NinjaTrader Control Center when this occurs?
          No, there is no error in the log.

          Click image for larger version

Name:	6.png
Views:	1
Size:	73.8 KB
ID:	869275

          Click image for larger version

Name:	7.png
Views:	1
Size:	73.6 KB
ID:	869276

          Comment


            #6
            Hello leestockz,

            Thank you for your response.

            May I test your code or a sample that produces the same behavior?

            If you prefer your can send this code to support[at]ninjatrader[dot]com with 'ATTN: Patrick - 934792' in the subject line. Please reference this thread in the body of the e-mail: http://www.ninjatrader.com/support/f...ad.php?t=61369

            Comment


              #7
              Hi all,

              I have run in to the same issue. I believed I had narrowed it down to the end time when defined as a DateTime object but I have managed to break it using bar count as well. Is there a known bug here?

              Could be connected to using Time[0] when referring to end time?

              Thanks,
              darmbk.
              Last edited by darmbk; 04-01-2014, 07:55 AM.

              Comment


                #8
                Hello darmbk,

                Thank you for your post.

                Do you have any of the end or start Ys outside of the viewable range on your chart? Can you provide the code used here to produce this issue?

                Comment


                  #9
                  Hi Patrick,

                  I have resolved the issue. Using DateTime.Now when defining the end time seemed to be causing it. I reverted to Time[0] which works fine.

                  Cheers,
                  darmbk.

                  Comment


                    #10
                    Hi

                    I have also similar issues with drawline function where my lines will disappear some times on different PCs. My end Y is also in the future

                    Just wander if there is a solution for this already? Is changing to Time[0] the only sotution?

                    Thanks

                    Comment


                      #11
                      Hello ystan79,

                      Thank you for your inquiry.

                      Can you please provide the code you are using for your DrawLine() so I may test on my end?

                      I look forward to assisting you further.
                      Zachary G.NinjaTrader Customer Service

                      Comment

                      Latest Posts

                      Collapse

                      Topics Statistics Last Post
                      Started by bortz, 11-06-2023, 08:04 AM
                      47 responses
                      1,606 views
                      0 likes
                      Last Post aligator  
                      Started by jaybedreamin, Today, 05:56 PM
                      0 responses
                      9 views
                      0 likes
                      Last Post jaybedreamin  
                      Started by DJ888, 04-16-2024, 06:09 PM
                      6 responses
                      19 views
                      0 likes
                      Last Post DJ888
                      by DJ888
                       
                      Started by Jon17, Today, 04:33 PM
                      0 responses
                      6 views
                      0 likes
                      Last Post Jon17
                      by Jon17
                       
                      Started by Javierw.ok, Today, 04:12 PM
                      0 responses
                      15 views
                      0 likes
                      Last Post Javierw.ok  
                      Working...
                      X