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 Mindset, 04-21-2026, 06:46 AM
            0 responses
            90 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Started by M4ndoo, 04-20-2026, 05:21 PM
            0 responses
            137 views
            0 likes
            Last Post M4ndoo
            by M4ndoo
             
            Started by M4ndoo, 04-19-2026, 05:54 PM
            0 responses
            68 views
            0 likes
            Last Post M4ndoo
            by M4ndoo
             
            Started by cmoran13, 04-16-2026, 01:02 PM
            0 responses
            120 views
            0 likes
            Last Post cmoran13  
            Started by PaulMohn, 04-10-2026, 11:11 AM
            0 responses
            71 views
            0 likes
            Last Post PaulMohn  
            Working...
            X