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 NullPointStrategies, Yesterday, 05:17 AM
            0 responses
            54 views
            0 likes
            Last Post NullPointStrategies  
            Started by argusthome, 03-08-2026, 10:06 AM
            0 responses
            131 views
            0 likes
            Last Post argusthome  
            Started by NabilKhattabi, 03-06-2026, 11:18 AM
            0 responses
            73 views
            0 likes
            Last Post NabilKhattabi  
            Started by Deep42, 03-06-2026, 12:28 AM
            0 responses
            44 views
            0 likes
            Last Post Deep42
            by Deep42
             
            Started by TheRealMorford, 03-05-2026, 06:15 PM
            0 responses
            49 views
            0 likes
            Last Post TheRealMorford  
            Working...
            X