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 bortz, 11-06-2023, 08:04 AM
        47 responses
        1,602 views
        0 likes
        Last Post aligator  
        Started by jaybedreamin, Today, 05:56 PM
        0 responses
        8 views
        0 likes
        Last Post jaybedreamin  
        Started by DJ888, 04-16-2024, 06:09 PM
        6 responses
        18 views
        0 likes
        Last Post DJ888
        by DJ888
         
        Started by Jon17, Today, 04:33 PM
        0 responses
        4 views
        0 likes
        Last Post Jon17
        by Jon17
         
        Started by Javierw.ok, Today, 04:12 PM
        0 responses
        12 views
        0 likes
        Last Post Javierw.ok  
        Working...
        X