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

managing different strat ,same intrument.

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

    managing different strat ,same intrument.

    I need to run 2 strategies on the same instrument, as mixing them on the same strategy is too complex.
    My question would be:
    supposing strat 1 is short 2, is there any way for the strat 2 not recognize the overall short position? run completely apart from strat 1.. The fact is, strat 1 is intraday, and strat 2 carries position for several days. In case strat 2 is short, and strat 1 triggered a buy position (it needs to see a flat position, while it is in fact short), strat 1 needs to close the position (end of the day) in order for the position keep short (overnight). Botton line, Can I make a position per order control?
    (I am using IB)
    Last edited by dafonseca; 09-30-2016, 02:52 PM.

    #2
    Hello dafonseca,

    No, if two strategies are running on the same instrument they are completely independent of each other.

    If one goes short, and the other is flat, the account is short 1 but the second strategy sees the position as flat.

    You would need to run them on different accounts to truly have different positions.
    You would need to add logic from both scripts to a single strategy to have them share a position.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      you mean, even when trading on Interactive Brokers?

      I did not understand that part "You would need to run them on different accounts to truly have different positions." as I just heve one IB account. Can you clear it?

      Comment


        #4
        Hello dafonseca,

        This is true no matter what brokerage you are trading to.

        NinjaScript Strategy instances are completely separate.

        They are not able to see the other instances position.

        Thus, if you want to run two strategies on the same instrument and them not interfere with each other, they would need to be run on separate accounts.

        Otherwise it would not be advised to run two strategies on the same instrument on the same account.
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          last question,
          I will mix both strat in one strategy, if each strat buys and sell 1 contract. in case i want to let them trade freely, should I need to use EntriesPerDirection = 2;?
          or : EntriesPerdirection =1 but Entryhandling = EntryHandling.UniqueEntries;
          Last edited by dafonseca; 10-01-2016, 01:51 PM.

          Comment


            #6
            Hello dafonseca,

            if each strat buys and sell 1 contract. in case i want to let them trade freely, should I need to use EntriesPerDirection = 2;?
            or : EntriesPerdirection =1 but Entryhandling = EntryHandling.UniqueEntries;
            If you are still referring to having two separate strategies, no; EntriesPerdirection is specifically for that strategies instance and its entries. Each strategy has its own position and would be unaware of the orders placed by the other strategy. These properties delegate how many times you can enter in the same direction from only this strategy.

            If you are instead asking about after you combine the two strategies, the EntriesPerDirection could be used logically to allow conditions to enter multiple times in the same direction if the condition happens again while you have a position.

            The platform is not capable of sharing position information between strategies, this is why it is suggested to only run 1 strategy per instrument per account.

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

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by algospoke, Yesterday, 06:40 PM
            2 responses
            23 views
            0 likes
            Last Post algospoke  
            Started by ghoul, Today, 06:02 PM
            3 responses
            14 views
            0 likes
            Last Post NinjaTrader_Manfred  
            Started by jeronymite, 04-12-2024, 04:26 PM
            3 responses
            45 views
            0 likes
            Last Post jeronymite  
            Started by Barry Milan, Yesterday, 10:35 PM
            7 responses
            21 views
            0 likes
            Last Post NinjaTrader_Manfred  
            Started by AttiM, 02-14-2024, 05:20 PM
            10 responses
            181 views
            0 likes
            Last Post jeronymite  
            Working...
            X