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 quantismo, Yesterday, 05:13 PM
        2 responses
        15 views
        0 likes
        Last Post quantismo  
        Started by maybeimnotrader, Yesterday, 05:46 PM
        4 responses
        23 views
        0 likes
        Last Post maybeimnotrader  
        Started by frankthearm, Today, 09:08 AM
        6 responses
        25 views
        0 likes
        Last Post frankthearm  
        Started by adeelshahzad, Today, 03:54 AM
        5 responses
        33 views
        0 likes
        Last Post NinjaTrader_BrandonH  
        Started by stafe, 04-15-2024, 08:34 PM
        7 responses
        32 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Working...
        X