Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Trades/PnL info from Indicator

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

    Trades/PnL info from Indicator

    Hello all,

    I need to display PnL info on a chart. The information includes daily/weekly/monthly total PnL.

    Is there any way to access the actual trade information from an indicator? Any thoughts on how this could be accomplished?

    Onn

    #2
    Hi Onn, unfortunately the total account info would not be supported for access via NinjaScript. Only a strategy could for example access it's own trades performance (historical or realtime).

    However for realtime executions seen for an account, you could attempt computing your own stats - http://www.ninjatrader.com/support/f...1&pp=15&sort=d

    Comment


      #3
      Interesting and thanks a lot for the link. The code you sent me makes use of the NinjaTrader.Cbi.Globals.Accounts and NinjaTrader.Cbi.Globals.Connections

      Are these documented anywhere?

      Comment


        #4
        You're welcome - unfortunately the Cbi's are not documented / supported as it's not official NinjaScript.

        Comment


          #5
          PnL display through indicator

          Hi Bertrand!

          I able to grab the market position as well as the average price coded within the indicator, but I currently striving for the PnL, I have coded it like this

          unrealizedProfitLoss = Instrument.MasterInstrument.Round2TickSize(selecte dacct.Positions.FindByInstrument(Instrument).GetPr ofitLoss(Closes[4][0], PerformanceUnit.Currency));

          but I come up with this error "The name" PerformanceUnit" does not exist in the current context". CS0103

          Do you have any suggestion for this?

          Comment


            #6
            I would unfortunately expect that, since this would be only exposed / usable for the strategy base class.

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Hwop38, 05-04-2026, 07:02 PM
            0 responses
            163 views
            0 likes
            Last Post Hwop38
            by Hwop38
             
            Started by CaptainJack, 04-24-2026, 11:07 PM
            0 responses
            313 views
            0 likes
            Last Post CaptainJack  
            Started by Mindset, 04-21-2026, 06:46 AM
            0 responses
            245 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Started by M4ndoo, 04-20-2026, 05:21 PM
            0 responses
            350 views
            0 likes
            Last Post M4ndoo
            by M4ndoo
             
            Started by M4ndoo, 04-19-2026, 05:54 PM
            0 responses
            179 views
            0 likes
            Last Post M4ndoo
            by M4ndoo
             
            Working...
            X