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 Mindset, 04-21-2026, 06:46 AM
          0 responses
          117 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by M4ndoo, 04-20-2026, 05:21 PM
          0 responses
          166 views
          0 likes
          Last Post M4ndoo
          by M4ndoo
           
          Started by M4ndoo, 04-19-2026, 05:54 PM
          0 responses
          85 views
          0 likes
          Last Post M4ndoo
          by M4ndoo
           
          Started by cmoran13, 04-16-2026, 01:02 PM
          0 responses
          130 views
          0 likes
          Last Post cmoran13  
          Started by PaulMohn, 04-10-2026, 11:11 AM
          0 responses
          88 views
          0 likes
          Last Post PaulMohn  
          Working...
          X