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 Barry Milan, Today, 10:35 PM
        2 responses
        9 views
        0 likes
        Last Post Barry Milan  
        Started by WeyldFalcon, 12-10-2020, 06:48 PM
        14 responses
        1,428 views
        0 likes
        Last Post Handclap0241  
        Started by DJ888, Yesterday, 06:09 PM
        2 responses
        9 views
        0 likes
        Last Post DJ888
        by DJ888
         
        Started by jeronymite, 04-12-2024, 04:26 PM
        3 responses
        41 views
        0 likes
        Last Post jeronymite  
        Started by bill2023, Today, 08:51 AM
        2 responses
        16 views
        0 likes
        Last Post bill2023  
        Working...
        X