Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Profit Calculation in Unmanaged orders

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

    Profit Calculation in Unmanaged orders

    Hi,

    From what it seems the PnL graph we get after a backtesting is more close to:

    Code:
    Performance.AllTrades.TradesPerformance.Currency.CumProfit+Position.GetProfitLoss(Close[0], PerformanceUnit.Currency)
    << Closed + Floating orders calculation

    and not just
    Code:
    Performance.AllTrades.TradesPerformance.Currency.CumProfit
    << Closed orders calculation only

    Is that correct ?


    Could you please tell me which of the two is more close to the graph we see at the end ? (Strategy analyzers-> Graphs Tab)

    Also very important:

    I read the TradesPerformance class description, however as the unmanaged orders have no signalling, is there a risk for error in calculating the profit ?

    I only say that because when working with unmanaged errors the results shown at the Orderst tab are erroneous (there is no signal management in orders and the system confuses the exit points, giving false payoffs).

    If that is the case we can only trust the Closed + Floating orders payoff collectively as anything else may be erroneous.

    Have you observed something like that ?

    Thanks in advance

    #2
    TakisTakis, at the end of your backtest the last potentially by strategy logic still open trade would be automatically closed so you would see CumProfit including this exit (ExitOnClose labelled).

    I'm not sure I follow on your backtest observation using unmanaged mode, while you can't tie the entries / exits via signal names together the pairing might be not what you expect, however the total generated points for example should be inline.
    BertrandNinjaTrader Customer Service

    Comment


      #3
      Thanks Bertrand,

      This is not a mission critical subject anyways, it is just I try to understand how NT caclulates profit. My observation show that the graph we are looking at, in the end of a backtesting (PnL) at each moment it reflects both closed orders profit and Open orders PnL and not just closed orders.

      I would like to confirm that. Thats all.

      Thank you again

      Comment


        #4
        Are you backtesting from the chart or in the Strategy Analyzer -

        a) the chart would not include your last open trade - it would take the last point where you were flat.

        b) the strategy analyzer would just close (offset) the last open trade and then generated the report for you.

        I'm not sure where you see open profit begin included in the reports, I would appreciate if you could explain so we can address it.

        Thanks
        BertrandNinjaTrader Customer Service

        Comment


          #5
          Ok,

          In strategy analyzer there are some tabs after a backtesting tabs -> Graphs

          There once a test is completed we can see how an algorihtm behaved trhoughout a time span eg. 1/1/2008-1/1/2009

          Then we can see how the cumulative profit fluctuated throughout the year.

          That is the variable I am examining:

          If I pick a date during that time span, the PnL I am looking at will it include both Closed and Open positions or only closed.

          From what it seems (based on data I print at the same time) it looks that it is the first case: both closed and open positions.

          This is critcal because if one works with unmanaged orders and one looks at the tab -> Trades, the matching of inpu and exit points is erroneous. However, there is nothing really wrong with the positions themselves, it is just that NT not having a signal system for unmanaged orders, does not know how to pair the orders and tells you that eg.

          tabs -> Trades
          Entry POint | Exit Point
          Order1 TP_Order 1
          Order 2 TP_Order 3
          Order 3 TP_Order 2

          In reality this does not happen as if one examines the Orders point we can see that the sequence of opening and closing orders is correct.

          However, if the Performance of closed orders is based on the mathcing of the orders NT will be erroneous about the exact amount. This is why it is important that the graph shows both closed and open, because then the graph will be correct

          Am I explaining things nicely ?

          Tell me what you think\

          Thanks in advance

          Comment


            #6
            TakisTakis,

            It shows closed positions only. Please note the Cumulative Profit graph is the cumulative realized profit as each trade is exited. If you are looking at the Periods tab, the Periods will contain information for all trades closed within that period. So if you are looking at monthly, the PnL for the trade will go into the month where the trade was closed even if the trade spanned several months.
            Josh P.NinjaTrader Customer Service

            Comment


              #7
              Ok. thanks for your answer.

              However, please notify your developers that there is an issue with that graph when working with unmanaged orders. I am working with multtiple orders opened in both directions and the system does not detect the correct exit points (please see below) and as a result this causes an erroneous closed orders profit. However, the total profit (open + closed orders) remains correct.

              Thank you for your help.

              Comment


                #8
                TakisTakis,

                Thank you for the note. It is on our feedback list. When you are backtesting all trades at the end of the backtest are closed. End of backtest results should be accurate.
                Josh P.NinjaTrader Customer Service

                Comment


                  #9
                  Thanks but really it would be much simpler if you had an option to relax the rules of the managed orders by providing a switch, so that we can open multiple positions or by adding some signalling in the unmanaged version. The whole profit calculation is almost impossible during runtime when working with multiple unmanaged orders for both direction.

                  There are so many beautiful features in NT like sharpe calculation, mae, mfe etc but they cannot be used with unmanaged because the realtime drawdown during simulation is off by miles. I have to write everything by hand...

                  Great job anyways for everything else.

                  Comment


                    #10
                    Hello,

                    I will have someone reply to you on Monday. Thank you for your patience.
                    DenNinjaTrader Customer Service

                    Comment


                      #11
                      Wow, I really did not expect for someone to answer the weekend. Thank for doing this! Again, the speed with which you guys answer, makes me respect NT even more.

                      I sure will be patient!

                      Comment


                        #12
                        TakisTakis, thanks for the patience and feedback on this - as I've replied to your other thread on the same issue as well your suggestions have been noted, but right now we're focused on stabilizing the beta to a point to roll out the production release - after this step we'll review the collected input.
                        BertrandNinjaTrader Customer Service

                        Comment

                        Latest Posts

                        Collapse

                        Topics Statistics Last Post
                        Started by geddyisodin, 04-25-2024, 05:20 AM
                        8 responses
                        58 views
                        0 likes
                        Last Post NinjaTrader_Gaby  
                        Started by jxs_xrj, 01-12-2020, 09:49 AM
                        4 responses
                        3,285 views
                        1 like
                        Last Post jgualdronc  
                        Started by Option Whisperer, Today, 09:55 AM
                        0 responses
                        5 views
                        0 likes
                        Last Post Option Whisperer  
                        Started by halgo_boulder, 04-20-2024, 08:44 AM
                        2 responses
                        22 views
                        0 likes
                        Last Post halgo_boulder  
                        Started by mishhh, 05-25-2010, 08:54 AM
                        19 responses
                        6,189 views
                        0 likes
                        Last Post rene69851  
                        Working...
                        X