Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Unrealized Profit or Loss of Open Order

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

    Unrealized Profit or Loss of Open Order

    I want to adjust targets and stops based on the the number of ticks of unrealized gain in an open order. How can I get the unrealized gain or loss?

    #2
    Hello,

    Thank you for your forum post.

    I do not fully understand what your referencing here:

    number of ticks of unrealized gain

    Are you refering to counting the number of ticks that have occured since the order is live? Or do you just need the unrealized gain?

    What enter method did you use to enter the position?

    Are you using EnterLong() for example or unmanaged approach?

    I look forward to assisting you further.
    BrettNinjaTrader Product Management

    Comment


      #3
      Additional Information

      I am using either EnterLong or EnterShort.

      I want to move my target and stop programtically as price changes. How do I determine at what price the entry was executed?

      Thanks!

      Comment


        #4
        Hello,

        No problem.

        To do this you would use Position.AvgPrice.



        Let me know if I can be of further assistance.
        BrettNinjaTrader Product Management

        Comment


          #5
          If Multiple Orders?

          Since I could have multiple open orders is there a way to get the average price of a particular order? Another piece of useful information is determining if an order is still open. Is that available?

          Comment


            #6
            Hello,

            Checkout the IOrder class, this should do what your looking for. However this is starting to get into an unmanaged approach which is reserved for advanced programmers only.



            Let me know if I can be of further assistance.
            BrettNinjaTrader Product Management

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Geovanny Suaza, 02-11-2026, 06:32 PM
            0 responses
            648 views
            0 likes
            Last Post Geovanny Suaza  
            Started by Geovanny Suaza, 02-11-2026, 05:51 PM
            0 responses
            369 views
            1 like
            Last Post Geovanny Suaza  
            Started by Mindset, 02-09-2026, 11:44 AM
            0 responses
            108 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Started by Geovanny Suaza, 02-02-2026, 12:30 PM
            0 responses
            572 views
            1 like
            Last Post Geovanny Suaza  
            Started by RFrosty, 01-28-2026, 06:49 PM
            0 responses
            574 views
            1 like
            Last Post RFrosty
            by RFrosty
             
            Working...
            X