Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

A custom window created by an indicator.

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

    #16
    Hello mgamba,

    Welcome to the NinjaTrader forums!

    if (setIndicatorValueFromAddonWindowExampleToolsWindo w != null)
    setIndicatorValueFromAddonWindowExampleToolsWindow .Close();

    This could be called from State.Terminated.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #17
      thank you, I try
      Massimo

      Comment


        #18
        Hello, I try this code in OnStateChange() State == State.Terminated

        if (finestraTSA != null)
        {
        Globals.RandomDispatcher.InvokeAsync(new Action(() =>
        {
        // close the window
        finestraTSA.Close();
        }));
        }

        The object finestraTSA is not null, but finestraTSA.Close() dont work

        Thanks
        Massimo​

        Comment


          #19
          Hello Massimo,

          Apologies, the dispatcher of the window is necessary.

          Code:
          if (setIndicatorValueFromAddonWindowExampleToolsWindow != null)
          {
              setIndicatorValueFromAddonWindowExampleToolsWindow.Dispatcher.InvokeAsync(() =>
              {
                  setIndicatorValueFromAddonWindowExampleToolsWindow.Close();
              });
          }
          Chelsea B.NinjaTrader Customer Service

          Comment


            #20
            works well
            thanks

            Massimo

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by CaptainJack, 05-29-2026, 05:09 AM
            0 responses
            236 views
            0 likes
            Last Post CaptainJack  
            Started by CaptainJack, 05-29-2026, 12:02 AM
            0 responses
            151 views
            0 likes
            Last Post CaptainJack  
            Started by charlesugo_1, 05-26-2026, 05:03 PM
            0 responses
            162 views
            1 like
            Last Post charlesugo_1  
            Started by DannyP96, 05-18-2026, 02:38 PM
            1 response
            243 views
            0 likes
            Last Post NinjaTrader_ChelseaB  
            Started by CarlTrading, 05-11-2026, 05:56 AM
            0 responses
            198 views
            0 likes
            Last Post CarlTrading  
            Working...
            X