Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Multiple Series

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    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.

    #2
    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

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by CarlTrading, 03-31-2026, 09:41 PM
    1 response
    81 views
    1 like
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 04-01-2026, 02:41 AM
    0 responses
    41 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 03-31-2026, 11:44 PM
    0 responses
    64 views
    2 likes
    Last Post CaptainJack  
    Started by CarlTrading, 03-30-2026, 11:51 AM
    0 responses
    66 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 03-30-2026, 11:48 AM
    0 responses
    54 views
    0 likes
    Last Post CarlTrading  
    Working...
    X