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

2 Orders in Same Direction

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

    2 Orders in Same Direction

    I am having an issue with TD Ameritrade not accepting Take Profit orders so I am trying to create and then manage 2 orders separately. In using the simulator to test this, the second order is NOT being created. 2 questions:
    1) Is this concept allowed?
    2) Is there a setting I need to trigger before it can work?

    The code in the strategy looks like this (I used the condition builder to create this):
    // Condition set 1
    if (Close[1] < Close[0]
    && Position.MarketPosition == MarketPosition.Flat)
    {
    EnterLong(NumSharesA, "Regular Long A");
    EnterLong(NumSharesB, "Regular Long B");
    }

    #2
    Hello cpabiz20k,

    I would recommend you do testing first with the Sim101 to avoid opening unprotected positions with your live account.

    With the strategy, what is EntryHandling and EntriesPerDirection set to?

    Yes, it is allowed to place two entry orders in the same direction at the same time as long as EntriesPerDirection is 2 or higher.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      That allowed the total quantity to enter as an order in Sim101 - however, it grouped the two of them together into one order an did not give it them a distinct name. Any recommendations or settings I am overlooking?
      Thanks

      Comment


        #4
        Hello cpabiz20k,

        The EntryHandling and EntriesPerDirection will not involve quantity in any way.
        This only focuses on the number of separate entry orders.

        I wasn't able to confirm. What was EntriesPerDirection set to before you added the instance of the strategy?

        Below is a video demonstrating this works as intended.



        It's possible you've changed the code in State.SetDefaults and you have not added a new instance so none of the defaults will be taken.
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          Perfect video - thanks for that! I will restart everything and see where that gets me.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by algospoke, Today, 06:40 PM
          0 responses
          9 views
          0 likes
          Last Post algospoke  
          Started by maybeimnotrader, Today, 05:46 PM
          0 responses
          7 views
          0 likes
          Last Post maybeimnotrader  
          Started by quantismo, Today, 05:13 PM
          0 responses
          7 views
          0 likes
          Last Post quantismo  
          Started by AttiM, 02-14-2024, 05:20 PM
          8 responses
          168 views
          0 likes
          Last Post jeronymite  
          Started by cre8able, Today, 04:22 PM
          0 responses
          10 views
          0 likes
          Last Post cre8able  
          Working...
          X