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 Mindset, 04-21-2026, 06:46 AM
|
0 responses
89 views
0 likes
|
Last Post
by Mindset
04-21-2026, 06:46 AM
|
||
|
Started by M4ndoo, 04-20-2026, 05:21 PM
|
0 responses
135 views
0 likes
|
Last Post
by M4ndoo
04-20-2026, 05:21 PM
|
||
|
Started by M4ndoo, 04-19-2026, 05:54 PM
|
0 responses
68 views
0 likes
|
Last Post
by M4ndoo
04-19-2026, 05:54 PM
|
||
|
Started by cmoran13, 04-16-2026, 01:02 PM
|
0 responses
119 views
0 likes
|
Last Post
by cmoran13
04-16-2026, 01:02 PM
|
||
|
Started by PaulMohn, 04-10-2026, 11:11 AM
|
0 responses
69 views
0 likes
|
Last Post
by PaulMohn
04-10-2026, 11:11 AM
|

Comment