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

Trade different instrument than primary symbol

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

    Trade different instrument than primary symbol

    I have strategies that work with the NQ (nasdaq futures).

    I would like to base the entries on NQ but actually place the trades on MNQ (micro contracts).

    I believe I can add NQ as a secondary time frame using that for the logic and run the strategy on the MNQ chart.

    Is there an easier way to do this?

    Even though MNQ and NQ trade at the same price levels the fills do not match, often MNQ doesn't even enter a trade. I understand this happens because they are different datasets.

    #2
    Hello sdauteuil,

    What you described would generally be the easiest way or to make a multi series script.

    For the situation you described a strategy builder strategy would generate the code as you are asking. You could apply the strategy to the MNQ and add NQ as a second series. The builder does not allow code to be executed on the second series so you are only referencing the NQ data there and executing on the MNQ.

    The fills likely will not match as you noted, these are two separate instruments with independent volumes.

    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment


      #3
      Similar Question

      I wish to had NQ as primary for logic and just modify the order to be send on entries and exits for MNQ

      Searching help and Cannot find example of where to place the MNQ symbol

      Thanks to anyone, below is my basic order sent to place market order on the primary symbol of strategy

      EnterShort(Convert.ToInt32(DefaultQuantity), @"SS Break2");

      I did add a data series and came up with the below, my data series is 7

      EnterLong(7, 1, string.Empty);

      this is giving me the entry into MNQ, but not detail with entry name etc as my original

      THIS CREATES a new problem, my strategy exits do not exit this position


      Last edited by DTSSTS; 02-20-2021, 08:31 PM. Reason: Update more information

      Comment


        #4
        Hello DTSSTS,

        If you are trying to place orders to a specific instrument you would need to use the BarsInProgress index like you had with index 7. You didn't provide a signal name, if you want to make use of signal names you need to use a string instead of string.Empty.



        EnterLong(int barsInProgressIndex, int quantity, string signalName)



        I look forward to being of further assistance.
        JesseNinjaTrader Customer Service

        Comment


          #5
          SO

          EnterLong(int barsInProgressIndex, int quantity, string signalName)


          CHANGE int to 7 for barsinProgressIndex, the int qquantiy to default.quantity, NOT sure on string signalName

          EnterLong(7 barsInProgressIndex, default.quantity, string "LS MNQ")


          will i then exit the MNQ symbol or do I need to code the 7

          Comment


            #6
            Hello DTSSTS,

            In your previous post it looks like you used @"SS Break2" for the signal name. If that is the signal name you wanted to use you could use it in the SignalName overload. Signal names are used to pair entries and exits or targets. The BarsInprogress specifies the series to be used, you would not need to otherwise type in a symbol.


            I look forward to being of further assistance.
            JesseNinjaTrader Customer Service

            Comment


              #7
              EnterLong(7 barsInProgressIndex, Default.Quantity, string @"SS Break2")

              you never said IF THIS IS CORRECT
              THANKS

              Comment


                #8
                Hello DTSSTS,

                Those would be valid options for the method but you don't need to include the barsInProgressIndex or string parts. It would look very similar to what you already provided in post 3 for EnterShort.
                EnterLong(7, Default.Quantity, @"SS Break2")

                For NinjaScript concerns the best way to know if something is correct or not is to use it in your script and test it. If it compiles and the desired outcome is seen you can know its correct. To verify you used the correct syntax you can also reference the help guide to view examples or details on how the methods can be used.

                Please let me know if I may be of additional assistance.
                JesseNinjaTrader Customer Service

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by popecapllc, 08-09-2023, 07:42 PM
                11 responses
                1,873 views
                0 likes
                Last Post tradgrad  
                Started by morrnel, 05-12-2024, 06:07 PM
                7 responses
                106 views
                1 like
                Last Post tradgrad  
                Started by mmike, Yesterday, 10:33 PM
                0 responses
                4 views
                0 likes
                Last Post mmike
                by mmike
                 
                Started by Pole123, Yesterday, 06:02 PM
                0 responses
                8 views
                0 likes
                Last Post Pole123
                by Pole123
                 
                Started by samish18, Yesterday, 05:27 PM
                0 responses
                5 views
                0 likes
                Last Post samish18  
                Working...
                X