Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Strategy with multiple stock symbols

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

    Strategy with multiple stock symbols

    I am new to NT and would like to make a strategy which involves three stock symbols. Thus far I played a bit around to get a feel for the NinjaScript programming. I managed to make my own indicator which works on historical candle data of one stock at a time. But I am not sure whether I can make a program which involves multiple stock symbols.

    The basic idea is the following:
    I have three stock symbols, let's call them AAA, BBB and CCC. I want to monitor AAA and use its trend to open or close a position on either BBB or CCC (not on both at the same time). Besides being a stock could AAA of course also be an index, or a forex exchange rate, or something else.
    Suppose that AAA is rising: I want to open a long position on BBB. Then I keep this BBB position until AAA has started to fall and reached a threshold level below its latest maximum. At that time I want to close the BBB position, see the resulting amount of money and use it to open a long position on CCC (adjust the quantity to the available money). I then keep this CCC position until AAA has passed its minimum, has started to rise and reached a threshold level. At that time I want to close the CCC position, see the resulting amount of money and use it to open a long position on BBB (adjust the quantity to the available money).
    From then on is it a repetitive cycle, unless the strategy doesn't work and I run out of money.

    Is it possible to program this in NT? If so, how do I go about this?

    #2
    fromTokyo, welcome to our forums here - glad you could already take the first steps in NinjaScript custom programming. Definitely access to muliple series / bars objects would be possible as well in Indicators / Strategies in this environment. To get a feel for it, I would suggest to check into the SampleMultiInstrument script for example that is preinstalled with NinjaTrader directly.

    The full environment docs for review would be located here online in our helpgiude - https://www.ninjatrader.com/support/...nstruments.htm

    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
    369 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
    572 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