Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Position sizing

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

    Position sizing

    Hello,


    I have excellent debugging AOS, but I have several questions related to position sizing and their application in Script. I would appreciate if someone helps me.
    Q1. Calculation of Kelly and Lead Risk is realized through a double variable.
    The result is the size of the position of "double", and is rounded to an integer. Open position requires variable "int".

    EnterLong (int, "BuyLong1");

    And here is precisely the problem as I add value to double = int because EnterLong function does not work with double variable?

    Q2. For my calculations, position sizing using the function

    "Performance.AllTrades .....", for back-testing.

    I think the real trading will be used function Performance.RealtimeTrades. Is this correct?

    Q3. Is it possible to change the quantity of contracts, or some setting strategy when this strategy is running? I am asking is because the demo does not allow me to change settings.


    and finally

    Q4. If the strategy is running, and I have to restart your computer or platform, I re-start the strategy. Will my business strategy to know what was taken? "Performance.RealtimeTrades"

    Apologies for my English.

    Thank you for your reply Rasto

    #2
    Q1: Use Math.Round()

    Comment


      #3
      Sorry, Aslan thanks for the recommendation but Math.round returns only "double" and not for the "int". This is not a solution

      Comment


        #4
        double size = ....
        int contracts = (int)Math.Round(size);

        Comment


          #5
          Aslan, thank you very much, you genius's really helped me

          Comment


            #6
            Can somebody answer to other questions, thank you much if so?

            Comment


              #7
              Hello,

              This link should answer most of your question. Let me know if you still have more questions:

              And this link:
              DenNinjaTrader Customer Service

              Comment


                #8
                Originally posted by rastotrader View Post
                Can somebody answer to other questions, thank you much if so?
                Maybe this can help a little http://www.ninjatrader-support2.com/...=position+size

                Comment


                  #9
                  Josh and PrTester thank you for your reply.
                  PrTester I have code very similar to PS, but your code so I brought a different look. Even on my last question:
                  They know my strategy in realtime trading when it restarts, which carried realtime business before?

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by CarlTrading, 03-31-2026, 09:41 PM
                  1 response
                  152 views
                  1 like
                  Last Post NinjaTrader_ChelseaB  
                  Started by CarlTrading, 04-01-2026, 02:41 AM
                  0 responses
                  87 views
                  1 like
                  Last Post CarlTrading  
                  Started by CaptainJack, 03-31-2026, 11:44 PM
                  0 responses
                  131 views
                  2 likes
                  Last Post CaptainJack  
                  Started by CarlTrading, 03-30-2026, 11:51 AM
                  0 responses
                  127 views
                  1 like
                  Last Post CarlTrading  
                  Started by CarlTrading, 03-30-2026, 11:48 AM
                  0 responses
                  106 views
                  0 likes
                  Last Post CarlTrading  
                  Working...
                  X