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

AddChartIndicator leaves phantom indicator when strategy disabled

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

    AddChartIndicator leaves phantom indicator when strategy disabled

    hi all

    In a strategy I am using AddChartIndicator.
    The indicator that is added uses OnRender to draw stuff on the chart.

    Sometimes (not always), when the strategy disabled, the Indicator is left on the chart as a phantom.
    How do I know this?

    1. The OnRender continues to work so I can see the graphics on the chart
    2. When I go to the Indicator list, these hidden indiactors are in the list (just without the name). I can select them with the mouse and remove them.
    3. Once I remove these phantom indicators from the indicator list, the rendedred objects also disappear from the chart

    I have a log of the machine where this is happening. There are a few rendering related errors in there but not sure its related.

    #2
    Hello onb1,

    Thanks for your post.

    I am testing a simple test strategy that adds an indicator that uses OnRender and I am not able to reproduce the symptoms. Could you let me know anything I specifically must do to reproduce this issue using my test script?

    We will want to use this script so we can rule out indicator rendering errors versus a platform issue. Below is a demo showing my test.

    https://drive.google.com/file/d/1ZNC...w?usp=drivesdk

    If you see issue/errors testing your script but not when testing the test script attached, I suggest looking further into your OnRender code in the indicator and the rendering errors that you are receiving.

    If you have specific questions about some SharpDX error that is received, please extract the specific OnRender code that is showing issue and implement it in a "dummy" script to so it demonstrates the issue in clear terms, and we will be happy to have a look and share our insight.

    We look forward to assisting.
    Attached Files
    JimNinjaTrader Customer Service

    Comment


      #3

      It's true, it happens to me as well as to you, try to do this in OnBarUpdate():
      Code:
      int x = -1;
      while (x = -1)
      {
      }
      and then close this page, the process stills in your process queue taking memory and CPU.

      Comment


        #4
        Hello mbcito,

        This is an infinite loop. An infinite loop will continue to process. Do not make infinite loops.
        JimNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by GussJ, 03-04-2020, 03:11 PM
        11 responses
        3,229 views
        0 likes
        Last Post xiinteractive  
        Started by andrewtrades, Today, 04:57 PM
        1 response
        14 views
        0 likes
        Last Post NinjaTrader_Manfred  
        Started by chbruno, Today, 04:10 PM
        0 responses
        7 views
        0 likes
        Last Post chbruno
        by chbruno
         
        Started by josh18955, 03-25-2023, 11:16 AM
        6 responses
        441 views
        0 likes
        Last Post Delerium  
        Started by FAQtrader, Today, 03:35 PM
        0 responses
        12 views
        0 likes
        Last Post FAQtrader  
        Working...
        X