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 kinfxhk, 07-14-2026, 09:39 AM
            0 responses
            10 views
            0 likes
            Last Post kinfxhk
            by kinfxhk
             
            Started by kinfxhk, 07-13-2026, 10:18 AM
            0 responses
            59 views
            0 likes
            Last Post kinfxhk
            by kinfxhk
             
            Started by kinfxhk, 07-13-2026, 09:50 AM
            0 responses
            41 views
            0 likes
            Last Post kinfxhk
            by kinfxhk
             
            Started by kinfxhk, 07-13-2026, 07:21 AM
            0 responses
            47 views
            0 likes
            Last Post kinfxhk
            by kinfxhk
             
            Started by kinfxhk, 07-11-2026, 02:11 AM
            0 responses
            38 views
            0 likes
            Last Post kinfxhk
            by kinfxhk
             
            Working...
            X