Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Performance Stats: real MAE and MFE ?

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

    Performance Stats: real MAE and MFE ?

    I am confused about the "average" part of the MFE and MAE calculations.

    They are supposed to be measures of the maximum profit and risk of a trade, so the calculations should be tracking the quantity as well as the price to account for scaling in and out.

    But the calculations provided in the documentation don't seem to track quantity at all.

    Is there some way of getting the actual values?

    thanks.

    #2
    Hello,

    Can you please clarify the issue with the calculations a bit further? For the definitions listed in the help guide, I'm seeing Quantity included in the formulas for both:



    Examples:

    MFE Points mode: SUM(MFE * quantity) of all trades / # of trades
    MAE Points mode: SUM(MAE * quantity) of all trades / # of trades
    Dave I.NinjaTrader Product Management

    Comment


      #3
      Sure. I want to get the individual trade stat correct first, so I'm considering only one trade here.

      There are 2 ways of calculating MAE/MFE:

      1) Price MAE = max excursion of price, disregarding quantity altogether. This is useful for assessing your entries, and all you need if you are an all-in / all-out trader.

      2) Position MAE = max value of ( price excursion at Time t * quantity at Time t). This tells you the actual maximum risk of your trade, and is needed to assess your management if you scale in or out.

      It isn't clear from the formula what 'quantity' represents, and if it is the maximum quantity of the position, then the calculation is incorrect.
      Also, in the case of a position that is being built using scaling in and out, it isn't clear how MAE is being calculated.

      I can do this by writing my own indicator to track positions, but it seems like something that ought to be done in NT's performance stats.
      Last edited by palinuro; 01-20-2016, 09:06 PM.

      Comment


        #4
        Thank you for clarifying. When calculating the base MAE (before calculating the average MAE), each trade is broken into an entry execution and an exit execution. It is the quantity of the entry execution, specifically, which is used to calculate the MAE by trade.

        Does that fit in line with what you would expect? If not, I'll be happy to save any notes you have on how to adjust the formula, and log them as a feature request.
        Dave I.NinjaTrader Product Management

        Comment


          #5
          Originally posted by NinjaTrader_Dave View Post
          Thank you for clarifying. When calculating the base MAE (before calculating the average MAE), each trade is broken into an entry execution and an exit execution. It is the quantity of the entry execution, specifically, which is used to calculate the MAE by trade.

          Does that fit in line with what you would expect? If not, I'll be happy to save any notes you have on how to adjust the formula, and log them as a feature request.
          Maybe you should be using the Exit quantities instead. That automatically takes care of the logic of scaling out.

          Comment


            #6
            Originally posted by koganam View Post
            Maybe you should be using the Exit quantities instead. That automatically takes care of the logic of scaling out.
            Thanks for the idea, but I don't think so, it would just give a different error, equally misleading for understanding position MAE/MFE.

            It really needs to be tracked properly through the life of the trade.

            Comment


              #7
              Originally posted by palinuro View Post
              Thanks for the idea, but I don't think so, it would just give a different error, equally misleading for understanding position MAE/MFE.

              It really needs to be tracked properly through the life of the trade.
              Run an example using manual arithmetic, and you will see why it IS automatically handled. After all, the trade is only complete when it is exited. No matter our preference, as far as the funds are concerned, the trade is made up of the exit which followed the entry, and the quantity thereof.

              And if you want accurate results, you are going to have to track it as the trades develop. This has been a somewhat long-standing complaint until now.

              ref: http://ninjatrader.com/support/forum...int#post443464
              Last edited by koganam; 01-22-2016, 01:02 PM.

              Comment


                #8
                Tracking based on exit quantity is certainly something to think about. We would have to consider any downstream effects (how do we handle the second, third exits tied to the same entry? etc.), but I will note the suggestion to look further into it. (SFT-1079)
                Last edited by NinjaTrader_DaveI; 01-22-2016, 12:00 PM.
                Dave I.NinjaTrader Product Management

                Comment


                  #9
                  Originally posted by koganam View Post
                  Run an example using manual arithmetic. you will see why it IS automatically handled. After all, the trade is only complete when it is exited. No matter our preference, as far as the funds are concerned, the trade is made up of the exit which followed the entry, and the quantity thereof.

                  And if you want accurate results, you are going to have to track it as the trades develop. This has been a somewhat long-standing complaint until now.

                  ref: http://ninjatrader.com/support/forum...int#post443464
                  That's the whole problem with it.

                  Entering 3 contracts as a trade unit, with exiting 3 is treated as 1 trade in NT.

                  If entering 3 as a trade unit, and exiting 2 at one level and 1 at another level - is treated as 2 trades.

                  If entering 3 as a trade unit, and exiting 1 at one level and 1 at another level, and 1 at another level is treated as 3 trades!!

                  If anything, all 3 should be treated as 3 trades.

                  If anything, I think I'd prefer 1 trade, with the average price of the 3 used on exit.

                  Comment


                    #10
                    Originally posted by sledge View Post
                    That's the whole problem with it.

                    Entering 3 contracts as a trade unit, with exiting 3 is treated as 1 trade in NT.

                    If entering 3 as a trade unit, and exiting 2 at one level and 1 at another level - is treated as 2 trades.

                    If entering 3 as a trade unit, and exiting 1 at one level and 1 at another level, and 1 at another level is treated as 3 trades!!

                    If anything, all 3 should be treated as 3 trades.

                    If anything, I think I'd prefer 1 trade, with the average price of the 3 used on exit.
                    (emphasis mine).

                    That is actually the logical truth, and it takes care of all intra trade movements, if tracked by exit.

                    Let us take the most likely scenario: 1 (apparent entry) of 3 contracts, 3 exits of one each, at different prices.

                    Let us then postulate some price movement and the trade, and we shall see why tracking by exit takes care of every measure.

                    3 contracts long at 1000. (nice round numbers).

                    1. Price goes directly to 1003.
                    Exit one contract.
                    MFE = 3
                    MAE = 0
                    on the contract we exited. We have not exited any other, so we do not calculate. The trade on the other 2 contracts is still on, so we do not yet know the final measures.

                    2. Price goes to 1005, then retreats to 999, then comes back to 1006.
                    We exit another contract.
                    MFE = 6
                    MAE = 1
                    on that one contract.

                    3. Price goes to 1008, then retreats to 998, then goes back to 1005, and we exit the last contract. (Reversal condition, trailing stop, whatever).
                    MFE = 8
                    MAE = 2
                    on one contract.

                    All because we track and calculate each trade only after it exits, so we can tell the travel for that particular contract, regardless whatever happened to any other contract. If the scaleouts are multiple contracts, then multiply with the appropriate quantity before the averages etc.,

                    Please ignore if anyone would hold over such a large drawdown: I am just illustrating the principle.

                    In any case, regardless the numbers, that is how I think and believe that trade statistics should be tracked, which is why my autotraders all do it that way, in the code.

                    palinuro, this was an example of the manual arithmetic that I was talking about. I just did not have enough time when writing that earlier post.
                    Last edited by koganam; 01-22-2016, 01:10 PM.

                    Comment


                      #11
                      The NT team are aware of the issues within their platform on this subject.

                      http://ninjatrader.com/support/forum...ad.php?t=78107

                      Comment


                        #12
                        This was an issue in NT7 also, but became worse in NT8.

                        Comment


                          #13
                          koganam, thanks for taking the time for the detailed example. That approach will of course give the price MAE/MFE for each contract, though there is no way of deriving the position MAE/MFE from the final per contract results.

                          But while I'm sure we can all do it manually, or write our own code to do it, the idea is to have NT 8 do it automatically. And it doesn't actually do it that way either; you can't rely on its statistics even for individual contracts.

                          I did a quick example yesterday of a simple trade with 2 contracts. I scaled in, waited for price to wiggle around, exited 1 contract, waited for price to wiggle around some more, then exited the second.

                          I generated 2 performance reports (attached), one immediately after exiting the first contract, the second after closing the trade.

                          It looks from the final performance report as if NT treats each contract as a separate trade, but while that is true for the Profit, it isn't true for MAE/MFE. Once the trade is closed the stats for the first contract are recalculated based on what happened after the contract was exited. (i.e., the MAE for the first contract actually includes a further adverse excursion that occurred after that contract was closed out). The same goes for MFE.

                          So it doesn't provide accurate per contract statistics from any position involving scaling. (I did the same thing for an all-in scale-out trade, and got the same calculation problems.)

                          Also, both the MAE and the MFE stats are off by 1 tick (!). If I enter short at 1891.00 and price goes to 1892.00, that's 1.00 of heat, not 0.75. At least, that's what my broker thinks.

                          I don't know if there's much point in going on to discuss position MAE/MFE unless these problems are straightened out first.
                          Attached Files

                          Comment


                            #14
                            Originally posted by palinuro View Post
                            koganam, thanks for taking the time for the detailed example. That approach will of course give the price MAE/MFE for each contract, though there is no way of deriving the position MAE/MFE from the final per contract results.
                            Which is what I'm saying...

                            I think..

                            Comment


                              #15
                              Originally posted by shuglu View Post
                              The NT team are aware of the issues within their platform on this subject.

                              http://ninjatrader.com/support/forum...ad.php?t=78107
                              See also this thread:

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by inanazsocial, Today, 01:15 AM
                              1 response
                              5 views
                              0 likes
                              Last Post NinjaTrader_Jason  
                              Started by rocketman7, Today, 02:12 AM
                              0 responses
                              6 views
                              0 likes
                              Last Post rocketman7  
                              Started by dustydbayer, Today, 01:59 AM
                              0 responses
                              1 view
                              0 likes
                              Last Post dustydbayer  
                              Started by trilliantrader, 04-18-2024, 08:16 AM
                              5 responses
                              23 views
                              0 likes
                              Last Post trilliantrader  
                              Started by Davidtowleii, Today, 12:15 AM
                              0 responses
                              3 views
                              0 likes
                              Last Post Davidtowleii  
                              Working...
                              X