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 Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    647 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    367 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    108 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    571 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    573 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X