Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Commission on current instrument

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Commission on current instrument

    How do I determine what the RT commission is for a given position/instrument?

    Code:
    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]
      }

    #2
    Hello emini.ninja,

    You can likely use the p Position objects GetUnrealizedProfitLoss for that purpose. There is a general sample with a Position in the following page:



    I look forward to being of further assistance.

    Comment


      #3
      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


        #4
        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.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        648 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        369 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        108 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        572 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        574 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X