Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Margin error confusion

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

    Margin error confusion

    I submitted an order and after a while it got closed with the following error?
    would you please help me to understand it ?
    is there a way to programmatically get it ?


    Click image for larger version

Name:	Ninja Margin Error.png
Views:	359
Size:	13.9 KB
ID:	1149415

    #2
    Capture OrderState.Rejected in OnOrderUpdate.

    Comment


      #3
      Thanks bltdavid

      I'd like to get margin value not reason of rejection.

      Comment


        #4
        Hello bosajin,


        CRITICAL — If your inquiry involves live orders, please always reach out to your broker's Orders Desk immediately to confirm and manage your live orders and positions.

        If your trades are with NinjaTrader Brokerage, you can contact NinjaTrader Brokerage Order Desk here:
        • Email: orders (at) ninjatrader (dot) com

        This error message generally indicates that your account does not have enough margin available to execute an order, and would be caused by the brokerage/exchange directly.

        If you are uncertain what this error means or would like more information regarding it, please contact your brokerage directly. If you are with the NinjaTrader Brokerage you may reach out to them directly via email at brokeragesupport (at) ninjatrader (dot) com.

        I have also forwarded a note to our NinjaScript Team, they will follow up with you shortly regarding capturing the margin value in the script directly.

        Should you have any further questions in this regard, please let me know!

        Comment


          #5
          Hello bosajin,

          Thank you for your replies.

          Several Margin values for your account may be available to you via NinjaScript depending on your broker. Some do not provide these values through their API and if they do not these would not be accessible to you via NinjaScript. You can check which values may be available to you here:



          Monitoring for changes in these values would be done using add-on code in OnAccountItemUpdate:





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

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by argusthome, 03-08-2026, 10:06 AM
          0 responses
          77 views
          0 likes
          Last Post argusthome  
          Started by NabilKhattabi, 03-06-2026, 11:18 AM
          0 responses
          45 views
          0 likes
          Last Post NabilKhattabi  
          Started by Deep42, 03-06-2026, 12:28 AM
          0 responses
          27 views
          0 likes
          Last Post Deep42
          by Deep42
           
          Started by TheRealMorford, 03-05-2026, 06:15 PM
          0 responses
          32 views
          0 likes
          Last Post TheRealMorford  
          Started by Mindset, 02-28-2026, 06:16 AM
          0 responses
          63 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Working...
          X