![]() |
|
|||||||
| Connecting Support for establishing connections to your broker or market data service provider. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Senior Member
Join Date: Mar 2007
Location: , Florida, USA
Posts: 663
Thanks: 36
Thanked 7 times in 6 posts
|
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 |
|
NinjaTrader Customer Service
Join Date: Dec 2009
Location: Denver, CO, USA
Posts: 6,498
Thanks: 109
Thanked 291 times in 280 posts
|
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.
Brett
NinjaTrader Customer Service |
|
|
|
|
|
#3 | |
|
Senior Member
Join Date: Mar 2007
Location: , Florida, USA
Posts: 663
Thanks: 36
Thanked 7 times in 6 posts
|
Quote:
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. |
|
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Auto Reconnect to CQG at the End of a Weekend | KBJ | Connecting | 3 | 10-17-2011 07:06 AM |
| CQG Errors | jasterm | Connecting | 4 | 07-08-2011 01:45 PM |
| Just installed 7.0.1000.5. Unable to connect to CQG (AMP) | drecio | Connecting | 3 | 05-19-2011 09:53 AM |
| custom Plot() method AutoScale and PriceMarkers | shawnj | Indicator Development | 0 | 06-08-2008 02:55 PM |
| Custom Plot colors & Thresholds & Price marker colors | higler | General Programming | 5 | 06-22-2007 07:47 AM |