• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Distract margin from order

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

    Distract margin from order

    Hi guys, I'm wondering if it is possible to obtain the margin of an order after it is created. For example in the 'OnOrderUpdate' or 'OnExecutionUpdate' methods the order is passed as a parameter. I looked at the values inside these properties but couldn't find the margin at first sight. I did find a GetConversionRate inside the Order.Instrument property so I'm guessing this one could be used to calculate the margin? A predifined value would be better of course.

    Is it also possible to add the margin to the Trades overview in the Strategy Analyzer?

    Kind regards
    David

    #2
    Hello Vanderbeke,

    Thank you for your note.

    I have attached a sample which will check the initial margin of the instrument before entering long.

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

    Comment


      #3
      Hi Alan

      Thanks for your answer!

      When I use the following "Risk.Get("NinjaTrader Brokerage Default").ByMasterInstrument[Instrument.MasterInstrument].InitialMargin;" will I then get the margin required for 1 standard contract?

      I've also came accros the following in another forum post. "GetAccountValue(AccountItem.InitialMargin") Is this also useful?

      Kind regards
      David

      Comment


        #4
        Hello Vanderbeke,

        GetAccountValue is a NT7 method and will not work in NT8.

        Regarding your first question, I would suggest applying the attached indicator to a 10 second chart, then opening an output window via Control Center>New>Output Window. The script will print the Initial Margin of that instrument. Next go to Control Center>Tools>Risk and find the instrument you applied the script to, and look at initial margin.

        Then go to CME.com and click the Trading tab at the top of the page, and find the instrument of interest. On that instrument page, go to Margins.

        With the three pieces of data you should be able to answer your first question.

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

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by NT-Roland, Today, 04:36 PM
        0 responses
        2 views
        0 likes
        Last Post NT-Roland  
        Started by Newtrader101, Today, 03:40 PM
        2 responses
        10 views
        0 likes
        Last Post Newtrader101  
        Started by Branpo, Today, 02:58 PM
        2 responses
        7 views
        0 likes
        Last Post Branpo
        by Branpo
         
        Started by sdauteuil, Today, 02:09 PM
        1 response
        10 views
        0 likes
        Last Post NinjaTrader_Jesse  
        Started by AMATX, Today, 02:19 PM
        2 responses
        11 views
        0 likes
        Last Post AMATX
        by AMATX
         
        Working...
        X