Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Question on using MFE function to collect stats without trading?

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

    Question on using MFE function to collect stats without trading?

    Hello,

    I am wondering if you can collect stats on various things by using an MFE function or something similar?

    So for example you wanted to collect a stat after a 2 Bars with Higher Highs are formed, took that second High as a start point, and tracked how far DOWN price moved over some sample size.

    Or if you wanted to know how far UP price moved after a moving average crossover?

    I've done basic stats capturing in this way before, outputed them, and ported into excel for analysis. But I am wanting to use an MFE function or similar because "UP" or "Down" is a subjective term, so I can't think of a way to tell the script a measure of "Down" or "Up." I am wondering if the MFE or similar function might take care of that for me?

    #2
    Hi forrestang,

    The MFE calculation is used in performance reporting for trades made backtesting/realtime. We do not support accessing it for your custom calculations, but you're free to explore intellisense and see if it offers what you're looking for.

    It may work better to take the definition and custom code something for the situation you're looking to calculate.

    MFE (max. favorable excursion) is defined as (best price trade reached – entry price), quantity is defined as the number of contracts traded, and point value is defined as the monetary conversion of each point (e.g. 100 for currency pairs).

    Best / Worst depends on the direction of the trade (long or short), and would use Highs or Lows to catch the extremes. You will basically need a starting point to identify where you want to lookback, and can use built in functions MAX(), MIN() to get highest /lowest values over a series of bars.
    Ryan M.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    574 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    332 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    101 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    553 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    551 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X