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

Use condtions for ES but then submit orders for another futures contract

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

    Use condtions for ES but then submit orders for another futures contract

    Is there an easy way to make my code based off of my ES conditions to take trades for NQ or other futures easily with just a few pieces of code that I can enter?

    #2
    Hello durdcash,

    You could do that using the strategy builder. You would need to use the NQ as the primary instrument that you apply the strategy to and then add the ES as a secondary instrument in the builder. That would let you form conditions based on ES prices and submit orders to the NQ primary instrument.

    https://ninjatrader.com/support/help...standingTheAdd itrionalDataScreen
    https://ninjatrader.com/support/help..._builder.htm#H owToMakePriceDataComparisons​

    You can also make more complex scripts in manual coding that use any primary instrument you wanted and submit orders to any of the secondary instruments that you add.





    JesseNinjaTrader Customer Service

    Comment


      #3
      I have been able to finally get this to work where I have my ES conditions submit for trade 1 which is ES and then trade submits to NQ. Currently the only way I have to exit is when ES hits my trade profit target it sells NQ. What is the best way to make it to use the data from NQ. I have created the data series for NQ and am using the index of [1] for the trades. Do I need to create other variables in other locations for example on bar update do I need to add the barsinprogress==1 for another section and then move the exit logic there?

      Comment


        #4
        Hello durdcash,

        If you are manually coding the strategy you can add any series that you want the strategy to use and then isolate parts of its logic using barsinprogress conditions. If you wanted the NQ data used and that is barsinprogress 1 then that exit logic would need to go inside thata part of the script. You can see some examples of separating logic in the following page:

        JesseNinjaTrader Customer Service

        Comment


          #5
          durdcash here's a 3rd party add-on that does what you want --> https://www.speedytradingservers.com...-8-replicator/

          Comment


            #6
            NinjaTrader_Jesse Thanks! Looks like I got it all figured it out. From the code I have for exit, I was still referencing position[0] instead of positions[1].

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by sastrades, 01-31-2024, 10:19 PM
            13 responses
            203 views
            0 likes
            Last Post NinjaTrader_Manfred  
            Started by reynoldsn, Today, 04:40 PM
            0 responses
            4 views
            0 likes
            Last Post reynoldsn  
            Started by Philippe56140, 04-27-2024, 02:35 PM
            6 responses
            54 views
            0 likes
            Last Post bltdavid  
            Started by ETFVoyageur, Yesterday, 06:05 PM
            7 responses
            45 views
            0 likes
            Last Post ETFVoyageur  
            Started by betsuni_123, Today, 04:20 PM
            0 responses
            12 views
            0 likes
            Last Post betsuni_123  
            Working...
            X