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 Taddypole, 04-26-2024, 02:47 PM
          2 responses
          12 views
          0 likes
          Last Post Taddypole  
          Started by futtrader, 04-21-2024, 01:50 AM
          6 responses
          58 views
          0 likes
          Last Post futtrader  
          Started by sgordet, Today, 11:48 AM
          0 responses
          4 views
          0 likes
          Last Post sgordet
          by sgordet
           
          Started by Trader146, Today, 11:41 AM
          0 responses
          5 views
          0 likes
          Last Post Trader146  
          Started by jpapa, 04-23-2024, 07:22 AM
          2 responses
          22 views
          0 likes
          Last Post rene69851  
          Working...
          X