Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to get tradable amount from online broker with margin?

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

    How to get tradable amount from online broker with margin?

    Hello,

    My question is regarding risk-management, and I need to know which amount I should read from my online broker when calculating my trade position for each particular trade.
    In most cases, the available trade amount is calculated like this: Equity (Cash + papers) - (Margin requirement) = Current Available Funds.

    As I will use FXCM and Ninjatrader Continuum, I need to know how to fetch this amount from my online broker in order to calculate the correct tradable amount using a Ninjatrader strategy for a particular currency pair or stock instrument.

    Any advice or information is appreciated!

    Thanks!
    Warcious

    #2
    Hello warcious,

    Thanks for your post.

    You can use GetAccountValue() for each account: http://ninjatrader.com/support/helpG...countvalue.htm

    Comment


      #3
      Thank you for your answer Paul. But which of these three items corresponds to my formula:
      Equity (Cash + papers) - (Margin requirement) = Current Available Funds.
      ----
      Ninjascript:
      GetAccountValue()
      Possible values:
      AccountItem.BuyingPower
      AccountItem.CashValue
      AccountItem.RealizedProfitLoss

      Comment


        #4
        Hello warcious,

        Thanks for your reply.

        Regrettably not all items are available to fulfill your formula, please see: http://ninjatrader.com/support/forum...ead.php?t=5474 for what is available by broker/connection.

        Comment


          #5
          So what you are saying that for:
          1)
          FXCM I can only fetch the
          Cash Value

          and for
          2) Ninjatrader Continuum I can only fetch
          Cash Value
          Realized PnL

          Then how could I fetch my available trading amount including my margin?
          Maybe I can manually enter the margin requirement somehow?

          Comment


            #6
            Hello warcious,

            Thanks for your reply.

            Yes, you could create input variables to hold the manually entered information.

            In terms of margin, you can edit the instruments (va the instrument manager) and add that value (as there is a field for it) and then retrieve in Ninjascript through the undocumented code of Instrument.MasterInstrument.Margin.

            http://ninjatrader.com/support/helpG...nstruments.htm

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by HaannyKaab, Yesterday, 04:27 AM
            0 responses
            41 views
            0 likes
            Last Post HaannyKaab  
            Started by aligator, 07-14-2025, 05:09 PM
            0 responses
            64 views
            1 like
            Last Post aligator  
            Started by NTEducationTeam, 07-14-2025, 01:49 PM
            0 responses
            73 views
            0 likes
            Last Post NTEducationTeam  
            Started by NTEducationTeam, 07-14-2025, 01:24 PM
            0 responses
            65 views
            0 likes
            Last Post NTEducationTeam  
            Started by saltminer, 07-07-2025, 01:43 PM
            1 response
            189 views
            0 likes
            Last Post NinjaTrader_ChelseaB  
            Working...
            X