Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to set a risk of 1% of the account size on each trade?

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

    How to set a risk of 1% of the account size on each trade?

    Hi!

    How could I set a risk of 1% of the account size on each trade?

    I saw that the enterLong and enterShort functions have a parameter named quantity, but i don't understand what it really represents. What i would like to achieve is controlling the size of the positions in dollar. Is there a way to know the right quantity to input for a wanted dollar size ? For example, for an account of 1000$, enter a long of 10$ precisely (risking 1% per trade), and increase position sizes as the account grows.

    #2
    Hello havy.tom24,

    The quantity for an order is the number of contracts for that order.

    Calculating a number of contracts based on account size or another value would require custom code to calculate this.


    The Instrument.MasterInstrument.TickSize and .PointValue can be used. For example on the ES the TickSize is .25 and the point value is $50, making each tick $12.5.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Thanks your reply,

      I understand Tick value, but in the case of BTC, I still don't get how to know how many tick values is 1 contract. I need to know how much money I risk when I open a position (long or short) of quantity 1. Could you please clarify that point?

      Comment


        #4
        Hello havy.tom24,

        The two are not related. A Tick can refer to the smallest price increment an instrument can change and can also refer to information about a trade occurring (real-time incoming ticks).

        A contract size, or quantity, is the number of shares. This is not a price.

        The number of shares multiplied by the point value would show how much gain or loss for those shares as the price goes up and down.
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          Ok, thank you. Have a good day.

          Comment


            #6
            Hi team, so if I would like to risk 1% of capital for each trade from USD 1M for my strategy, do I need to create two new variables, 1) to track the capital movement after each trade & 2) to calculate the quantity of each trade? If so, how could I find the PnL of each trade with the commission to calculate the capital movement?

            To put the concept of "risking 1% of capital" into live trading, except replacing the variable of tracking capital movement into Account.Get(AccountItem.CashValue, Currency.UsDollar), are there codes I need to be aware of regarding this topic? Thank you.

            Comment


              #7
              Hello morong0414,

              If you wanted to make a ongoing account value that gets modified after each trade you would need to use variables for that to store the result of your calculations. The quantity of a trade is a property of a trade so you wouldn't necessarily need to track that if you are using the trade performance collection to view the completed trades. If you are not doing that then yes you would need to track the quantity if that will be used in your calculations.
              JesseNinjaTrader Customer Service

              Comment


                #8
                Thank you. How could I find the PnL of each trade with the commission to calculate the capital movement, I need it to adjust the capital after each trade manually. Thanks.

                Comment


                  #9
                  Hello morong0414,

                  You can see the following example which shows how to access a specific trade, you can access any of its properties like the commission or fill price.

                  JesseNinjaTrader Customer Service

                  Comment


                    #10
                    Hi team, thanks for the material. As this is for my backtesting purpose (not real-time trades), I think the SystemPerformance.RealTimeTradesmethod is not applicable right? How could I create a trade object on each trade of my trades in backtesting? Thank you.

                    Comment


                      #11
                      Hello morong0414,

                      You can use the AllTrades collection in place of RealTimeTrades for historical trades to be included.

                      JesseNinjaTrader Customer Service

                      Comment


                        #12
                        It works perfectly. Thanks.

                        Comment

                        Latest Posts

                        Collapse

                        Topics Statistics Last Post
                        Started by DeskTroll, Today, 12:09 PM
                        3 responses
                        22 views
                        0 likes
                        Last Post NinjaTrader_LuisH  
                        Started by Pabulon, 12-02-2024, 03:42 PM
                        14 responses
                        90 views
                        0 likes
                        Last Post Pabulon
                        by Pabulon
                         
                        Started by tfa2806trader, Today, 12:04 PM
                        10 responses
                        25 views
                        0 likes
                        Last Post tfa2806trader  
                        Started by trdninstyle, 11-26-2024, 12:23 PM
                        62 responses
                        186 views
                        0 likes
                        Last Post trdninstyle  
                        Started by lorien, 08-08-2021, 07:33 AM
                        12 responses
                        721 views
                        0 likes
                        Last Post AndyM871  
                        Working...
                        X