foreach (Position p in account.Positions) {[INDENT]if (p.MarketPosition != MarketPosition.Flat) {[/INDENT][INDENT=2]Print("RT commission for this position is : " + [COLOR=#e74c3c][I]<where do I get this value from?>[/I][/COLOR])[/INDENT][INDENT]}[/INDENT] }
Announcement
Collapse
Looking for a User App or Add-On built by the NinjaTrader community?
Visit NinjaTrader EcoSystem and our free User App Share!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less
Partner 728x90
Collapse
NinjaTrader
Commission on current instrument
Collapse
X
-
Commission on current instrument
How do I determine what the RT commission is for a given position/instrument?
Code:Tags: None
-
But doesn't the GetUnrealizedProfitLoss() method return P/L without applying round-trip commissions? I am interested in the commission for whichever position is open so I can calculate true P/L.
Comment
-
Hello emini.ninja,
To clarify my reply was based on the code you provided and working with the Position object. You would not be able to access commission information from the Position, that is not where the commission is applied. The commission is associated with the Executions. If you wanted to know the commission by looping through the positions you would need to collect information like the Instrument and then use a commission based on that instrument in your calculations. I am not aware of any way to access the commission template, this would be something you would hard code.
If you were using the execution information the execution has a Commission property. https://ninjatrader.com/support/help...executions.htm
Please let me know if I may be of further assistance.JesseNinjaTrader Customer Service
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by fwendolynlpxz, Today, 05:19 AM
|
0 responses
1 view
0 likes
|
Last Post Today, 05:19 AM | ||
Started by traderqz, Yesterday, 12:06 AM
|
11 responses
27 views
0 likes
|
Last Post Today, 05:11 AM | ||
Started by PaulMohn, Today, 03:49 AM
|
0 responses
8 views
0 likes
|
Last Post
by PaulMohn
Today, 03:49 AM
|
||
Started by inanazsocial, Today, 01:15 AM
|
1 response
10 views
0 likes
|
Last Post Today, 02:18 AM | ||
Started by rocketman7, Today, 02:12 AM
|
0 responses
11 views
0 likes
|
Last Post
by rocketman7
Today, 02:12 AM
|
Comment