Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Newbie question - Reverse Positions

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

    Newbie question - Reverse Positions

    I used the strategy wizard to create a template strategy and now trying to customize the strategy.

    In essence, this is what I am trying to do.

    If (Condition 1 that should trigger a long)
    EnterLong
    ExitShort

    if (Condition 2 that should trigger a short)
    EnterShort
    ExitLong

    The problem is I dont know how to check whether I have an active position to Exit (long or short). If I run it as above, an extra order is created.

    Also, would appreciate if there is any "initialize" actions that I should do when the strategy starts.

    #2
    Hello,

    Thank you for the question.

    You can add additional checks to your current conditions to check your position.

    You can do this by doing the following in the condition builder:

    On the left side
    Strategy -> Current Market Position
    In the center choose the according operator or == for example.
    On the right side
    Strategy -> Flat

    This would be saying if the current position is flat, allow the condition to happen.

    I look forward to being of further assistance .

    Comment


      #3
      Thanks for the information.

      From what I understand, this checks whether there is any open position. What I was looking for is a nested condition as shown in the bold below.

      If (Condition 1 that should trigger a long)
      EnterLong
      if there is an open short position,
      ExitShort


      if (Condition 2 that should trigger a short)
      EnterShort
      if there is an open long position,
      ExitLong

      Comment


        #4
        Hello,

        Thank you for the reply.

        In the wizard there is no way to create nested conditions, this would be something you need to unlock and manually code.

        You can create additional condition sets using the position check for this or you can use user variables like bool values to add additional depth to your conditions.

        For example you could set user variable 0 to a value of 1 when you enter long, and then in another set check if user variable 0 == 1 and also check if you are long and if so then exit. this would ensure you are in a position and the order had been filled. you would also need to set the variable back to 0 after the exit to ensure this loop could happen again.

        This would really be the only way to add additional depth using the wizard.

        I look forward to being of further assistance.

        Comment


          #5
          Thanks Jesse.

          A nested condition was not really needed I think using the && option would have worked. Just added more conditions.

          Appreciate the pointer.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Geovanny Suaza, 02-11-2026, 06:32 PM
          0 responses
          630 views
          0 likes
          Last Post Geovanny Suaza  
          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
          0 responses
          364 views
          1 like
          Last Post Geovanny Suaza  
          Started by Mindset, 02-09-2026, 11:44 AM
          0 responses
          105 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by Geovanny Suaza, 02-02-2026, 12:30 PM
          0 responses
          566 views
          1 like
          Last Post Geovanny Suaza  
          Started by RFrosty, 01-28-2026, 06:49 PM
          0 responses
          568 views
          1 like
          Last Post RFrosty
          by RFrosty
           
          Working...
          X