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 lightsun47, Today, 03:51 PM
        0 responses
        5 views
        0 likes
        Last Post lightsun47  
        Started by 00nevest, Today, 02:27 PM
        1 response
        10 views
        0 likes
        Last Post 00nevest  
        Started by futtrader, 04-21-2024, 01:50 AM
        4 responses
        46 views
        0 likes
        Last Post futtrader  
        Started by Option Whisperer, Today, 09:55 AM
        1 response
        14 views
        0 likes
        Last Post bltdavid  
        Started by port119, Today, 02:43 PM
        0 responses
        10 views
        0 likes
        Last Post port119
        by port119
         
        Working...
        X