Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to calculate a position percentage size in the Builder

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

    How to calculate a position percentage size in the Builder

    Hello,

    I would like to know how can I set the position quantity of a strategy in the builder as the account is growing up or going down, this in a percentage of the account. In the condition Builder I can't set a math calculation to calculate the contract size which can be:
    // Calculate position size
    positionsize=round(accountvalue(iex:100000)*percen tage(iex:1.5%)/(stopsize*tickvalue),0);
    Do I need to unlock the code or how can I calculate the quantity?

    Thank you so much

    #2
    Hello jeremy83846,

    This would be a situation where unlocking the code would be needed. The math you would need for this would not be able to be done using the arithmetic builder. The actual account value also is not something you can access in the builder, you could define a user input for that to manually define an account size to use in the script but the other math would still be an issue.

    I look forward to being of further assistance.

    Comment


      #3
      OK, so if I need to use the code and I set the Realized PnL it is not recognized as the account size of that math formula?

      Comment


        #4
        Hello jeremy83846,

        I am not certain I understand the question how it was written, could you clarify what you are asking to do?

        I look forward to being of further assistance.

        Comment


          #5
          For example if I set on the code:

          EnterShort(Convert.ToInt32(SystemPerformance.AllTr ades.TradesPerformance.Currency.CumProfit*percen tage(iex:1.5%)/(stopsize*tickvalue), @"Corto");

          That formula should be honored?

          Comment


            #6
            Hello jeremy83846,

            Do you mean will that value be used for the short entry? If so yes.

            If you calculate a value before submitting the entry that would work to set a quantity. You could do the calculation directly in the method like you have shown or do it a line above that and make a variable that is really up to your coding style.

            I look forward to being of further assistance.

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by NullPointStrategies, Today, 05:17 AM
            0 responses
            50 views
            0 likes
            Last Post NullPointStrategies  
            Started by argusthome, 03-08-2026, 10:06 AM
            0 responses
            126 views
            0 likes
            Last Post argusthome  
            Started by NabilKhattabi, 03-06-2026, 11:18 AM
            0 responses
            69 views
            0 likes
            Last Post NabilKhattabi  
            Started by Deep42, 03-06-2026, 12:28 AM
            0 responses
            42 views
            0 likes
            Last Post Deep42
            by Deep42
             
            Started by TheRealMorford, 03-05-2026, 06:15 PM
            0 responses
            46 views
            0 likes
            Last Post TheRealMorford  
            Working...
            X