How can I call MfeTicks (I found this in help guide), i.e. Maximum Favorable Excursion in ticks, but I don't see anywhere in help the exact command how it is called.
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Call MfeTicks
Collapse
X
-
Hello UltraNIX,
Thank you for your post.
MfeTicks is a property of the Trade object which may access information about trades from the collection named RealTimeTrades. You may call the MfeTicks property by first checking to ensure there is at least one trade in the RealTimeTrades collection followed by calling Trade.MfeTicks.
I have posted an example below demonstrating how this could be accomplished.
protected override void OnBarUpdate()
{
if (SystemPerformance.RealTimeTrades.Count > 0)
{
// Check to make sure there is at least one trade in the collection
Trade lastTrade = SystemPerformance.RealTimeTrades[SystemPerformance.RealTimeTrades.Count - 1];
// Calculate the last Max Favorable Excursion in ticks
double lastMfeTicks = lastTrade.MfeTicks;
}
}
Please review this help guide link for more information about how Trade methods and properties could be used - https://ninjatrader.com/support/help...nt8/?trade.htm
Let us know if we may further assist.<span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>
-
So it cannot be used in backtest/optimization?
Then tell me the alternative (like logging highest high for longs and lowest low for shorts) that I could use in all modes, Optimization/Backtest included. I want to set up a conditional to exit trade if it moves X number of ticks against me from the best point in the trade.
Comment
-
Hello UltraNIX,
Thank you for your reply.
The TradeCollection SystemPerformance.AllTrades may be used instead of SystemPerformance.RealTimeTrades to get the MfeTicks value when backtesting or optimizing a strategy. Backtesting may done only using historical data. AllTrades could be used for backtesting/optimizations because it contains both historical and realtime trades whereas RealTimeTrades only contains trades that happen realtime.
Please see this help guide link about TradeCollections for more information - https://ninjatrader.com/support/help...collection.htm
Let us know if we may further assist.
<span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>
Comment
-
Are MaeTicks and MfeTicks only used in System Performance Real Time Trades? Or can they be used on a chart on historical trades too using System performance All Trades?Originally posted by NinjaTrader_BrandonH View PostHello UltraNIX,
Thank you for your post.
MfeTicks is a property of the Trade object which may access information about trades from the collection named RealTimeTrades. You may call the MfeTicks property by first checking to ensure there is at least one trade in the RealTimeTrades collection followed by calling Trade.MfeTicks.
I have posted an example below demonstrating how this could be accomplished.
protected override void OnBarUpdate()
{
if (SystemPerformance.RealTimeTrades.Count > 0)
{
// Check to make sure there is at least one trade in the collection
Trade lastTrade = SystemPerformance.RealTimeTrades[SystemPerformance.RealTimeTrades.Count - 1];
// Calculate the last Max Favorable Excursion in ticks
double lastMfeTicks = lastTrade.MfeTicks;
}
}
Please review this help guide link for more information about how Trade methods and properties could be used - https://ninjatrader.com/support/help...nt8/?trade.htm
Let us know if we may further assist.
Thanks.
Comment
-
Hello Trader17,
Thanks for your note.
MaeTicks and MfeTicks are properties of a Trade object. Trade objects could be in the SystemPerformance.RealTimeTrades collection or the SystemPerformance.AllTrades collection.
See this help guide for more information about SystemPerformance.AllTrades: https://ninjatrader.com/support/help.../alltrades.htm
Let us know if we may further assist.<span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by NullPointStrategies, Today, 05:17 AM
|
0 responses
44 views
0 likes
|
Last Post
|
||
|
Started by argusthome, 03-08-2026, 10:06 AM
|
0 responses
124 views
0 likes
|
Last Post
by argusthome
03-08-2026, 10:06 AM
|
||
|
Started by NabilKhattabi, 03-06-2026, 11:18 AM
|
0 responses
65 views
0 likes
|
Last Post
|
||
|
Started by Deep42, 03-06-2026, 12:28 AM
|
0 responses
42 views
0 likes
|
Last Post
by Deep42
03-06-2026, 12:28 AM
|
||
|
Started by TheRealMorford, 03-05-2026, 06:15 PM
|
0 responses
46 views
0 likes
|
Last Post
|

Comment