Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Issue with try to open multiple long positions to average down

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

    Issue with try to open multiple long positions to average down

    Hello,

    I'm hoping there is a simple answer to this but I've been pulling my hair out as to why it won't trigger. What I want to do is when a condition is met, enter a single long position, as soon as this order is placed, then I want to enter a limit order to buy 2 more long entries if the price drops 20 ticks below, bringing my entry price down. this is the 2 lines in my code :-

    EnterLong(1, "Long Entry");
    EnterLongLimit(2, PositionAccount.AveragePrice + TickSize * 20, "Long Entry 1");

    What I'm finding is the first EnterLong works, but the limit order for the next one isn't placed at all - what would cause this not to be placed? is it because there's already a long position, so it won't enter another?

    Is there a way I can get this to enter another long position?

    Many thanks for your help

    Andy

    #2
    I fixed the issue, I'll leave this post here incase anyone else comes across it ..... it was because "Entries per direction" in the strategy setting was set to 1!

    Comment


      #3
      Hello ravvles,

      Thanks for your notes.

      I am happy to hear you were able to resolve your questions.

      EntriesPerDirection and EntryHandling could be used to control the maximum number of entries allowed per direction while a position.

      If you set Entry Handling to EntryHandling.AllEntries, NinjaScript will process all entry order methods up to the maximum allowable entries set in the EntriesPerDirection property. For example, if you set EntriesPerDirection to 3 and use EntryHandling.AllEntries, up to a total of 3 entry orders will process.

      If you set Entry Handling to EntryHandling.UniqueEntries, NinjaScript will process order entry methods up to the maximum allowable entries set by the EntriesPerDirection property for each uniquely named entry. For example, if you have two entry order methods using unique signal names ("entry1" and "entry2"), set EntriesPerDirection to 3, and use EntryHandling.UniqueEntries, a maximum number of 3 entry orders will process for each uniquely named entry order (up to 3 orders for "entry1" and 3 orders for "entry2").

      See the help guide documentation below for more information.

      EntriesPerDirection: https://ninjatrader.com/support/help...rdirection.htm

      EntryHandling: https://ninjatrader.com/support/help...ryhandling.htm
      <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by NullPointStrategies, Today, 05:17 AM
      0 responses
      50 views
      0 likes
      Last Post NullPointStrategies  
      Started by argusthome, 03-08-2026, 10:06 AM
      0 responses
      126 views
      0 likes
      Last Post argusthome  
      Started by NabilKhattabi, 03-06-2026, 11:18 AM
      0 responses
      69 views
      0 likes
      Last Post NabilKhattabi  
      Started by Deep42, 03-06-2026, 12:28 AM
      0 responses
      42 views
      0 likes
      Last Post Deep42
      by Deep42
       
      Started by TheRealMorford, 03-05-2026, 06:15 PM
      0 responses
      46 views
      0 likes
      Last Post TheRealMorford  
      Working...
      X