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:


    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:


        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 PaulMohn, Today, 12:36 PM
          0 responses
          2 views
          0 likes
          Last Post PaulMohn  
          Started by love2code2trade, 04-17-2024, 01:45 PM
          4 responses
          38 views
          0 likes
          Last Post love2code2trade  
          Started by alifarahani, Today, 09:40 AM
          2 responses
          14 views
          0 likes
          Last Post alifarahani  
          Started by junkone, Today, 11:37 AM
          3 responses
          20 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Started by frankthearm, Yesterday, 09:08 AM
          12 responses
          44 views
          0 likes
          Last Post NinjaTrader_Clayton  
          Working...
          X