Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Error referencing Time[n] in OnMouseUp EventHandler
Collapse
X
-
Originally posted by palinuro View PostI am getting a consistent ArgumentOutOfRange Exception whenever I reference Time[CurrentBar-n] in my OnMouseUp(object sender, MouseEventArgs e) EventHandler. "n" is less than CurrentBar, so it should be within range..
I don't have any problem working directly with the index numbers directly, but I need to store the values as DateTimes.
I was able to do this in NT7 without any problems. Is a different approach needed in NT8?
You can either use the absolute index methods like GetTime(idx) which is the recommended way to go, or if you must use Time[idx] for whatever reason - you can try catching up the current bar array yourself, but this is not a documented solution.
Code:private void onMouseDown(object sender, MouseEventArgs e) { // a very simplified way to sync the current bar for (int i = 0; i < BarsArray.Length; i++) { BarsArray[i].CurrentBar = CurrentBars[i]; } Print(Time[5]); }
Last edited by NinjaTrader_Matthew; 12-17-2015, 09:06 AM.
Leave a comment:
-
Error referencing Time[n] in OnMouseUp EventHandler
I am getting a consistent ArgumentOutOfRange Exception whenever I reference Time[CurrentBar-n] in my OnMouseUp(object sender, MouseEventArgs e) EventHandler. "n" is less than CurrentBar, so it should be within range..
I don't have any problem working directly with the index numbers directly, but I need to store the values as DateTimes.
I was able to do this in NT7 without any problems. Is a different approach needed in NT8?Last edited by palinuro; 12-12-2015, 09:32 PM.Tags: None
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by lorem, Yesterday, 09:18 AM
|
4 responses
14 views
0 likes
|
Last Post
by lorem
Today, 12:17 PM
|
||
Started by Spiderbird, Today, 12:15 PM
|
0 responses
5 views
0 likes
|
Last Post
by Spiderbird
Today, 12:15 PM
|
||
Started by cmtjoancolmenero, Yesterday, 03:58 PM
|
12 responses
42 views
0 likes
|
Last Post Today, 12:09 PM | ||
Started by FrazMann, Today, 11:21 AM
|
0 responses
6 views
0 likes
|
Last Post
by FrazMann
Today, 11:21 AM
|
||
Started by geddyisodin, Yesterday, 05:20 AM
|
8 responses
52 views
0 likes
|
Last Post Today, 10:45 AM |
Leave a comment: