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 rhyminkevin, Today, 04:58 PM
                4 responses
                52 views
                0 likes
                Last Post dp8282
                by dp8282
                 
                Started by iceman2018, Today, 05:07 PM
                0 responses
                5 views
                0 likes
                Last Post iceman2018  
                Started by lightsun47, Today, 03:51 PM
                0 responses
                7 views
                0 likes
                Last Post lightsun47  
                Started by 00nevest, Today, 02:27 PM
                1 response
                14 views
                0 likes
                Last Post 00nevest  
                Started by futtrader, 04-21-2024, 01:50 AM
                4 responses
                50 views
                0 likes
                Last Post futtrader  
                Working...
                X