Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to check whether account margin is enough to open position

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

    How to check whether account margin is enough to open position

    Hello,

    If i try to open position with too large size I have Ninja's message box "cannot accept order... not enough excess margin"

    I want to check before sending order whether I have enough margin to open position
    I suppose I need to use Account.GetAccountItem method, but I don't know which exactly parameter I have to use and what formula must be to get the answer "enough/not enough"

    I opened the related documentation


    but have not found any description for values

    #2
    Hello rfsettling,

    Thank you for your note.

    I have attached a sample strategy which checks initial margin before entering long.

    Please let us know if you need further assistance.
    Attached Files
    Alan P.NinjaTrader Customer Service

    Comment


      #3
      Thanks
      One quick question: in your example Quantity of entry is not involved in calculation. If I use Quantity>1, should I multiply margin to my quantity?

      Comment


        #4
        Hello rfsettingling,

        Good point. I would test the following,

        Code:
        	if(xAccountSize > StratInstrumentInitialMargin * TradeSize)
        				EnterLong(TradeSize);
        Please let us know if you need further assistance.
        Alan P.NinjaTrader Customer Service

        Comment


          #5
          I already experimented with it, but it seems the logic is different to simple mutliplication. Let's consider ES futures. Initial margin $4950. If it is for one contract, then opening 20 contracts is maximum I can send for 100 K deposit. But I sent 50 contracts and more and Ninja accepted those orders

          I tried to read user's manual for Risk window, to understand what each parameter means, but it also contains very scarce information.

          Comment


            #6
            Hello rfsettling,

            If you open a super dom and queue up fifty and submit the order, does NinjaTrader accept the order?

            I look forward to your reply.
            Alan P.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by NullPointStrategies, Yesterday, 05:17 AM
            0 responses
            54 views
            0 likes
            Last Post NullPointStrategies  
            Started by argusthome, 03-08-2026, 10:06 AM
            0 responses
            130 views
            0 likes
            Last Post argusthome  
            Started by NabilKhattabi, 03-06-2026, 11:18 AM
            0 responses
            72 views
            0 likes
            Last Post NabilKhattabi  
            Started by Deep42, 03-06-2026, 12:28 AM
            0 responses
            44 views
            0 likes
            Last Post Deep42
            by Deep42
             
            Started by TheRealMorford, 03-05-2026, 06:15 PM
            0 responses
            49 views
            0 likes
            Last Post TheRealMorford  
            Working...
            X