Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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
    BertrandNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by kevinenergy, Yesterday, 12:01 PM
    6 responses
    22 views
    0 likes
    Last Post kevinenergy  
    Started by DawnTreader, 05-08-2024, 05:58 PM
    15 responses
    48 views
    0 likes
    Last Post NinjaTrader_Gaby  
    Started by ZeroKuhl, Yesterday, 04:31 PM
    7 responses
    40 views
    0 likes
    Last Post NinjaTrader_Jesse  
    Started by xepher101, Today, 12:19 PM
    1 response
    22 views
    0 likes
    Last Post NinjaTrader_Jesse  
    Started by jpeep, 08-16-2020, 08:31 AM
    16 responses
    498 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Working...
    X