Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Sufficient buying power

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

    Sufficient buying power

    Hello

    Is it possible to know if I have sufficient buying power BEFORE I submit a new order? In my scenario it is possible to already have an open position which reducing my buying power.

    Thanks

    #2
    Hello kiss987,

    Thank you for the post.

    You can use the GetAccountValue() function to return the buying power of the account the strategy is running on.

    Example:
    Code:
    protected override void OnBarUpdate()
    {
        if (GetAccountValue(AccountItem.BuyingPower) > 1000)
            // Do something;
    }
    Here is the help guide page to GetAccountValue():


    Please let us know if we may be of any further assistance.

    Comment


      #3
      Hi

      That value is updated only after I close my position. So, if my position is opened (and there for is reducing my buying power) I will not know that.

      Comment


        #4
        Hello,

        Thanks for the reply.

        There is no OnAccountItemUpdate() override method in NinjaTrader 7. There is in NinjaTrader 8, but buying power is not available for the sim account in NinjaTrader 8. Without this method, there is no way get the most recent value of buying power, unfortunately.

        Please let me know if you have any further questions.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by CarlTrading, 03-31-2026, 09:41 PM
        1 response
        132 views
        1 like
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 04-01-2026, 02:41 AM
        0 responses
        74 views
        1 like
        Last Post CarlTrading  
        Started by CaptainJack, 03-31-2026, 11:44 PM
        0 responses
        117 views
        2 likes
        Last Post CaptainJack  
        Started by CarlTrading, 03-30-2026, 11:51 AM
        0 responses
        113 views
        1 like
        Last Post CarlTrading  
        Started by CarlTrading, 03-30-2026, 11:48 AM
        0 responses
        89 views
        0 likes
        Last Post CarlTrading  
        Working...
        X