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 cls71, Today, 04:45 AM
          0 responses
          1 view
          0 likes
          Last Post cls71
          by cls71
           
          Started by mjairg, 07-20-2023, 11:57 PM
          3 responses
          213 views
          1 like
          Last Post PaulMohn  
          Started by TheWhiteDragon, 01-21-2019, 12:44 PM
          4 responses
          544 views
          0 likes
          Last Post PaulMohn  
          Started by GLFX005, Today, 03:23 AM
          0 responses
          3 views
          0 likes
          Last Post GLFX005
          by GLFX005
           
          Started by XXtrader, Yesterday, 11:30 PM
          2 responses
          12 views
          0 likes
          Last Post XXtrader  
          Working...
          X