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

Currency trading - getting account size

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

    Currency trading - getting account size

    Hi,

    I would like to do position sizing calculations in my strategy, could you advise how I can retrieve the account size from MB trading through ninajtrader?

    Is GetAccountValue(AccountItem accountItem) able to do the trick?

    If I am connected to both Kinetick and MBT, is ninjatrader capable of knowing which account to pull the account size from? How does it differentiate which account to use? Is there a need to specify the account?

    WBH

    #2
    Hello,

    GetAccountValue is what you're looking for.

    This property will only be aware of the account value from the account the strategy is running on. This means that as long as you have set the "account" field to your MBT account, it will pull the account size from that account only. It is not possible to pull the account value from an account the strategy is not running on.

    Please note that the MBTrading adapter has a limitation where the account items such as CashValue are not immediately available upon connection. In order to call this information, you must initiate a trade on the MBT API.

    With this in mind, you could setup a simple test to check the CashValue and should it not be returned, you can please a limit order well be low the current market price and immediately cancel the order. Once the trade API has been called in this manner, your AccountItems should be available to you.
    MatthewNinjaTrader Product Management

    Comment


      #3
      Hi

      Please note that the MBTrading adapter has a limitation where the account items such as CashValue are not immediately available upon connection. In order to call this information, you must initiate a trade on the MBT API.
      Could you advise how can I set this API up ?


      With this in mind, you could setup a simple test to check the CashValue and should it not be returned, you can please a limit order well be low the current market price and immediately cancel the order. Once the trade API has been called in this manner, your AccountItems should be available to you.
      Do I need to have the paid version of Ninjatrader to get this working ?

      Comment


        #4
        The MBT API can be setup by following the stesp below:

        Click here to take me to the MB Trading Connection Guide

        Yes, you will need the paid version of NinjaTrader to access your live account balance.
        MatthewNinjaTrader Product Management

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by esmall, Today, 07:14 PM
        0 responses
        3 views
        0 likes
        Last Post esmall
        by esmall
         
        Started by Option Whisperer, 05-09-2024, 07:58 PM
        6 responses
        26 views
        0 likes
        Last Post Option Whisperer  
        Started by rayyyu12, Today, 05:38 PM
        0 responses
        12 views
        0 likes
        Last Post rayyyu12  
        Started by xepher101, Yesterday, 12:19 PM
        2 responses
        30 views
        0 likes
        Last Post xepher101  
        Started by thumper57, Today, 04:30 PM
        0 responses
        8 views
        0 likes
        Last Post thumper57  
        Working...
        X