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

DefaultQuantity (what is the default, and where to set it)

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

    DefaultQuantity (what is the default, and where to set it)

    What is the DefaultQuantity (the lot size) if I am trading in the forex? And where to set it? (see the screenshot in the strategy builder where DefaultQuantity appears)


    #2
    Thank you for your question jack1234. According to the documentation,

    Originally posted by http://ninjatrader.com/support/helpGuides/nt8/en-us/?defaultquantity.htm
    An int value represents the number of contracts or shares to enter a position with. Default value is 1.

    The way to enter a lot is going to be provider and account dependent. You will need to contact them to see whether 1 means "one micro lot" or "one unit".


    You can not set DefaultQuantity through the strategy wizard. The attached picture shows how to use quantities other than 1.
    Attached Files
    Jessica P.NinjaTrader Customer Service

    Comment


      #3
      What should I do if I want to set to 6 standard lots (600k)? (preferably to be broker independent)

      Comment


        #4
        Since different brokerages are going to have different rules as far as how quantities are specified there is no way through the Strategy Builder to create a brokerage independent strategy. If you are willing to unlock your code, this snippet will help you differentiate between connections and will in turn allow you to hard code any brokerage dependent variables.

        Code:
        [FONT=Courier New]
        // http://ninjatrader.com/support/helpGuides/nt8/en-us/connection_class.htm
        lock(Connection.Connections)
        {
          foreach(Connection c in Connection.Connections)
          {
            Print(c.Options.Provider.ToString());
          }
        }[/FONT]
        If you know that 600000 is 6 lots according to your broker you can simply change the value in the rightmost green circle to 600000.
        Jessica P.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by geddyisodin, Today, 05:20 AM
        3 responses
        20 views
        0 likes
        Last Post NinjaTrader_Gaby  
        Started by lorem, Today, 09:18 AM
        1 response
        4 views
        0 likes
        Last Post lorem
        by lorem
         
        Started by bmartz, Today, 09:30 AM
        0 responses
        3 views
        0 likes
        Last Post bmartz
        by bmartz
         
        Started by GussJ, 03-04-2020, 03:11 PM
        14 responses
        3,245 views
        0 likes
        Last Post GussJ
        by GussJ
         
        Started by ArkansasClint, Today, 09:28 AM
        0 responses
        2 views
        0 likes
        Last Post ArkansasClint  
        Working...
        X