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 charlesugo_1, 05-26-2026, 05:03 PM
|
0 responses
60 views
0 likes
|
Last Post
by charlesugo_1
05-26-2026, 05:03 PM
|
||
|
Started by DannyP96, 05-18-2026, 02:38 PM
|
1 response
148 views
0 likes
|
Last Post
|
||
|
Started by CarlTrading, 05-11-2026, 05:56 AM
|
0 responses
162 views
0 likes
|
Last Post
by CarlTrading
05-11-2026, 05:56 AM
|
||
|
Started by CarlTrading, 05-10-2026, 08:12 PM
|
0 responses
98 views
0 likes
|
Last Post
by CarlTrading
05-10-2026, 08:12 PM
|
||
|
Started by Hwop38, 05-04-2026, 07:02 PM
|
0 responses
286 views
0 likes
|
Last Post
by Hwop38
05-04-2026, 07:02 PM
|

Comment