Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

The simplest way to calculate commissions

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

    The simplest way to calculate commissions

    Hello

    Suppose, I have opened position. It may be a result of several entries (e.g. 1 Buy, then 2 Buys, then 1 Buy again etc). I want to know which commission was taken from me for current position. What is the best way to calculate it?

    And the other question, Suppose I have TP/SL for this position. I want to know what commission will be taken from me when TP or SL is triggered

    I know that broker may have different commissions: per contract or per trade. So, my calculation musttake it into account

    Thanks in advance

    #2
    Hello rfsettling,

    This would need to be tracked with custom logic.

    You could add the entries to an array or list and then use count to count the number of entries and multiply this by the commission amount.
    The entries would need to be removed when the position is exited.

    When the trade is exited the trade will be added to the SystemPerformance collection.

    I'm not aware of any examples with custom logic of tracking the number of entries that have filled in a position or calculating the commission before the trade has exited.

    However, this thread will remain open for any community members that would like to design this custom logic as a convenience to you.

    You can also contact a professional NinjaScript Consultant who would be eager to create or modify this script at your request or assist you with your script. The NinjaTrader Ecosystem has affiliate contacts who provide educational as well as consulting services. Please let me know if you would like our business development follow up with you with a list of affiliate consultants who would be happy to create this script or any others at your request.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Hello, Chelsea

      In order calculate future exit commission, I need to get information about commission rules for my account. I looked into Account guide and have not found anything about commission.

      https://ninjatrader.com/support/help...ount_class.htm

      Could you point me out, how I can get commission information for current Account?

      Comment


        #4
        Hello rfsettling,

        We do not have any available documentation on accessing the Risk or Commission objects through the Account object, and thus would not be able to support its usage through NinjaScript. We are tracking interest in this, through. The feature request has the ticket ID SFT-1645 and I will submit a vote on your behalf.

        As with other feature requests, we cannot present an ETA as they are fulfilled based on the development team's schedule and priorities. Upon implementation the ticket ID can be publicly found on the Release Notes page of the help guide. I'll provide a link below.

        Release Notes: https://ninjatrader.com/support/help...ease_notes.htm

        In addition to calculating by subtracting a trades unrealized PnL from the closed PnL which would have commission applied, you could access the commission of an Execution in OnExcutionUpdate() to obtain the commission used in the execution, however. I'll provide openly available documentation links below.

        Execution - https://ninjatrader.com/support/help.../execution.htm

        OnExecutionUpdate() - https://ninjatrader.com/support/help...tionupdate.htm
        Last edited by NinjaTrader_Jim; 11-27-2017, 08:36 AM.
        JimNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by lismartin, Yesterday, 04:47 PM
        1 response
        15 views
        0 likes
        Last Post NinjaTrader_Jesse  
        Started by facuevasm, Today, 07:28 AM
        1 response
        4 views
        0 likes
        Last Post NinjaTrader_Jesse  
        Started by ballston, Today, 06:32 AM
        0 responses
        8 views
        0 likes
        Last Post ballston  
        Started by Lando Calrissian, Today, 07:30 AM
        0 responses
        4 views
        0 likes
        Last Post Lando Calrissian  
        Started by Leeroy_Jenkins, Today, 03:45 AM
        0 responses
        13 views
        0 likes
        Last Post Leeroy_Jenkins  
        Working...
        X