Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Quantity of contract in strategy builder

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

    Quantity of contract in strategy builder

    Hellos Guys..!

    already code my strategy but when is enable in live account or historical go "short" sell 2 contracts and when go "long" buy 1 contract.

    I have the default quantity (1) in Order properties .

    How can I fix it?

    Thank you

    #2
    Hello kevingrillo,

    Thank you for your post.

    Could you provide screenshots of your conditions and actions sets in the Strategy Builder?

    Am I understanding correctly that you're wanting to have 1 contract in each direction?

    Thanks in advance; I look forward to assisting you further.

    Comment


      #3
      Thank you for your reply.

      Here the screenshots of the set when go long and short.

      "Am I understanding correctly that you're wanting to have 1 contract in each direction?"
      Yes, i want go 1 contract per side and increase contracts in the next 4 months.

      I appreciate your help
      Attached Files

      Comment


        #4
        Hello kevingrillo,

        Thank you for your reply.

        The most likely cause of positions doubling would be that you are calling both an Exit order to exit the long position and an Entry order to enter the Short position on the same pass through On Bar Update. Are you using an Exit order to exit the long position before entering the short position or vice versa? Can you provide screenshots of any Conditions and Actions that include an exit order as well?

        Thanks in advance; I look forward to assisting you further.

        Comment


          #5
          Here the sets to exit the position.

          Maybe can be the problem
          Attached Files

          Comment


            #6
            Hello Kevin,

            Thank you for your reply.

            I note your conditions for the long exit and short entry are the same, which means they would be triggered on the same run through of On Bar Update. If you're reversing a position, you don't have to call an Exit Order from the prior position. Entry orders like EnterLong() and EnterShort() will automatically manage the prior position for you, by checking to see if there's an existing position in the other direction and sending a close order for that position before submitting the order to bring you into the new position.

            What happens if you call both an exit and and entry order on the same run through the logic is that the exit order will see the open position and submit an order to close it. However, there will not be enough time for that position to be updated before the Entry order in the other direction is submitted. So, it will also submit a close order to manage the position as well as an order to bring the position to the new position, and you will end up with a doubled position rather than the position you meant to be in.

            You can fix this by simply removing the sets with the Exit orders - the entry orders will manage the reversal for you.

            Please let us know if we may be of further assistance to you.

            Comment


              #7
              Thank you Kate

              Will do the changes and let you know

              Happy 2022!!.. amazing support

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by NullPointStrategies, Yesterday, 05:17 AM
              0 responses
              71 views
              0 likes
              Last Post NullPointStrategies  
              Started by argusthome, 03-08-2026, 10:06 AM
              0 responses
              143 views
              0 likes
              Last Post argusthome  
              Started by NabilKhattabi, 03-06-2026, 11:18 AM
              0 responses
              76 views
              0 likes
              Last Post NabilKhattabi  
              Started by Deep42, 03-06-2026, 12:28 AM
              0 responses
              47 views
              0 likes
              Last Post Deep42
              by Deep42
               
              Started by TheRealMorford, 03-05-2026, 06:15 PM
              0 responses
              51 views
              0 likes
              Last Post TheRealMorford  
              Working...
              X