Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Margin Requirements

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

    #16
    Hello kennet,stenberg,

    The topic of this thread relates to how one can calculate the number of lots based off margin requirements via NinjaScript/Strategy.

    If you suspect your risk templates are incorrect please write into platform support at platformsupport[at]ninjatrader[dot]com, or via the control center>help>remote support.

    Thank you.
    Alan P.NinjaTrader Customer Service

    Comment


      #17
      Historical Margin Requirements for ICE products

      Does anyone know how I can acquire historical initial margin requirements for ICE products (mini Russell 2000, U.S. Dollar Index, etc.)? The CME posts theirs and the ICE used to, but not anymore. Your help is very much appreciated.

      sjv5150

      Comment


        #18
        Hello sjv5150,

        Thank you for your note.

        I am unsure where you could find historical margin requirements however I might consider reaching out to ICE to see if these can be pulled.

        If you are able to locate this historical data I'm sure the forum would appreciate if you shared where you find this information.

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

        Comment


          #19
          Originally posted by GibbsB613 View Post
          Since the margin changes frequently, how can I get the most recent margin requirements using Ninjascript?

          As for adding the additional data series, does the instrument have to be defined? My strategy will run on up to 12 different pairs.
          Strategy Builder does not have the two elements a non-coder would require for an issue I am having. Your solution seems like it might solve this issue.

          Strategy works fine in SIM where there is an arbitrarily high account balance. When used live with a small account the entry is bounced based on insufficient margin. This is understandable and not an issue. The problem is the strategy immediately makes the same calculations and tries to place another order - rejected based on margin - calculates again and tries to place an order.

          Since Strategy builder does not hae the ability to review the risk information OR the available account balance, would it be difficult to create an indicator that either provides the account balance and margin reqiuirements as amounts for strategy builder or some kind of booled Int that Strategy builder could act on? Say if there is enough margin the value would be 100 and if not enough it would be zero (0.)

          That way the screen will not fill with error messages of insufficient margin.

          Any assistance would be GREATLY (100%) appreciated!!!

          Comment


            #20
            Hello JMont1,

            I wrote an indicator which 1) sets the value of the account balance to a plot 2) Sets another plot to the initial margin of the contract the indicator is applied to.

            Both these plots can be referenced in the strategy builder (see attached screen shot).

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

            Comment


              #21
              Originally posted by NinjaTrader_AlanP View Post
              Hello JMont1,

              I wrote an indicator which 1) sets the value of the account balance to a plot 2) Sets another plot to the initial margin of the contract the indicator is applied to.

              Both these plots can be referenced in the strategy builder (see attached screen shot).

              Please let us know if you need further assistance.
              Alan, thank you for this. It is essentially what I need. May I ask if you are able to allow for some variables like whether to use initial.margin or BuyIntradayMargin so it can be used for day trading with the lower margin requirement?

              And can it have a drop down for the Account Names available in the NT8 so it is not just hard coded? The hard coding seems like it could be a security issue so a drop down with Sim101 as the default would be appreciated.

              I originally thought I would need this to be optioned in the actual strategy builder but this indicator works as well or better since once it has the above options I could tweak it even though I am just a code paster rather than a coder.

              Thank you for your fast response.

              Comment


                #22
                Hello JMont1,

                Yes, you could add the bells and whistles which would allow you to select the type of the margin as well as have a drop down with an account however adding this functionality would be out of the scope of our support desk.

                If you'd like I can someone reach out with a list of third parties that would be interested in adding this functionality for you.

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

                Comment


                  #23
                  Acct Drop Down

                  Alan, thank you for the follow up.

                  I am attempting to modify the indicator but have run into a knowledge gap.

                  How do I call the option to fill an Account Name field by seeing what account names are available.

                  Market Analyzer "Profit Loss" provides a drop down of the available accounts to select. May I request information on how that is accomplished?

                  Comment


                    #24
                    Hello JMont1,

                    Attached is an indicator which lists available accounts in a drop down in the indicator.

                    I used the following to loop through available accounts,


                    Please let us know if you have any questions.
                    Attached Files
                    Last edited by NinjaTrader_AlanP; 11-28-2017, 02:34 PM.
                    Alan P.NinjaTrader Customer Service

                    Comment


                      #25
                      Originally posted by NinjaTrader_AlanP View Post
                      GibbsB613

                      Regarding the risk template for FX instruments, this should change in the next release of NT8 which will allow margin updates from the server.

                      Please let us know if you need further assistance.
                      Hi, was this ever implemented?

                      I'm trying to obtain the MMR values for FXCM, but it seems there's no risk template available anywhere for FXCM currencies?

                      Comment


                        #26
                        Hello beastment,

                        I am looking into this and will follow up when I have more information.

                        Thank you for your patience.
                        Alan P.NinjaTrader Customer Service

                        Comment


                          #27
                          Hello beastment,

                          Thank you for bringing this up.

                          Due to variation with margin across different cash FX brokers as well as other variables, server updated margin templates have not been implemented for cash FX in NT8. This is being tracked by a feature request I will add your vote to.

                          For now you will have to create and define the risk template on your end.

                          Please see the following link for more information,


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

                          Comment


                            #28
                            Thanks for the reply Alan. The MMR values vary each month potentially, and by account type, so I'm not overly enthusiastic about maintaining a table of them manually.

                            As a possible workaround, I noticed that NT8 appears to be using the ForexConnect API for FXCM, or at least it seems to have all of the relevant DLLs in \Program Files (x86)\NinjaTrader 8\bin64.

                            Adding a reference to bin64\fxcore2.dll seems to get me most of the way there, such that I have the following:

                            using fxcore2;
                            --------------------------

                            var account = this.Account as fxcore2.O2GAccountRow;
                            double MMR = fxcore2.O2GTradingSettingsProvider.getMMR(Instrume nt.FullName, account);
                            Print("MMR: " + MMR.ToString());


                            I was hoping there might be some way to pass the Account reference from NT8 to fxcore2 without going through the whole login process again, but I'm having no luck converting it.

                            I realise that's probably outside the scope of what you'd support, but if there's anything obvious....

                            Thanks,
                            Ben.
                            Last edited by beastment; 03-22-2018, 04:44 PM.

                            Comment


                              #29
                              Hello beastment,

                              Thank you for your response.

                              As you noted this would be outside what we can support. I am not seeing anything that is obvious here to pull those values and settings.

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by rdtdale, Today, 01:02 PM
                              0 responses
                              3 views
                              0 likes
                              Last Post rdtdale
                              by rdtdale
                               
                              Started by alifarahani, Today, 09:40 AM
                              3 responses
                              15 views
                              0 likes
                              Last Post NinjaTrader_Jesse  
                              Started by RookieTrader, Today, 09:37 AM
                              4 responses
                              18 views
                              0 likes
                              Last Post RookieTrader  
                              Started by PaulMohn, Today, 12:36 PM
                              0 responses
                              8 views
                              0 likes
                              Last Post PaulMohn  
                              Started by love2code2trade, 04-17-2024, 01:45 PM
                              4 responses
                              41 views
                              0 likes
                              Last Post love2code2trade  
                              Working...
                              X