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

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 suroot, 04-10-2017, 02:18 AM
            4 responses
            3,021 views
            0 likes
            Last Post truepenny  
            Started by Stanfillirenfro, Today, 07:23 AM
            1 response
            6 views
            0 likes
            Last Post NinjaTrader_Gaby  
            Started by cmtjoancolmenero, Yesterday, 03:58 PM
            2 responses
            22 views
            0 likes
            Last Post cmtjoancolmenero  
            Started by olisav57, Yesterday, 07:39 PM
            1 response
            9 views
            0 likes
            Last Post NinjaTrader_ChelseaB  
            Started by cocoescala, 10-12-2018, 11:02 PM
            7 responses
            944 views
            0 likes
            Last Post Jquiroz1975  
            Working...
            X