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 dmking, 11-12-2019, 12:31 PM
|
4 responses
4,139 views
0 likes
|
Last Post
by jasonw
Today, 04:32 PM
|
||
Started by roblogic, Today, 04:31 PM
|
0 responses
2 views
0 likes
|
Last Post
by roblogic
Today, 04:31 PM
|
||
Started by morrnel, 05-12-2024, 06:07 PM
|
4 responses
52 views
0 likes
|
Last Post Today, 04:22 PM | ||
Started by xepher101, 05-10-2024, 12:19 PM
|
6 responses
69 views
0 likes
|
Last Post
by xepher101
Today, 04:11 PM
|
||
Started by gbourque, Today, 04:11 PM
|
0 responses
1 view
0 likes
|
Last Post
by gbourque
Today, 04:11 PM
|
Comment