Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Problems with the detection ChartTrader

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

    Problems with the detection ChartTrader

    Code:
    System.Windows.Controls.Grid chartGrid2 = (Window.GetWindow(ChartControl.Parent).FindFirst("ChartWindowChartTraderControl") as ChartTrader).Parent as System.Windows.Controls.Grid;
    This code works fine when you first start.

    Then if you remove ChartTrader from the chart, this code still shows the presence of ChartTrader on the chart

    #2
    Hello,

    Thank you for the question.

    I wanted to check, are you trying to determine when the chart trader is open and enabled vs closed and enabled vs closed and disabled?

    The visibility of the control is being toggled rather than the control being actually removed so there should still be an instance on the actual parent control.

    If you can tell me what the end result you are expecting is, I could see if there is a better way to accomplish that.

    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment


      #3
      open and enabled vs closed and disabled

      chartGrid2 should be null if ChartTrader is disabled

      I want to know is whether cartrader now on the chart

      Ideally, of course know all 3 states: off, on, hidden
      Last edited by vladko; 08-09-2016, 04:42 PM.

      Comment


        #4
        Hello,

        To know if the ChartTrader is Enabled vs Hidden vs Disabled you could check the ChartTraderVisibility of the ChartTrader object rather than checking for null.

        Here is a sample with the output:

        Code:
        ChartControl.Dispatcher.InvokeAsync((Action)(() => {  
        		ChartTrader trader = Window.GetWindow(ChartControl.Parent).FindFirst("ChartWindowChartTraderControl") as ChartTrader;
        		if(trader!= null)
        		{
        			Print(trader.ChartTraderVisibility.ToString());	
        			//Open    = Visible
        			//Hidden  = VisibleCollapsed
        			//Closed  = Collapsed
        		}
        	}));
        I look forward to being of further assistance.
        JesseNinjaTrader Customer Service

        Comment


          #5
          OK, Thank You

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Segwin, 05-07-2018, 02:15 PM
          14 responses
          1,789 views
          0 likes
          Last Post aligator  
          Started by Jimmyk, 01-26-2018, 05:19 AM
          6 responses
          837 views
          0 likes
          Last Post emuns
          by emuns
           
          Started by jxs_xrj, 01-12-2020, 09:49 AM
          6 responses
          3,293 views
          1 like
          Last Post jgualdronc  
          Started by Touch-Ups, Today, 10:36 AM
          0 responses
          13 views
          0 likes
          Last Post Touch-Ups  
          Started by geddyisodin, 04-25-2024, 05:20 AM
          11 responses
          63 views
          0 likes
          Last Post halgo_boulder  
          Working...
          X