Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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
    BertrandNinjaTrader Customer Service

    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.
        BertrandNinjaTrader Customer Service

        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.
            BertrandNinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Max238, Today, 01:28 AM
            1 response
            22 views
            0 likes
            Last Post CactusMan  
            Started by giulyko00, Yesterday, 12:03 PM
            2 responses
            10 views
            0 likes
            Last Post giulyko00  
            Started by r68cervera, Today, 05:29 AM
            0 responses
            4 views
            0 likes
            Last Post r68cervera  
            Started by geddyisodin, Today, 05:20 AM
            0 responses
            6 views
            0 likes
            Last Post geddyisodin  
            Started by JonesJoker, 04-22-2024, 12:23 PM
            6 responses
            38 views
            0 likes
            Last Post JonesJoker  
            Working...
            X