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 charlesugo_1, 05-26-2026, 05:03 PM
    0 responses
    59 views
    0 likes
    Last Post charlesugo_1  
    Started by DannyP96, 05-18-2026, 02:38 PM
    1 response
    143 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 05-11-2026, 05:56 AM
    0 responses
    161 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 05-10-2026, 08:12 PM
    0 responses
    97 views
    0 likes
    Last Post CarlTrading  
    Started by Hwop38, 05-04-2026, 07:02 PM
    0 responses
    276 views
    0 likes
    Last Post Hwop38
    by Hwop38
     
    Working...
    X