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!
See more
See less

Partner 728x90

Collapse

Get commission by code

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

    Get commission by code

    Hello
    Is it possible to get commission by code in an indicator ?
    Thx

    #2
    Try this code snipped
    var commissionPerUnit = Account.Commission.ByMasterInstrument[Instrument.MasterInstrument].PerUnit;
    sidlercom80
    NinjaTrader Ecosystem Vendor - Sidi Trading

    Comment


      #3
      thank you, once again a fast and quality help

      Comment


        #4
        Hello bicou,

        Thanks for your post.

        Account.Get() could be used to get the AccountItem.Commission value of an account.

        See the help guide documentation below for more information.

        Account: https://ninjatrader.com/support/help...ount_class.htm
        Account.Get(): https://ninjatrader.com/support/helpGuides/nt8/get.htm
        AccountItem: https://ninjatrader.com/support/help...ccountitem.htm
        Brandon H.NinjaTrader Customer Service

        Comment


          #5
          Hello,

          When I call to AccountItem.Commission from my strategie I get a different value that the value of "Trade Performance". Where could be the issue? Thank in advance and regards.

          Comment


            #6
            Hello soyjesus,

            The AccountItem.Commission would be the total commission for the account for the trading day.

            The TradePerformance may be showing commissions for previous days and may or may not be including trades for the account on the trading day.
            Chelsea B.NinjaTrader Customer Service

            Comment


              #7
              Ok, but I have filtered the TradePerformance exclusively to today. And then, I compare it with AccountItem.Commission and I get the difference. And both numbers are not the same.

              Comment


                #8
                If multi provider is enabled try this method described later in this thread: https://forum.ninjatrader.com/forum/...injascript-nt8.

                Bear in mind, this may not work. It is unsupported. And if you're operating with multi provider disabled, it will definitely not work because in that environment the commissions are server-side.
                Bruce DeVault
                QuantKey Trading Vendor Services
                NinjaTrader Ecosystem Vendor - QuantKey

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by llanqui, Today, 03:53 AM
                0 responses
                2 views
                0 likes
                Last Post llanqui
                by llanqui
                 
                Started by burtoninlondon, Today, 12:38 AM
                0 responses
                10 views
                0 likes
                Last Post burtoninlondon  
                Started by AaronKoRn, Yesterday, 09:49 PM
                0 responses
                14 views
                0 likes
                Last Post AaronKoRn  
                Started by carnitron, Yesterday, 08:42 PM
                0 responses
                11 views
                0 likes
                Last Post carnitron  
                Started by strategist007, Yesterday, 07:51 PM
                0 responses
                14 views
                0 likes
                Last Post strategist007  
                Working...
                X