I would like to know how do I specify that I want long the 1st instrument and short the 2nd instrument. I have already added the 2nd instrument in the Initialize block, but not sure how to specific the instrument to be long/short. Ordinarily, for a single instrument, when a condition is met you simple code something like "EnterLong(DefaultQuantity, "long");". So, I think i need to have some way to specify which instrument to get long and short in multi-series, otherwise, only the main instrument will be in effect.
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Multiple Series
Collapse
X
-
Multiple Series
I have some questions about multiple data series on two different instruments. My strategy is a statistic arbitrage based on cointegration.
I would like to know how do I specify that I want long the 1st instrument and short the 2nd instrument. I have already added the 2nd instrument in the Initialize block, but not sure how to specific the instrument to be long/short. Ordinarily, for a single instrument, when a condition is met you simple code something like "EnterLong(DefaultQuantity, "long");". So, I think i need to have some way to specify which instrument to get long and short in multi-series, otherwise, only the main instrument will be in effect.Tags: None
-
Hello,
You can either filter this based on the BarsInProgress or use the Last overload method for EnterLong()
For EnterLong() http://www.ninjatrader.com/support/h...?enterlong.htm
I strongly recommend you fully read all the documentation here as it will inform you how to filter based on different series: http://www.ninjatrader.com/support/h...nstruments.htm
Let me know if I can be of further assistance.LanceNinjaTrader Customer Service
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by CarlTrading, 03-31-2026, 09:41 PM
|
1 response
81 views
1 like
|
Last Post
|
||
|
Started by CarlTrading, 04-01-2026, 02:41 AM
|
0 responses
41 views
0 likes
|
Last Post
by CarlTrading
04-01-2026, 02:41 AM
|
||
|
Started by CaptainJack, 03-31-2026, 11:44 PM
|
0 responses
64 views
2 likes
|
Last Post
by CaptainJack
03-31-2026, 11:44 PM
|
||
|
Started by CarlTrading, 03-30-2026, 11:51 AM
|
0 responses
66 views
0 likes
|
Last Post
by CarlTrading
03-30-2026, 11:51 AM
|
||
|
Started by CarlTrading, 03-30-2026, 11:48 AM
|
0 responses
54 views
0 likes
|
Last Post
by CarlTrading
03-30-2026, 11:48 AM
|

Comment