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 CarlTrading, 03-31-2026, 09:41 PM
    1 response
    64 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 04-01-2026, 02:41 AM
    0 responses
    35 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 03-31-2026, 11:44 PM
    0 responses
    59 views
    1 like
    Last Post CaptainJack  
    Started by CarlTrading, 03-30-2026, 11:51 AM
    0 responses
    62 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 03-30-2026, 11:48 AM
    0 responses
    51 views
    0 likes
    Last Post CarlTrading  
    Working...
    X