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 junkone, Today, 11:37 AM
          2 responses
          13 views
          0 likes
          Last Post junkone
          by junkone
           
          Started by frankthearm, Yesterday, 09:08 AM
          12 responses
          43 views
          0 likes
          Last Post NinjaTrader_Clayton  
          Started by quantismo, 04-17-2024, 05:13 PM
          5 responses
          35 views
          0 likes
          Last Post NinjaTrader_Gaby  
          Started by proptrade13, Today, 11:06 AM
          1 response
          7 views
          0 likes
          Last Post NinjaTrader_Clayton  
          Started by love2code2trade, 04-17-2024, 01:45 PM
          4 responses
          35 views
          0 likes
          Last Post love2code2trade  
          Working...
          X