• 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

  • Vanderbeke
    started a topic Distract margin from order

    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

  • NinjaTrader_AlanP
    replied
    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

    Leave a comment:


  • Vanderbeke
    replied
    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

    Leave a comment:


  • NinjaTrader_AlanP
    replied
    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

    Leave a comment:

Latest Posts

Collapse

Topics Statistics Last Post
Started by Rashid Garuba, Today, 11:37 AM
0 responses
3 views
0 likes
Last Post Rashid Garuba  
Started by elkhatabi, Today, 11:19 AM
0 responses
4 views
0 likes
Last Post elkhatabi  
Started by hurleydood, Today, 10:07 AM
0 responses
5 views
0 likes
Last Post hurleydood  
Started by Irukandji, Today, 09:43 AM
1 response
8 views
0 likes
Last Post NinjaTrader_ThomasC  
Started by TazoTodua, Today, 09:06 AM
0 responses
7 views
0 likes
Last Post TazoTodua  
Working...
X