Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Diposing of items added using Addchartindicator

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

    Diposing of items added using Addchartindicator

    Ok. My problem I have is that once I use the below in my strategy to add the indicator to the chart I notice if I reload ninjasript or replay the market play back I get multiple instances of the indicator. That would mean that when I reload the strategy the items are not cleared. If I remove the strategy from the chart, those indicators added still remain which means I am not disposing of them correctly. How should I be removing the indicators that are added via the below method so they are removed from the chart when the terminate is call. setting them to null doesn't work in this case as I have that.


    private APASTC APAS; // Declare indicator

    else if (State == State.DataLoaded)
    {

    APAS=APASTC(); // Add
    AddChartIndicator(APAS);

    }

    else if (State == State.Terminated)
    {
    APAS=null;
    }

    #2
    Hello richa61416,

    When a strategy is disabled, indicators added with AddChartIndicator() are automatically removed. There is no cleanup method as this is automatic.

    If you open a new chart with template and no indicators applied, and then add and enable the SampleMACrossOver (which adds two instances of the SMA), are you able to reproduce this behavior?
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      OK. I started market data replay with the strategy. I left it play (as in to start running), then i rigth click on playback and used goto and played to 5.39 (what ever time it had reach from the time i started it running). It started back from the beginning and created another instance of the indicators at the top. For every time i did goto and played it back it created a new set on the chart. also if you go into indicators on the chart you cannot remove any of them as they say they are associated with the strategy.
      Attached Files
      Last edited by richa61416; 02-18-2019, 03:58 AM.

      Comment


        #4
        Hello richa61416,

        I was able to reproduce this behavior when using the GoTo with the Playback Controller and I have reported the behavior to our development.

        Once I have a tracking ID for this behavior I will post in this thread.

        Thank you for reporting the behavior.
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          Ok. Thanks.

          Comment


            #6
            Hello richa61416,

            I've received tracking ID# NTEIGHT-13571 for this behavior where indicators added by strategies are duplicated and orphaned.

            As new releases of NinjaTrader 8 become available, please check the release notes for this ID. Once the ID is listed, please update and test to confirm the behavior is corrected.

            Chelsea B.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by CarlTrading, 03-31-2026, 09:41 PM
            1 response
            43 views
            0 likes
            Last Post NinjaTrader_ChelseaB  
            Started by CarlTrading, 04-01-2026, 02:41 AM
            0 responses
            20 views
            0 likes
            Last Post CarlTrading  
            Started by CaptainJack, 03-31-2026, 11:44 PM
            0 responses
            29 views
            1 like
            Last Post CaptainJack  
            Started by CarlTrading, 03-30-2026, 11:51 AM
            0 responses
            46 views
            0 likes
            Last Post CarlTrading  
            Started by CarlTrading, 03-30-2026, 11:48 AM
            0 responses
            38 views
            0 likes
            Last Post CarlTrading  
            Working...
            X