Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Multiple Entries per same named entry

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

    Multiple Entries per same named entry

    Hello,

    I have multiple entries for the same named entry, "EnterLong(1, "EnL"). This will submit multiple orders, per my strategy, under the same entry name "EnL".

    Is there a way to identify specific trades under the same entry name?

    Or, put another way...

    I have 3 open orders executed via "EnterLong(1, "")". How can I refer to or identify each of the 3 trades separately? Do they each have a unique orderID or trade ID?

    Thanks,
    eleven
    Last edited by eleven; 06-27-2022, 11:15 PM.

    #2
    Hello eleven,

    Thanks for your post.

    There are no means for getting the Unrealized PnL of individual entry orders that were placed. Position.GetUnrealizedProfitLoss could be used to get the Unrealized PNL of the entire strategy position.

    If you would like the Unrealized PnL of a single entry order, you would need to calculate this value yourself in your code.

    Something you could consider is to calculate that value by using either the Close price at the time of the entry or the entry's average price, then calculate that value from the current Close price.

    Let me know if I may assist further.
    <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


      #3
      Thanks Brandon. Does each entry order have a unique ID? How can I identify each order entered? Multiple entry orders have same entry name in my strategy.

      eleven

      Comment


        #4
        Hello eleven,

        Thanks for your note.

        You could consider tracking orders in OnExecutionUpdate or OnOrderUpdate. However, it would likely be easier to provide a unique signal name for each unique entry you wanted to track.

        See this reference sample which demonstrates using OnExecutionUpdate and OnOrderUpdate: https://ninjatrader.com/support/help...and_onexec.htm

        Also, see the help guide documentation below.

        OnOrderUpdate: https://ninjatrader.com/support/help...rderupdate.htm

        OnExecutionUpdate: https://ninjatrader.com/support/help...tionupdate.htm

        Let me know if I may assist further.
        <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
        53 views
        0 likes
        Last Post NullPointStrategies  
        Started by argusthome, 03-08-2026, 10:06 AM
        0 responses
        130 views
        0 likes
        Last Post argusthome  
        Started by NabilKhattabi, 03-06-2026, 11:18 AM
        0 responses
        70 views
        0 likes
        Last Post NabilKhattabi  
        Started by Deep42, 03-06-2026, 12:28 AM
        0 responses
        44 views
        0 likes
        Last Post Deep42
        by Deep42
         
        Started by TheRealMorford, 03-05-2026, 06:15 PM
        0 responses
        49 views
        0 likes
        Last Post TheRealMorford  
        Working...
        X