• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

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:
      http://ninjatrader.com/support/forum...ad.php?t=80237
      and exact post with a working sample:
      http://ninjatrader.com/support/forum...6&postcount=15

      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 traderpards, 12-12-2018, 01:15 PM
          5 responses
          152 views
          0 likes
          Last Post BrianL
          by BrianL
           
          Started by Cyanez, Today, 08:41 AM
          1 response
          7 views
          0 likes
          Last Post NinjaTrader_Jesse  
          Started by TonyParisi, Today, 07:38 AM
          1 response
          8 views
          0 likes
          Last Post NinjaTrader_Kate  
          Started by tgn55, 09-24-2019, 06:34 AM
          13 responses
          49 views
          0 likes
          Last Post NinjaTrader_Jim  
          Started by jasphere, Today, 07:37 AM
          4 responses
          20 views
          0 likes
          Last Post jasphere  
          Working...
          X