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

Code examples of multi instrument strategies?

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

    Code examples of multi instrument strategies?

    Let's say I have a super simple daily stock strategy-- I want to go long when the 20 day EMA crosses above the 50 day EMA, and go short when the 20 day EMA crosses below the 50 day EMA.

    Now here's the mutli strategy addition I'd like to add to it-- only go long when DELL is above its 50 day EMA, and only go short when DELL is below its 50 day EMA.

    Could you show me how to code this or at least point me to an example of a strategy coded that uses similar logic? I've read the tutorial on multi-instrument strategies, but I'd like to find a working example to go off of.

    Thanks.

    #2
    Hi Nick, thanks for your post.

    You can review the code of the per default installed 'SampleMultiInstrument' script.

    Then right click in it and save it under a new name, try gradually modify until it fulfills your needs.
    BertrandNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by sastrades, 05-10-2024, 09:59 AM
    3 responses
    54 views
    0 likes
    Last Post rc5781
    by rc5781
     
    Started by guyonabuffalo, Yesterday, 10:01 PM
    2 responses
    18 views
    0 likes
    Last Post guyonabuffalo  
    Started by thumper57, Yesterday, 04:30 PM
    5 responses
    16 views
    0 likes
    Last Post thumper57  
    Started by reynoldsn, 05-10-2024, 07:04 PM
    5 responses
    27 views
    0 likes
    Last Post NinjaTrader_BrandonH  
    Started by llanqui, Today, 11:10 AM
    1 response
    16 views
    0 likes
    Last Post NinjaTrader_BrandonH  
    Working...
    X