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

Setting Parameters to be saved with an indicator - when is too late?

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

    Setting Parameters to be saved with an indicator - when is too late?

    All

    I want to reset some of the indicator settings in my code.

    I can do this - it works well and it saves the settings fine.

    Now I'm trying to do this when the indicator/workspace/chart/Ninja is being closed. So - when they close the indicator, I'd like to have an event in which I execute some code.

    The OnTermination event does allow me to execute code but it appears this is too late to make changes to the indicator settings - I would guess that's because they've already been saved.

    So - is there an even that will trigger when the indicator is being closed but before Ninja has saved away all the settings?

    Thanks

    Pete

    #2
    Hello,

    Thanks for your forum post.


    There is not a method I am aware of that will allow you to do this other then OnTermination().However I will double check on this on Monday with some other members of our NinjaScript support team.

    The only thing I can recommend is that you instead, in OnTermination() save this information to a .txt file or some external file such as using excel like in your excellent write up several months ago on using excel, or using a .txt file.

    Then in Init() or OnStartUp() for your indicator/strategy then you could always load in the data from this external file.

    Comment


      #3
      Brett

      Thanks for that - the problem with that approach is that I might be runing my indicator multiple times and so I'd need to somehow have an index value so that I would know which text file relates to which instance of the indicator.

      I believe there's no way to 'id' a particular instance of an indicator.

      Anyway - I'd appreciate it if you could talk to dev team. I guess I could do this on every tick but that would mean a performance hit.

      If there is a way to put some code into the save process or an event that comes before it, it's be useful for me.

      Cheers

      Pete

      Comment


        #4
        Hello,

        Have discussed this over, Unfortunately there is no supported method to do this.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by ChartTourist, Today, 08:22 AM
        0 responses
        3 views
        0 likes
        Last Post ChartTourist  
        Started by LiamTwine, Today, 08:10 AM
        0 responses
        2 views
        0 likes
        Last Post LiamTwine  
        Started by Balage0922, Today, 07:38 AM
        0 responses
        5 views
        0 likes
        Last Post Balage0922  
        Started by JoMoon2024, Today, 06:56 AM
        0 responses
        6 views
        0 likes
        Last Post JoMoon2024  
        Started by Haiasi, 04-25-2024, 06:53 PM
        2 responses
        19 views
        0 likes
        Last Post Massinisa  
        Working...
        X