Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

how do you get the current day's profit loss?

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

    how do you get the current day's profit loss?

    how do i grab the current day's profit/loss?

    #2
    Hello amedhussaini,

    Thank you for your post.

    You will need to work with the TradePerformance class to get this information.

    The following reference sample can help with using this class and resetting values at the start of the day:
    http://www.ninjatrader.com/support/f...ad.php?t=19289
    Ryan M.NinjaTrader Customer Service

    Comment


      #3
      NinjaTrader_RyanM,

      My system comes out with zero hits after I added the code to check ((Position.GetProfitLoss(Close[0], PerformanceUnit.Points) > 0). If I // that and make it comments, my strategy come out with a profit of 39180.00 and a 44% Profitable. Am I getting garbage in the input because those
      performance checks give my program zero results. I think it might be blowing up on if ((Position.MarketPosition != MarketPositon.Flat). I believe I need to add OnExecution(IExecution execution), and iOrder Routines, etc.

      Comment


        #4
        Hello William staton,

        Welcome to the NinjaTrader forums!

        Yes, if you have that check for your entries, then you will likely not get trades.

        If there is no PnL to check then no trades can be placed to generate PnL.

        Let us know what you're trying to do, share some more code and we can assist further.
        Ryan M.NinjaTrader Customer Service

        Comment


          #5
          Position.GetProfitLoss(Close[0]

          NinjaTrader_RyanM,

          You were right! I did the test after i did a buy or sell and then I was able to interrigate the Position GetProfitLoss(Close[0] and it ddn't blow up. Thanks. Now, since I've implemented the code I'm close to 50%, but my profits are going down. I'm using the
          Back101 test data. I was trying to use the SIM101 account. I put my userid, password, for Mirus Futures, and I couldn't find the SIM101 Account. How do I get to the SIM101 Account? Do I have to have Mirus give me one? Thanks for your help.

          Comment


            #6
            Hello William,

            Please see my response to the email you sent us below.

            The sim101 account should be listed in NinjaTrader. However it will not be listed in the Strategy Analyzer, instead it will list the Back101 account.

            If you open up a SuperDOM, it should list the sim101 account.

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by charlesugo_1, 05-26-2026, 05:03 PM
            0 responses
            55 views
            0 likes
            Last Post charlesugo_1  
            Started by DannyP96, 05-18-2026, 02:38 PM
            1 response
            142 views
            0 likes
            Last Post NinjaTrader_ChelseaB  
            Started by CarlTrading, 05-11-2026, 05:56 AM
            0 responses
            160 views
            0 likes
            Last Post CarlTrading  
            Started by CarlTrading, 05-10-2026, 08:12 PM
            0 responses
            96 views
            0 likes
            Last Post CarlTrading  
            Started by Hwop38, 05-04-2026, 07:02 PM
            0 responses
            276 views
            0 likes
            Last Post Hwop38
            by Hwop38
             
            Working...
            X