Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Auto Reconnect to CQG At End of Weekend & Replay Connect Errors in Custom Plot Method

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

    Auto Reconnect to CQG At End of Weekend & Replay Connect Errors in Custom Plot Method

    I did a Disconnect then Connect to solve an issue I was having with CQG this morning.

    When I did this Connect, I also noticed that the NinjaTrader bug still exists where either FirstBarIndexPainted and/or LastBarIndexPainted ends up with a value of -1 in the first call (after the Connect) to an indicator's custom GetMinMaxValues method or its custom Plot method.

    This will in general cause an error for any indicators that use custom Plot/GetMinMaxValues methods that reference these values.

    This is a long-standing bug for 7.0. (Sorry I thought I'd reported this before, but I must not have completed the posting.)

    This also used to affect custom indicator use when connecting to Replay (I haven't used Replay in a while, so I'm not sure this is still an issue there, but I suspect it is, as I'd guess the problem is probably in Ninja's Connect code which gets called in either case.)

    As a workaround I had been using code similar to the following in my indicators with custom Plot/GetMinMaxValues methods:

    Code:
    #if NT7									// For V7.0...
    if ((FirstBarIndexPainted < 0) || (LastBarIndexPainted < 0))
    {
    	string errMsg = String.Format( "{0} = {1} - GetMinMaxValues - Negative bar number error(s) - FirstBarIndexPainted={2} LastBarIndexPainted={3}", 
    					base.Name, DateTime.Now, FirstBarIndexPainted, LastBarIndexPainted );
    	Print( errMsg );						// Display an error message in the Output window.
    	Log( errMsg, LogLevel.Warning );		// Also display the error message in the Control Center's Log tab.
    	return;	// Compensate for Replay slider bug in Ninja 7.0.1000.2 & earlier; error also seen on Connect after Disconnect done Monday morning 7.0.1000.7 (10-Oct-2011).
    }
    #else									// For V6.5...
    int		FirstBarIndexPainted = ChartControl.LastBarPainted - ChartControl.BarsPainted + 1;	// First bar index painted wasn't defined in V6.5.
    int		LastBarIndexPainted  = ChartControl.LastBarPainted;							// Last  bar index painted wasn't defined in V6.5.
    #endif

    #2
    Thanks for the post.

    This could be the case, unfortuantely FirstBarIndexPainted and/or LastBarIndexPainted are not supported and are not listed in our help guide. Therefor these may or may not work as expected unfortunately. Thanks for sharing your workaround however, this may be useful to someone else that is using these unsupported methods.

    Let me know if I can be of further assistance.

    Comment


      #3
      Originally posted by NinjaTrader_Brett View Post
      This could be the case, unfortuantely FirstBarIndexPainted and/or LastBarIndexPainted are not supported and are not listed in our help guide. Therefor these may or may not work as expected unfortunately. Thanks for sharing your workaround however, this may be useful to someone else that is using these unsupported methods.

      Let me know if I can be of further assistance.
      Brett,

      You might want to drop that last little bit -- at least in certain instances.

      I know it's good manners (and possibly company policy) to ask if you can help. But (at least for me) when someone asks if there's some further way they can help me, and I don't feel like I've been helped (as in this case), for some strange reason this just tends to piss me off.

      Maybe it's just me ... just semantics, possibly.

      One of my problems is that I keep offering NinjaTrader help, and it's mostly not accepted. (You did accept my help and and were gracious about it -- so thank you for that.)

      But do a forum search for "KBJ" and see how many suggestions I've made. I believe them to be well-thought-out and well written-up - I know you guys are busy so I've tried to make my suggestions easy to follow and easy to implement. Many of them are very small items possibly requiring as little as 5-10 minutes to complete. Collectively I feel my suggested changes would make the product much more usable and user-friendly. I have put literally hundreds of hours into these suggestions. And they've mostly just been ignored. And some of them for 2 or 3 years or more. (Sigh.)

      Anyway, thanks for your offer.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Max238, Today, 01:28 AM
      4 responses
      33 views
      0 likes
      Last Post Max238
      by Max238
       
      Started by r68cervera, Today, 05:29 AM
      1 response
      7 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by geddyisodin, Today, 05:20 AM
      1 response
      11 views
      0 likes
      Last Post NinjaTrader_Gaby  
      Started by timko, Today, 06:45 AM
      2 responses
      13 views
      0 likes
      Last Post NinjaTrader_ChristopherJ  
      Started by habeebft, Today, 07:27 AM
      0 responses
      6 views
      0 likes
      Last Post habeebft  
      Working...
      X