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 maybeimnotrader, Today, 05:46 PM
        0 responses
        5 views
        0 likes
        Last Post maybeimnotrader  
        Started by quantismo, Today, 05:13 PM
        0 responses
        6 views
        0 likes
        Last Post quantismo  
        Started by AttiM, 02-14-2024, 05:20 PM
        8 responses
        166 views
        0 likes
        Last Post jeronymite  
        Started by cre8able, Today, 04:22 PM
        0 responses
        8 views
        0 likes
        Last Post cre8able  
        Started by RichStudent, Today, 04:21 PM
        0 responses
        5 views
        0 likes
        Last Post RichStudent  
        Working...
        X