Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Fixed dollar amount quantity

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

    Fixed dollar amount quantity

    Hi

    Super surprised this feature does not exist in NT already. I'd highly recommend having this feature in the next patch. It's a super basic principal.

    I have a pair trading strategy and when my order criteria meets I want to buy 50k lots of AAPL and 50k lot of GOOG.

    So simple Apple close/50k = number of share. And same for GOOG.

    How can I do this in NT? It doesn't let you buy based on fixed dollar amount. I looked into checking for how much money your account has but that option still doesn't meet the above simple criteria. Thoughts??

    #2
    Hello calhawk01,

    Are you referring to the 'Set order quantity' -> 'by account size' and 'Account size' fields that will place as many trades as can be bought with set Account size value?

    Below is a link to the help guide on Running a NinjaScript Strategy from a Chart. Please see the section 'Understanding strategy properties' and look for 'Set order quantity'.
    http://ninjatrader.com/support/helpG...t_strategy.htm

    Also, below is a link to the help guide on AccountSize for a little more description.
    http://ninjatrader.com/support/helpG...ccountsize.htm
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_ChelseaB View Post
      Hello calhawk01,

      Are you referring to the 'Set order quantity' -> 'by account size' and 'Account size' fields that will place as many trades as can be bought with set Account size value?

      Below is a link to the help guide on Running a NinjaScript Strategy from a Chart. Please see the section 'Understanding strategy properties' and look for 'Set order quantity'.
      http://ninjatrader.com/support/helpG...t_strategy.htm

      Also, below is a link to the help guide on AccountSize for a little more description.
      http://ninjatrader.com/support/helpG...ccountsize.htm
      yes that is what i'm referring to.. but i dont want to buy as many trades as i can with my account size.... i want to invest fixed amount of money for each instrument. so 50k in GOOG and 50k AAPL. isn't there a better way to accomplish this? id like to be able to backtest a pair/spread trading strategy where i'm investing 50k on each trade...

      a = 50,000 / closes[1]; google price
      b = 50,000 / closes[2]; aapl price

      when abc happens, then
      enter long GOOG with quantity a
      enter short AAPL with quantity b
      Last edited by staycool3_a; 08-14-2015, 12:45 PM.

      Comment


        #4
        Hello calhawk01,

        Is using the AccountSize not accomplishing what you would like to accomplish?

        Is the secondary series not placing the correct quantity?

        What is the incorrect behavior you are seeing when using this?
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          Originally posted by NinjaTrader_ChelseaB View Post
          Hello calhawk01,

          Is using the AccountSize not accomplishing what you would like to accomplish?

          Is the secondary series not placing the correct quantity?

          What is the incorrect behavior you are seeing when using this?
          well this whole account size concept seems fairly complicated for what i'm trying to do.. why isn't already part of NT? NT is a top tier platform and it blows me mind that it lacks this functionality.

          Code:
          protected override void Initialize()
          {
              AccountSize = 100000;
          }
          so if i set my account size to 100000k. how do i tell it to use 50% of money to purchase apple and the other 50% to purchase google? or are you saying that if i set up my account size to 100k. when it enters the orders for both GOOG and AAPL it will use 100k/google price and 100k/apple price?
          Last edited by staycool3_a; 08-14-2015, 01:15 PM.

          Comment


            #6
            Hello calhawk01,

            Set the Account size to 50000. Then all orders will be made a quantity that takes enough contracts to cost 50000.
            Chelsea B.NinjaTrader Customer Service

            Comment


              #7
              Originally posted by NinjaTrader_ChelseaB View Post
              Hello calhawk01,

              Set the Account size to 50000. Then all orders will be made a quantity that takes enough contracts to cost 50000.

              ok so i'[ve set the account size to 50000. now what? how do i make it actually purchase 50K?

              Code:
                              EnterLong(1,[COLOR=Red]DefaultQuantity[/COLOR], "Strongsell");
                              EnterShort(2,[COLOR=Red]DefaultQuantity[/COLOR], "Weakbuy");

              Comment


                #8
                Originally posted by calhawk01 View Post
                ok so i'[ve set the account size to 50000. now what? how do i make it actually purchase 50K?

                Code:
                                EnterLong(1,[COLOR=Red]DefaultQuantity[/COLOR], "Strongsell");
                                EnterShort(2,[COLOR=Red]DefaultQuantity[/COLOR], "Weakbuy");

                so i added the account size code in the strategy. and when backtesting in strategyanalyzer i selected by account size.. 50k. now it's purchasing 50k worth of APPLE and then it's using the same amount of shares for GOOG. even so basically:

                it's doing 50k/apple price = apple's quantity to purchase

                50k/apple price = google's quantity to purchase

                please help

                Comment


                  #9
                  Code:
                                  DefaultQuantity = (int)((50000 / Closes[1][0]) / 100) * 100;
                  this is what works the best. just put this in the quantity section of the buy order and align the close with the correct data series..

                  Comment


                    #10
                    Hi calhawk01,

                    I see the limitation there if the quantity for the secondary instrument is not being calculated with the price of that instrument.

                    I am glad you were able to come to a solution.

                    If you would like I can submit a feature request regarding having the Account size parameter reflect the pricing of each added instrument independently. Would you like me to submit this (or something similar)?
                    Chelsea B.NinjaTrader Customer Service

                    Comment

                    Latest Posts

                    Collapse

                    Topics Statistics Last Post
                    Started by selu72, Today, 02:01 PM
                    1 response
                    5 views
                    0 likes
                    Last Post NinjaTrader_Zachary  
                    Started by WHICKED, Today, 02:02 PM
                    2 responses
                    10 views
                    0 likes
                    Last Post WHICKED
                    by WHICKED
                     
                    Started by f.saeidi, Today, 12:14 PM
                    8 responses
                    21 views
                    0 likes
                    Last Post f.saeidi  
                    Started by Mikey_, 03-23-2024, 05:59 PM
                    3 responses
                    51 views
                    0 likes
                    Last Post Sam2515
                    by Sam2515
                     
                    Started by Russ Moreland, Today, 12:54 PM
                    1 response
                    8 views
                    0 likes
                    Last Post NinjaTrader_Erick  
                    Working...
                    X