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 CarlTrading, 03-31-2026, 09:41 PM
            1 response
            82 views
            1 like
            Last Post NinjaTrader_ChelseaB  
            Started by CarlTrading, 04-01-2026, 02:41 AM
            0 responses
            43 views
            0 likes
            Last Post CarlTrading  
            Started by CaptainJack, 03-31-2026, 11:44 PM
            0 responses
            64 views
            2 likes
            Last Post CaptainJack  
            Started by CarlTrading, 03-30-2026, 11:51 AM
            0 responses
            68 views
            0 likes
            Last Post CarlTrading  
            Started by CarlTrading, 03-30-2026, 11:48 AM
            0 responses
            56 views
            0 likes
            Last Post CarlTrading  
            Working...
            X