MFE (Maximum Favorable Excursion) is calculated as the difference between your entry price and the most favorable price the trade reached before closing. For a long trade, take the highest price hit during the trade minus your entry price; for a short, take your entry price minus the lowest price reached.
Example: you go long at $50, the price peaks at $60, then you exit at $55, so your price MFE is $60 minus $50, which equals $10. To express it as position MFE in dollar terms, multiply by share or contract size.
Crucially, you need intraday price data between entry and exit to capture the peak; a simple list of open and close prices will not work. Journaling tools like Tradervue, TraderSync, and Trademetria compute MFE automatically.