• 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 rickyblah12, Yesterday, 08:17 PM
        0 responses
        5 views
        0 likes
        Last Post rickyblah12  
        Started by mrlucky1x, Yesterday, 08:07 PM
        0 responses
        2 views
        0 likes
        Last Post mrlucky1x  
        Started by uday12, Yesterday, 07:21 PM
        0 responses
        4 views
        0 likes
        Last Post uday12
        by uday12
         
        Started by voltlon, Yesterday, 05:18 PM
        0 responses
        7 views
        0 likes
        Last Post voltlon
        by voltlon
         
        Started by Bobisam, Yesterday, 04:57 PM
        0 responses
        9 views
        0 likes
        Last Post Bobisam
        by Bobisam
         
        Working...
        X