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

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.
    Chris L.NinjaTrader Customer Service

    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.
        Chris L.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by traderqz, Yesterday, 09:06 AM
        2 responses
        15 views
        0 likes
        Last Post traderqz  
        Started by traderqz, Today, 12:06 AM
        3 responses
        6 views
        0 likes
        Last Post NinjaTrader_Gaby  
        Started by RideMe, 04-07-2024, 04:54 PM
        5 responses
        28 views
        0 likes
        Last Post NinjaTrader_BrandonH  
        Started by f.saeidi, Today, 08:13 AM
        1 response
        8 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by DavidHP, Today, 07:56 AM
        1 response
        7 views
        0 likes
        Last Post NinjaTrader_Erick  
        Working...
        X