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

Help with calculating position size (TickSize and PIP values)

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

    Help with calculating position size (TickSize and PIP values)

    Hi

    I'm trying to calculate position size and so far have been looking at currency pairs, and in my indicator script, it is simply TickSize * 10 to get the correct pip value when comparing two prices.

    However, I'm now looking at the indices on the attached image. This image is from some dummy trades I placed on FXCM web portal. The P/L column is the PIP difference between the open and close prices.

    On these instruments (excluding EUR/GBP) the TickSize value on NinjaTrader is 0.01 for all of them. However, as you can see on the image, the PIP size can be x1 or x10 or x100 the TickSize value so I was wondering if there is another value on NinjerTrader which helps you calculate the PIP size for each.

    For info, excluding EURGBP the instrument names on NinjaTrader are as shown in the image but with @ at the start. e.g. @NAS100.

    Many thanks
    Tim


    #2
    Hello timcjpfx,

    Thank you for your post.

    Multiplying the pip size of your currency pair by the lot size of your order will provide you the pip value. If you're unsure of the pip size, this value will always be in the TickSize variable, and you can set up logic to check if it's x10 or x100 that you need before multiplying it by one of them. Additional information is available in our help guide here:



    Please let us know if we may be of further assistance to you.
    Kate W.NinjaTrader Customer Service

    Comment


      #3
      Hi Kate

      Thanks for the response. I had previously read that page but unfortunately it still doesn't make sense to me, plus I'm not just looking at currency pairs.

      Could you help me with a worked example?

      Let's say I have a $10,000 account and I want to risk 1% = $100.
      I am selling instrument @US30.
      I want to place my stop loss at 15 pips above my entry price which is 24711.00

      Can you tell me how to calculate what my position size is so if I am stopped out, I do not exceed my 1% ($100)?

      Many thanks
      Tim

      Comment


        #4
        Hello timcjpfx,

        Thank you for your reply.

        You would need to get the Account info from the Account class and then calculate the value using the closing price, then use that to find the quantity to purchase. I've attached a simple strategy that was originally made by one of my colleagues here that I've modified to work for both Forex and CFD (Forex using micro lots). The account percentage may be specified in the strategy parameters. This particular strategy has logic added so it will always take at least 1 micro lot for testing purposes, but that should be omitted in real trading.

        Please let us know if we may be of further assistance to you.
        Attached Files
        Kate W.NinjaTrader Customer Service

        Comment


          #5
          Thanks for that.

          I ran the strategy but I think this is intended for something else:

          It does help with getting the account size etc. but it doesn't seem to calculate the pip value.

          What I am trying to do is to limit the potential loss on the trade to 1% of the account size. The potential loss is the number of pips between entry and stop-loss which I already have calculated. In this example, 15.

          So, I basically need to work out what the pip $ value is.

          e.g. If the pip value is $0.002 per pip.
          My risk amount is 1% * $10,000 = $100
          Then divide $100 by $0.002 (risk amount / pip value) = 50,000
          Then divide this by the number of pips for the stop loss (50,000 / 15) = 3,333.33
          This then gives me the unit or position size for the trade = 3,333 units or if FX it would be 3 Micro Units.

          As I mentioned earlier, I had been using (TickSize * 10) to get the currency pair pip value, but for the CFD instruments this does not work as they are all listed as TickSize = 0.01 so I still need to figure out whether to multiply the TickSize by 1 or 10 or 100 and that's where I'm stuck.

          Many thanks
          Tim
          Last edited by timcjpfx; 02-24-2020, 03:26 PM.

          Comment


            #6
            I have got this on my platform but not sure how do I execute, is there a video or explanation on how to use that strategy ?

            Comment


              #7
              Hello eddiekellertri,

              Thank you for your reply.

              I should note first that example strategies posted on the forum are not intended for live trading and you would need to modify the example to use this with a live account, as it only looks for the built in Sim101 account. It would also need modification in order to be used with forex pairs not quoted as FX/USD, which is noted in the example comments.

              Basically, it's set up to pull the size of the Sim101 account, calculate a percentage of that based on the AccountPercentage input (default would be 1%). It then converts it to how much of the Forex Pair to purchase so you're only risking that percentage of the account.

              If you are just looking for information on how to actually apply the strategy to a chart and run it, that may be found in our help guide here:



              Please let us know if we may be of further assistance to you.
              Kate W.NinjaTrader Customer Service

              Comment


                #8
                very complicated think this will only delay and not work at all, at sometimes I wish I had just not gone with paying1600 for NT, all other platforms offer this as default on the order enter ticket

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by PaulMohn, Today, 05:00 AM
                0 responses
                7 views
                0 likes
                Last Post PaulMohn  
                Started by ZenCortexAuCost, Today, 04:24 AM
                0 responses
                6 views
                0 likes
                Last Post ZenCortexAuCost  
                Started by ZenCortexAuCost, Today, 04:22 AM
                0 responses
                3 views
                0 likes
                Last Post ZenCortexAuCost  
                Started by SantoshXX, Today, 03:09 AM
                0 responses
                16 views
                0 likes
                Last Post SantoshXX  
                Started by DanielTynera, Today, 01:14 AM
                0 responses
                5 views
                0 likes
                Last Post DanielTynera  
                Working...
                X