Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Only one position per side

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

    Only one position per side

    Hello,

    I would like to integrate in my strategy a condition that would allow only one trade per side but I don't see what type of function to apply.

    The idea is the following, after the EMA8 crosses over the EMA20 I want to take only one buy trade even if the other conditions are met until the cross is down and in this case I would like to take only one sell position and so on.

    I thought about the boolean condition but I can't find the possibility in strategy builder to say that if the last position was a buy then I can take the sell. If this is possible I will not need to take into account the crossing of the moving averages.

    Could you please give me a line of thought?

    #2
    Hello StephTrad,

    Thank you for your post.

    I'd suggest using a bool to control this, as well as ensuring your Entries Per Direction setting for the strategy is set to All Entries and 1.

    Let's say we create a bool variable in the Inputs and variables screen called LongOK, and we set that to true initially. In our conditions for entry then, we check that LongOK is true, and if our other entry conditions are true, submit a long order and set our LongOK bool to false.

    Then, in our conditions for a short entry we again check LongOK, but we want it to be false if we're going to enter short. Since we entered long and set it to false, it is, so we check our other entry conditions and if those are true we can submit a short entry and set our LongOK bool back to true to set up for the next long entry.

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

    Comment


      #3
      Hello Kate,

      Thank you very much, it works perfectly !!

      Have a nice day

      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