Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

NT8b9 Indicator makes chart stall on real time data

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

    NT8b9 Indicator makes chart stall on real time data

    I have one indicator that works perfectly fine on historical data but whenever I start real time connection (including Playback and Simulation Data Feed) the chart window immediately stalls. I can access other windows, eg. Control Center but in the end I need to kill the NT process to get rid of the offending stalled chart.

    Since it is rather big indicator I am not able share it at the moment but I will try to make a minimal version that does the same.

    In the meantime - has anyone experienced anything similar before or do you have any advice what to look for (Log and Trace are clear of errors).

    #2
    I have narrowed down the culprit - it is a custom control added to the chart (slider to be exact) invoked in:

    Code:
    else if (State == State.Historical)
    {
        if (installDP) this.Dispatcher.Invoke((Action)(() => { installDP = false; InstallDP(); }));
    }
    Can you link me to an example of a control (eg. button) added to the chart that doesn't stall a chart on real-time data?

    In my case it stalls straight after "Invoke" so I wonder if I should do it in a different way?

    Comment


      #3
      Got it working now.

      Changed the dispatcher to be from ChartControl + BeginInvoke instead. This is taken/learned from the following thread:

      and exact post with a working sample:


      Code:
      else if (State == State.Historical)
      {
          if (installDP && ChartControl != null)
          {
              ChartControl.Dispatcher.BeginInvoke((Action) (() =>
              {
                  installDP = false;
                  InstallDP();
              }));
          }
      }
      
      else if (State == State.Terminated)
      {
          if (ChartControl != null)
          {
              ChartControl.Dispatcher.BeginInvoke((Action) (() =>
              {
                  DisposeCleanUp();
              }));
          }
      }

      Comment


        #4
        gregid,

        I'm glad to see you were able to get this sorted out and sorry for the trouble!

        We've updated our best practices to help avoid this type of issue in the future: http://ninjatrader.com/support/helpG...-threading.htm
        MatthewNinjaTrader Product Management

        Comment


          #5
          Thanks Matthew, expanded help guide will definitely be helpful looking forward.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Waxavi, Today, 02:10 AM
          1 response
          16 views
          0 likes
          Last Post NinjaTrader_LuisH  
          Started by Kaledus, Today, 01:29 PM
          5 responses
          13 views
          0 likes
          Last Post NinjaTrader_Jesse  
          Started by Waxavi, Today, 02:00 AM
          1 response
          11 views
          0 likes
          Last Post NinjaTrader_LuisH  
          Started by alifarahani, Today, 09:40 AM
          5 responses
          23 views
          0 likes
          Last Post NinjaTrader_Jesse  
          Started by gentlebenthebear, Today, 01:30 AM
          3 responses
          16 views
          0 likes
          Last Post NinjaTrader_Jesse  
          Working...
          X