Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

the last filled position

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

    the last filled position

    Hi, could You give me an advice:
    I want to see, that the last filled position closed with profit or not. (Was it a succesfull trade or not) What kind of object or interface shows it? (The script open a position, with stop loss. When it filled, I want to know, it was a successfull trade or not, because a counter will step up)
    Thank You for advance

    Akos

    #2
    Hello Akos,

    Thank you for your post.

    You could draw the value on the chart with DrawTextFixed(): http://www.ninjatrader.com/support/h...wtextfixed.htm

    And you would need to manually track the trades Position.GetProfitLoss() and store it in a variable that could be drawn with DrawTextFixed: http://www.ninjatrader.com/support/h...profitloss.htm

    Keep in mind that GetProfitLoss() is the unrealized PnL, so this will be nil once the position closes. We need to track this value in our custom double only when the Position.MarketPosition != MarketPosition.Flat: http://www.ninjatrader.com/support/h...etposition.htm

    Comment


      #3
      Hello PatrickH
      Thank You for answer, but I mean an object wich contains the parameters of last trades for ex. the opening price, the entry time, the closing price, exit time, the ID, and so. Is there an object like this? I think it would be same, wich we can see in the strategy analizer
      Best
      Akos

      Comment


        #4
        Hello Akos,

        You will want to review the material on the TradeCollection.

        Comment


          #5
          Hello Patrick
          Thank You, Now I see the way, the TradeCollection and the GetTrades() is the solution!!!
          Best regards
          Akos

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by argusthome, 03-08-2026, 10:06 AM
          0 responses
          61 views
          0 likes
          Last Post argusthome  
          Started by NabilKhattabi, 03-06-2026, 11:18 AM
          0 responses
          39 views
          0 likes
          Last Post NabilKhattabi  
          Started by Deep42, 03-06-2026, 12:28 AM
          0 responses
          21 views
          0 likes
          Last Post Deep42
          by Deep42
           
          Started by TheRealMorford, 03-05-2026, 06:15 PM
          0 responses
          23 views
          0 likes
          Last Post TheRealMorford  
          Started by Mindset, 02-28-2026, 06:16 AM
          0 responses
          51 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Working...
          X