Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Access Instrument Commission from Ninjascript NT8

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

    #16
    Hello timcjpfx,

    Unfortunately I wouldn't be able to say why that may be null, that is not a documented property on the Account object so it may not be intended to be used in NinjaScript but only in specific internal uses.

    Comment


      #17
      timcjpfx, What happens is that the account associated with the strategy does not have a commission defined. Edit the account you are using to run the strategy, and assign a commission to it, and you will see that your code works that way. To avoid this problem, put a conditional in your code where you ask if the variable is not null so that the value assignment can proceed; otherwise, you can pass the value zero to the variable.

      This answer is a bit late, but I'm just getting into the world of NinjaScript. I hope you were able to solve it in due time.​

      Comment


        #18
        Hello timcjpfx,

        Do you have a commission template applied to the sim101 account? You can right click -> edit account from the accounts tab in the control center to check that. If this is in a backtest make sure you have checked the use commission box as well.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        558 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        324 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        101 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        545 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        547 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X