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 lorem, 04-25-2024, 09:18 AM
    15 responses
    64 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by doihaveto13, Today, 12:46 PM
    1 response
    3 views
    0 likes
    Last Post NinjaTrader_Zachary  
    Started by owen5819, 05-11-2024, 02:24 PM
    3 responses
    20 views
    0 likes
    Last Post owen5819  
    Started by Vitamite, Today, 12:48 PM
    0 responses
    6 views
    0 likes
    Last Post Vitamite  
    Started by MrAdamSK, 04-02-2024, 11:25 PM
    3 responses
    41 views
    0 likes
    Last Post NinjaTrader_Zachary  
    Working...
    X