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

Queries on Multi Instrument Scenerio

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

    Queries on Multi Instrument Scenerio

    Say if i have 3 data series. Data 0 , Data 1 and Data 2.

    Question 1:
    If i perform the following in sequence what do i get ?

    EnterLong(0, 1, "Entry1")
    EnterLong(1, 1, "Entry1")
    EnterShort(2, 1, "Entry1")

    What is the final result ?

    Positions for Data 0 and 1 are all closed.
    And i am left with Short on Data 2 ?

    Question 2:
    What if Data 0 has no data for the day ( market holiday or closed ).
    Will the strategy still be triggered as long as Data 1 and Data 2 has prices and i can still send orders for Data 1 and 2 ?

    thanks

    #2
    Hello,

    Say if i have 3 data series. Data 0 , Data 1 and Data 2.

    Question 1:
    If i perform the following in sequence what do i get ?

    EnterLong(0, 1, "Entry1")
    EnterLong(1, 1, "Entry1")
    EnterShort(2, 1, "Entry1")

    What is the final result ?
    >>Same instrument and they are don't sequentially, you will be long 1. The first one enters long, the second one adds one to it, and the third closes out one of the long positions.

    Positions for Data 0 and 1 are all closed.
    And i am left with Short on Data 2 ?
    >>Not sure I understand. If you close the long positions and place the short position you will be short 1.

    Question 2:
    What if Data 0 has no data for the day ( market holiday or closed ).
    >>I believe your 0 bar will never call so you will never enter the 0 bar order, therefore you would be flat.

    Will the strategy still be triggered as long as Data 1 and Data 2 has prices and i can still send orders for Data 1 and 2 ?
    >>Yes, it should, but test it so that it works as expected. This link may help:

    DenNinjaTrader Customer Service

    Comment


      #3
      Ben i should have been clearer.
      Data 0 , Data 1 and Data 2 are all DIFFERENT Instruments.

      So again
      If i perform the following in sequence what do i get ?

      EnterLong(0, 1, "Entry1")
      EnterLong(1, 1, "Entry1")
      EnterShort(2, 1, "Entry1")

      What's the final result ?
      My expectation is that the last EnterShort will close positions for Data 0 and Data 1. I will be net short 1 lot of Data 2.
      Is this correct ?

      Originally posted by NinjaTrader_Ben View Post
      Hello,

      Say if i have 3 data series. Data 0 , Data 1 and Data 2.

      Question 1:
      If i perform the following in sequence what do i get ?

      EnterLong(0, 1, "Entry1")
      EnterLong(1, 1, "Entry1")
      EnterShort(2, 1, "Entry1")

      What is the final result ?
      >>Same instrument and they are don't sequentially, you will be long 1. The first one enters long, the second one adds one to it, and the third closes out one of the long positions.

      Positions for Data 0 and 1 are all closed.
      And i am left with Short on Data 2 ?
      >>Not sure I understand. If you close the long positions and place the short position you will be short 1.

      Question 2:
      What if Data 0 has no data for the day ( market holiday or closed ).
      >>I believe your 0 bar will never call so you will never enter the 0 bar order, therefore you would be flat.

      Will the strategy still be triggered as long as Data 1 and Data 2 has prices and i can still send orders for Data 1 and 2 ?
      >>Yes, it should, but test it so that it works as expected. This link may help:

      http://www.ninjatrader-support.com/H...struments.html

      Comment


        #4
        Originally posted by aljafp View Post
        Ben i should have been clearer.
        Data 0 , Data 1 and Data 2 are all DIFFERENT Instruments.

        So again
        If i perform the following in sequence what do i get ?

        EnterLong(0, 1, "Entry1")
        EnterLong(1, 1, "Entry1")
        EnterShort(2, 1, "Entry1")

        What's the final result ?
        My expectation is that the last EnterShort will close positions for Data 0 and Data 1. I will be net short 1 lot of Data 2.
        Is this correct ?
        Guys, do you guys have an answer to this ? thanks

        Ben i should have been clearer.
        Data 0 , Data 1 and Data 2 are all DIFFERENT Instruments.

        So again
        If i perform the following in sequence what do i get ?

        EnterLong(0, 1, "Entry1")
        EnterLong(1, 1, "Entry1")
        EnterShort(2, 1, "Entry1")

        What's the final result ?
        My expectation is that the last EnterShort will close positions for Data 0 and Data 1. I will be net short 1 lot of Data 2.
        Is this correct ?

        Comment


          #5
          Originally posted by aljafp View Post
          Data 0 , Data 1 and Data 2 are all DIFFERENT Instruments.

          So again
          If i perform the following in sequence what do i get ?

          EnterLong(0, 1, "Entry1")
          EnterLong(1, 1, "Entry1")
          EnterShort(2, 1, "Entry1")

          What's the final result ?
          My expectation is that the last EnterShort will close positions for Data 0 and Data 1. I will be net short 1 lot of Data 2.
          Is this correct ?
          If these are all different instruments, you will be left with one long position for data 0, one long position for data 1, and one short position for data 2. Why would the positions offset each other if they are all different instruments?
          AustinNinjaTrader Customer Service

          Comment


            #6
            Originally posted by NinjaTrader_Austin View Post
            If these are all different instruments, you will be left with one long position for data 0, one long position for data 1, and one short position for data 2. Why would the positions offset each other if they are all different instruments?
            OIC, thanks austin.

            I presume the offseting works if they have the same signal names too.

            So i gather the offseting works at per instrument level, REGARDLESS OF TIMEFRAMES and SIGNALNAMES.

            So if i have Datas 0, 1 and 2.
            0 and 1 are the same instrument say A but with different timeframes.
            Data 2 is a different instrument say B.

            But what If i perform the following
            EnterLong(0, 1, "Entry1")
            EnterLong(1, 1, "Entry1")
            EnterLong(2, 1, "Entry1")
            If i subsequently do
            ExitLong("Entry1")
            What's the result ?
            I will have close out all positions for all instruments ?
            or
            Will it only close for Data 0 ?

            Comment


              #7
              aljafp, it is recommended to use different signal names when using different instruments. That way you can be certain which signal is being used for a specific instrument.

              I believe second scenario you mentioned would depend on which instrument made the call to OnBarUpdate() first. You should always include a bars in progress index when dealing with multiple instruments though. If you can specify which BIP to use when entering the trade, surely you can use it to exit the trade as well.
              AustinNinjaTrader Customer Service

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by dmking, 11-12-2019, 12:31 PM
              4 responses
              4,140 views
              0 likes
              Last Post jasonw
              by jasonw
               
              Started by roblogic, Today, 04:31 PM
              0 responses
              5 views
              0 likes
              Last Post roblogic  
              Started by morrnel, 05-12-2024, 06:07 PM
              4 responses
              55 views
              0 likes
              Last Post NinjaTrader_Manfred  
              Started by xepher101, 05-10-2024, 12:19 PM
              6 responses
              71 views
              0 likes
              Last Post xepher101  
              Started by gbourque, Today, 04:11 PM
              0 responses
              3 views
              0 likes
              Last Post gbourque  
              Working...
              X