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 CarlTrading, 03-31-2026, 09:41 PM
|
1 response
47 views
0 likes
|
Last Post
|
||
|
Started by CarlTrading, 04-01-2026, 02:41 AM
|
0 responses
23 views
0 likes
|
Last Post
by CarlTrading
04-01-2026, 02:41 AM
|
||
|
Started by CaptainJack, 03-31-2026, 11:44 PM
|
0 responses
33 views
1 like
|
Last Post
by CaptainJack
03-31-2026, 11:44 PM
|
||
|
Started by CarlTrading, 03-30-2026, 11:51 AM
|
0 responses
51 views
0 likes
|
Last Post
by CarlTrading
03-30-2026, 11:51 AM
|
||
|
Started by CarlTrading, 03-30-2026, 11:48 AM
|
0 responses
42 views
0 likes
|
Last Post
by CarlTrading
03-30-2026, 11:48 AM
|

Comment