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

How to access variable between NT windows?

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

    How to access variable between NT windows?

    Hi,
    I am creating AddOn using sample provided by NT using Visual Studio and creating dll.
    I have added a checkbox to AddOnFramework new window created through through the sample. After clicking the checkbox, I would like to disable BUY button on Basic Entry window.
    Currently I can disable buy button when window is created but would like to disable it using checkbox which is in a different window.
    Please help.

    #2
    Hi aqilkhan1974, can you give an example script of what you have so far so I can test it on my PC? Please Export what you have so far:

    https://ninjatrader.com/support/help...tAsSourceFiles
    Chris L.NinjaTrader Customer Service

    Comment


      #3
      I would like to enable/disable trading buttons in BasicEntry window from the AddOn Window checkbox click event. See screen shot.
      I can enable/disable while basic entry window is loading inside OnWindowCreated() event.

      I cannot export script the way you requested since I am doing VS development and deploying .dll to NT.

      Comment


        #4
        Hi, thanks for your reply.

        I'm not aware of any supported way of doing this, nor would we recommend disabling any buttons that come with the platform. The subject here is mainly focused in WPF code, so you would need to research how one would do this through WPF programmatically with C#. This is, unfortunately, would be out of the scope of support we can provide. The closest example that I have is an addon that can get all charts an indicators in the workspace. This would be the first step in accessing basic entry windows in the workspace:
        https://ninjatrader.com/support/foru...tor#post717883

        Kind regards,
        -ChrisL
        Chris L.NinjaTrader Customer Service

        Comment


          #5
          Thank you Chris for the reply and link to related article. Below code referenced by ChelseaB in the post really helped.

          Code:
          foreach (Window window in Globals.AllWindows) { NTWindow w = (NTWindow)window; window.Dispatcher.BeginInvoke(new Action(() => { if (!w.Caption.Contains("Chart")) return; TabControl tc = w.FindFirst("ChartWindowTabControl") as TabControl; if (tc == null) return; foreach (TabItem ti in tc.Items) { ChartControl tabChartControl = (ti.Content as ChartTab).ChartControl; if (ti.IsSelected) tabChartControl.InvalidateVisual(); } })); }

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by kainermy, Today, 05:22 AM
          0 responses
          7 views
          0 likes
          Last Post kainermy  
          Started by KlausTheMause, Yesterday, 02:57 PM
          1 response
          29 views
          0 likes
          Last Post NinjaTrader_Jason  
          Started by Jaggy, 02-04-2023, 07:24 PM
          1 response
          61 views
          0 likes
          Last Post NinjaTrader_Jason  
          Started by sjmuk1, Yesterday, 09:35 AM
          2 responses
          69 views
          0 likes
          Last Post sjmuk1
          by sjmuk1
           
          Started by NinjaCustomer, 05-24-2018, 10:29 PM
          3 responses
          946 views
          0 likes
          Last Post elliot5
          by elliot5
           
          Working...
          X