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

Bug (?) - draw objects partially persist from one instrument chart to another

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

    Bug (?) - draw objects partially persist from one instrument chart to another

    Hello,

    I came across a strange behavior of a horizontal line which seems to persist from one instrument chart to another.

    Steps to reproduce:
    1) load a chart and load an instrument, e.g. EURJPY
    2) add an indicator so that you can go into VS break mode easily (I suggest using the GomLabelHorizLines indicator from this forum, as it will also display the price label from the first instrument on the chart of the next instrument)
    3) create a horizontal line, name the tag e.g. "Entry" and remember the price level the line is at
    4) within the same chart tab, load another instrument, e.g. USDJPY
    5) if you added the GomLabelHorizLines indicator, you can already see that, although the line itself is removed from the chart, the label of the Enter horizontal line from the previous instrument is still there at the price level you set it at in step 3 above
    6) Add a new horizontal line and set its tag to "Enter", making sure it is at a different price level than the horizontal line from the previous instrument
    7) go into break mode in Visual Studio anywhere in the OnBarUpdate of any indicator
    8) check the price level of the Enter horizontal line is not at the value where the line actually lies, but at the value of the line you had created for the previous instrument.

    In the drawing objects collection (in both the UI dialog box and memory when checking in VS), there is only one "Enter" horizontal line, but it has the wrong price associated with it.

    When I select Remove all drawing objects in the UI, the phantom line does not get removed when in the second instrument, but I have to reload the instrument the original Enter horizontal line was created in and remove it there.

    This is actually a major roadblock for me, so I would be grateful if you could confirm this is a bug and provide me with some workaround or even better with information when this can be fixed.

    I am using Ninja Trader 8.0.6.0 64-bit (Standard) for Interactive Brokers.

    Many thanks,

    Libor

    EDIT: Although the behavior described above is still there, I found a different approach to achieving my goal so this bug is no more a major problem for me.
    Last edited by liborc; 04-20-2017, 01:31 AM.

    #2
    Hello Libor,

    I have tested this matter and I have observed that I do not need to change the tag to make the label persist on the chart window.

    After review, I do not think this is a bug with NinjaTrader, but rather an issue where the indicator. I observe that it draws things directly on the chart in OnRender() and does not check if the chart has changed instruments and does not have a way to invalidate the RenderTarget.DrawText() and RenderTarget.FillRectangle() calls it previously creates.

    If you would like us to investigate an issue with a potential bug, we would best be able to diagnose this with a indicator that we bundle with NinjaTrader. As the GomLabelHorizLines is developed by a member on our forums, and not us directly, we cannot use this as a tool to diagnose a bug.

    If you are able to reproduce a similar issue with a bundled indicator, please let me know so we may investigate further.
    Last edited by NinjaTrader_Jim; 04-20-2017, 03:35 PM.
    JimNinjaTrader Customer Service

    Comment


      #3
      Hello,

      I believe it actually is a NT bug. Like I said, this is not about the label persisting, but rather the price value itself. I have tested this without any indicator and saw the same problem: the price on an identically named horizontal line persisted after instrument change. I mentioned GomLabelHorizLines only because it was a good way to show you visually what I meant because the label drawn by it stayed there. If you try this by replicating the steps I layed out in my original post, you will be able to see the price value at an incorrect level if you go to break mode in VS.

      I tried deleting the line and readding it, but the price level still persisted. Only removing all draw objects resets it.

      As a side note - this only happens with manually drawn lines, those drawn by an indicator work fine.

      As I mentioned, this is no more a roadblock for me, as I worked around this by only using indicator drawn lines.

      Thank you,

      Libor
      Last edited by liborc; 04-21-2017, 02:58 AM.

      Comment


        #4
        Hello liborc,

        I have looked at this matter again.

        Unfortunately, I am unable to reproduce said issue to observe problematic behavior. Additionally, we will be hard pressed to submit an bug report when it involves using tools outside of the NinjaScript editor.

        When we are observing the behavior while inside a breakpoint, we will have a hard time determining what is expect as we are stopping the execution and looking at processes before they finish. This creates a lot of gray area around the issue in which a matter could be expected.

        If you are able to reproduce this issue without debugging with Visual Studio, please let me know and we will be able to look into this matter further.
        JimNinjaTrader Customer Service

        Comment


          #5
          Hello,

          Fine by me.
          Like I said, I worked around it and hence this is not a problem for me anymore.

          I just wanted to report this bug to help NinjaTrader. The VS breakpoint was only to make it easier to demonstrate, but the behavior is there even in vanilla NT8 (I reinstalled just to make sure) and when using no third party indicators.

          Thanks,

          Libor

          Comment


            #6
            Hi,

            if, by any chance, you do want to investigate this, this is the simplest way to reproduce the behavior, and it does not include any external tools or third party indicators.

            1) create a blank indicator
            2) into the OnBarUpdate, add the following code:
            if (DrawObjects["TestLine"] != null)
            {
            Print(DrawObjects["TestLine"].Anchors.First().Price.ToString());
            } else Print("No line named TestLine found");
            3) save, compile, and load the indicator you created on any instrument
            4) manually add a horizontal line with its tag set to "TestLine"
            5) place the horizontal line you created to any price level
            6) reload the indicator by pressing F5
            7) inside the same chart window, switch to another instrument by selecting it in the Instrument Picker widget
            8) manually create a horizontal line, set its tag to "TestLine" and move it to a different price level than you did on the previous instrument
            9) press f5 to reload the indicator

            you see that in the Output 1, the wrong price (=the one from the previous instrument) is still being printed.

            It clearly is a bug in NinjaTrader, so in case you deem it worth fixing, let the NT Product Dev team know.

            Thanks,

            Libor

            Comment


              #7
              Hello liborc,

              Sorry for the delay.

              I have submitted your inquiry to the development team and it is now being tracked as a bug with the ticket ID NTEIGHT-11629.

              When a fix is implemented, you can reference this ticket number in the Release Notes of the version of NinjaTrader 8 that includes this bug fix.

              Release Notes can be found here: https://ninjatrader.com/support/help...ease_notes.htm

              Thanks for taking the time to help us improve NinjaTrader.
              JimNinjaTrader Customer Service

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by timmbbo, Today, 08:59 AM
              1 response
              2 views
              0 likes
              Last Post NinjaTrader_ChelseaB  
              Started by KennyK, 05-29-2017, 02:02 AM
              2 responses
              1,281 views
              0 likes
              Last Post marcus2300  
              Started by fernandobr, Today, 09:11 AM
              0 responses
              3 views
              0 likes
              Last Post fernandobr  
              Started by itrader46, Today, 09:04 AM
              1 response
              6 views
              0 likes
              Last Post NinjaTrader_Clayton  
              Started by bmartz, 03-12-2024, 06:12 AM
              5 responses
              33 views
              0 likes
              Last Post NinjaTrader_Zachary  
              Working...
              X