I have used "IncludeCommission = false" in my strategy but it doesn't work. For example, when the strategy buy and sell with the same price the value of lastTrade.ProfitTicks it's a decimal number equal to the commission of the broker, and it would be equal to zero.
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
IncludeCommission doesn't work
Collapse
X
-
IncludeCommission doesn't work
Hello,
I have used "IncludeCommission = false" in my strategy but it doesn't work. For example, when the strategy buy and sell with the same price the value of lastTrade.ProfitTicks it's a decimal number equal to the commission of the broker, and it would be equal to zero.Tags: None
-
Hello soyjesus,
Thank you for your note.
IncludeCommission would only affect the behavior of the strategy in a historical backtest, either on historical data in a chart or in the Strategy Analyzer for a backtest. Are you running the strategy in real time on the Sim account or are you looking at a backtest in the Strategy Analyzer?
Thanks in advance; I look forward to assisting you further.
-
Hello soyjesus,
Thank you for your reply.
Try adding the commissions back to the profit:
Please let us know if we may be of further assistance to you.Code:// Accesses the last trade in the strategy // and prints out the gross profit to the output window if (SystemPerformance.AllTrades.Count > 1) { Trade lastTrade = SystemPerformance.AllTrades[SystemPerformance.AllTrades.Count - 1]; Print("The last trade gross profit is " + (lastTrade.ProfitCurrency + lastTrade.Commission)); }
- Likes 1
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by NullPointStrategies, Yesterday, 05:17 AM
|
0 responses
53 views
0 likes
|
Last Post
|
||
|
Started by argusthome, 03-08-2026, 10:06 AM
|
0 responses
130 views
0 likes
|
Last Post
by argusthome
03-08-2026, 10:06 AM
|
||
|
Started by NabilKhattabi, 03-06-2026, 11:18 AM
|
0 responses
70 views
0 likes
|
Last Post
|
||
|
Started by Deep42, 03-06-2026, 12:28 AM
|
0 responses
44 views
0 likes
|
Last Post
by Deep42
03-06-2026, 12:28 AM
|
||
|
Started by TheRealMorford, 03-05-2026, 06:15 PM
|
0 responses
49 views
0 likes
|
Last Post
|

Comment