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

Code to extend manually drawn rectangles

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

    Code to extend manually drawn rectangles

    Below is the code I'm using to extend manually drawn rectangles to the current bar. I pulled this code out of another indicator that extends rectangles programmatically drawn and that indicator works fine. The code below does not extend, but it does compile. I realize there is no check for user drawn, but I'm not concerned about that. Also, I checked that my rectangles are not locked. Any ideas where I'm going wrong?

    Code:
    protected override void OnBarUpdate()
            {
                if (CurrentBar < 1)
    				return;
    			
                foreach (IRectangle draw in DrawObjects)
    			{
    					IRectangle Extend = (IRectangle) draw;
    					Extend.EndBarsAgo = 0;
                             }

    #2
    Hi coolmoss,

    Thanks for your post.

    Our development department is aware there is a bug as of release 15 that causes this to not work correctly.

    You mention that the indicator is still working.

    Which indicator did get this code from?
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Hi Chelsea,

      Yes, I'm still running release 15. Does 16 resolve this?

      The code is a stripped down version of something in another proprietary indicator of mine. If it would be helpful, let me know how to send it to you via email. I just checked and the original indicator is extending the rectangles correctly.

      Thanks for your help on this.

      Comment


        #4
        Hi coolmoss,

        It has not been corrected in release 16.

        If you can, please send the script to support[at]ninjatrader[dot]com.

        In the body of the email please write Attn: Chelsea #936463. Also include a link to the forum thread.
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          Hi coolmoss,

          I have responded to you via our email, but for anyone else reading this thread, the issue exists with manually drawn objects but not objects that are drawn from a script.
          Chelsea B.NinjaTrader Customer Service

          Comment


            #6
            Is there any timeline on when a fix for working with manually drawn rectangles might be forthcoming?

            Comment


              #7
              Hi coolmoss,

              I cannot give an ETA on when bug fixes or feature requests will be implimented.

              Currently our development team is working hard on completing Ninjatrader 8. However, I do know they are continuing to address bugs in NinjaTrader 7.

              I can, however, update you in this thread when we receive news this bug has been fixed.
              Chelsea B.NinjaTrader Customer Service

              Comment


                #8
                Chelsea,

                Finding a workaround to this would is a priority for me, so, what do you think about trying the following:

                Have the script check for the manually drawn rectangles, create new rectangles programmatically which are identical to the manually drawn rectangles, then have the script extend the programmatically created ones.

                I realize this isn't terribly elegant, but it might work. Based on your knowledge of the current bug/limitation, is this worth trying? Thanks for your help.

                Comment


                  #9
                  Originally posted by coolmoss View Post
                  Chelsea,

                  Finding a workaround to this would is a priority for me, so, what do you think about trying the following:

                  Have the script check for the manually drawn rectangles, create new rectangles programmatically which are identical to the manually drawn rectangles, then have the script extend the programmatically created ones.

                  I realize this isn't terribly elegant, but it might work. Based on your knowledge of the current bug/limitation, is this worth trying? Thanks for your help.
                  I was about to post such an idea... but I'm not about to find out programming it on my own time.

                  Look up NT_Ryan's code for alert for manually drawn lines... in the file section... if you can hack that to extend a line...you will be on to something.

                  Comment


                    #10
                    Thanks Sledge. Unfortunately that is the code I was using, more or less. It appears the issue is specific to rectangles.

                    Comment


                      #11
                      Hey coolmoss,

                      Thats a neat idea.. I'll have to do some testing to see if we can get that to work.

                      I'll let you know what I find.
                      Chelsea B.NinjaTrader Customer Service

                      Comment


                        #12
                        Hi Coolmoss,

                        The issue seems to be the same. While I can get a start bar and end bar and then draw a new rectangle, I cannot remove the manually drawn rectangle with RemoveDrawObject. Again this only is working for objects that are drawn with the script and not drawn manually.
                        Chelsea B.NinjaTrader Customer Service

                        Comment

                        Latest Posts

                        Collapse

                        Topics Statistics Last Post
                        Started by RookieTrader, Today, 09:37 AM
                        1 response
                        10 views
                        0 likes
                        Last Post NinjaTrader_ChelseaB  
                        Started by alifarahani, Today, 09:40 AM
                        0 responses
                        5 views
                        0 likes
                        Last Post alifarahani  
                        Started by Gerik, Today, 09:40 AM
                        0 responses
                        4 views
                        0 likes
                        Last Post Gerik
                        by Gerik
                         
                        Started by KennyK, 05-29-2017, 02:02 AM
                        3 responses
                        1,283 views
                        0 likes
                        Last Post NinjaTrader_Clayton  
                        Started by AttiM, 02-14-2024, 05:20 PM
                        11 responses
                        185 views
                        0 likes
                        Last Post NinjaTrader_ChelseaB  
                        Working...
                        X