Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Script disables itself... why?
Collapse
X
-
Ryan M.NinjaTrader Customer Service
-
The secondary series is Closes[1][0]. Note the extra s.
You can also contain in a BarsInProgress filter, which is used to define the context of bar updates.
if (BarsInProgress == 1)
{
Print("This is the secondary series close: " + Close[0]);
}Ryan M.NinjaTrader Customer Service
Comment
-
In this case my event handling procedure might look like this:
protected override void OnBarUpdate()
{
if (BarsInProgress == 0)
{ My_First_Instrument_LastPrice=Close[0];}
if (BarsInProgress == 1)
{ My_Second_Instrument_LastPrice=Close[0];}
}
And if I wouldn't want to split logic:
protected override void OnBarUpdate()
{
My_First_Instrument_LastPrice=Close[0];
My_Second_Instrument_LastPrice=Closes[1][0];
}Last edited by greed999; 07-07-2011, 02:53 PM.
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by DavidHP, Today, 07:56 AM
|
1 response
5 views
0 likes
|
Last Post Today, 08:16 AM | ||
Started by kujista, Today, 06:23 AM
|
3 responses
6 views
0 likes
|
Last Post
by kujista
Today, 08:15 AM
|
||
Started by Mindset, Yesterday, 02:04 AM
|
2 responses
17 views
0 likes
|
Last Post Today, 08:15 AM | ||
Started by f.saeidi, Today, 08:03 AM
|
1 response
5 views
0 likes
|
Last Post Today, 08:15 AM | ||
Started by samish18, 04-17-2024, 08:57 AM
|
15 responses
52 views
0 likes
|
Last Post Today, 08:13 AM |
Comment