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

    Margin Requirements

    I want to be able to compute the # of lots that I can trade. How to I find the margin requirements per currency pair for 1K\10K\100K?

    Using the strategy builder, can I specify the timeframe of a moving average? My strategy is going to run on the H1 chart, but I want a H4 indicator for multiple timeframe analysis.

    Thanks in advance.

    #2
    Hello GibbsB613,

    Thank you or writing in.

    On the Control Center, click on the Accounts tab, right click on your account>Edit Account. Select the Risk Drop down to NinjaTrader Brokerage Default (or whatever Risk Template you’d like to define).

    Next you would have to define the margin required under Control Center>Tools>Risk. Add.
    You would then define the different margin requirements. (See Screen Shot).

    I put together an example for the EUR/USD, using the following link which has margin listed as 24.


    Meaning that with 1,000 USD, you could buy 24,000 worth of EUR/USD, thus you would set the margin up as 1/24, or .04167. So, to buy 10,000 EUR/USD you would need 10,000*.04167 = $416 needed in margin.

    I have put together a sample strategy which when applied to a pair which has margin defined in its risk template, will print to the output window the accounts excess initial margin, margin required multiplied by order quantity (set when applying the strategy), then, if Excess margin exceeds margin required, will enter a long position.

    You should check with your FX broker for the most recent updated margin requirements, the figures I used in this example may not be the most recent.

    Regarding your second question, yes it’s possible to use the strategy builder to have a moving average calculated off a secondary data series. On the Additional Data section (3 next clicks in the builder), you would add your secondary data series. See screen shot. Next on the Conditions and Actions section of the builder, when defining the Conditions, you select the SMA indicator and under Data Series, you set Input Series to the secondary series you defined in step 1. See screen shot.

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

    Comment


      #3
      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.

      Comment


        #4
        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.

        Comment


          #5
          I was able to get this to work. Disappointed that we have to manually enter the margins. Hopefully, this will be automated in the future.
          Last edited by GibbsB613; 03-07-2017, 11:30 PM.

          Comment


            #6
            Hello GibbsB613,

            I’m currently investigating your question and appreciate your patience.

            I will follow up when I have an answer.
            Alan P.NinjaTrader Customer Service

            Comment


              #7
              Thanks. I just seems to me it would be a property of the instrument object.

              Thanks in advance!

              Comment


                #8
                GibbsB613

                The strategy builder requires you designate an instrument. You would be able to click the Unlock code button in the builder to use the NinjaScript Editor which allows you to modify the builder code. You could replace the AddDataSeries statement which includes the instrument (that the builder wrote) and replace it with one of the syntax examples at the following link which omit the instrument name. Note, you will not be able to use the editor after doing so.



                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.
                Alan P.NinjaTrader Customer Service

                Comment


                  #9
                  Hey Alan, must be some confusion. Your advice worked, I checked use the primary instrument and I was able to add a different timeframe indicator. I was talking about the instrument margin. It seems like that would've been added a while back no worries though.

                  Different question, when I perform a backup, does my risk information get backed up as well?

                  Comment


                    #10
                    Hello GibbsB613,

                    Yes, if you check Templates in the Export Backup File prompt, it will include risk templates as well.

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

                    Comment


                      #11
                      How would an example for futures look

                      I am using 6E and in the Ninjatrader Risk Templates the figures are very different.

                      Kind Regards

                      Kennet

                      Comment


                        #12
                        Hello kennet,Stenberg,

                        Thank you for writing in.

                        Could you please clarify what you mean different?

                        What are you comparing the 6E to?

                        I look forward to your reply.
                        Alan P.NinjaTrader Customer Service

                        Comment


                          #13
                          6e - eurusd

                          Hello!

                          I am comparing the numbers from your example in this thread with the ones found in the NinjaTrader Risk Template for 6E

                          Kennet

                          Comment


                            #14
                            Hello kennet,stenberg,

                            The numbers I provided as part of an example were not meant to be used to check against what is on your machine, these change and while the link is now gone, I recall the figures being from some time ago.

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

                            Comment


                              #15
                              It looks like this

                              The risk template from Ninjatrader regarding 6E looks like the attached screendump
                              Kennet
                              Attached Files

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by DJ888, 04-16-2024, 06:09 PM
                              6 responses
                              18 views
                              0 likes
                              Last Post DJ888
                              by DJ888
                               
                              Started by Jon17, Today, 04:33 PM
                              0 responses
                              1 view
                              0 likes
                              Last Post Jon17
                              by Jon17
                               
                              Started by Javierw.ok, Today, 04:12 PM
                              0 responses
                              6 views
                              0 likes
                              Last Post Javierw.ok  
                              Started by timmbbo, Today, 08:59 AM
                              2 responses
                              10 views
                              0 likes
                              Last Post bltdavid  
                              Started by alifarahani, Today, 09:40 AM
                              6 responses
                              41 views
                              0 likes
                              Last Post alifarahani  
                              Working...
                              X