Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Time filter: entry works can't get exit to work.

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

    #16
    Jesse,

    I have two11-set strategies for longs & shorts that work well separately, combining breakeven and trailing stop but with no target, removed the target from the breakeven. Allowing the trail to follow price.

    I combined both long & shorts together & now have a 22-set strategy, (so next I can add that 3-set reversal to it). Do you want to look at my work for the 22-set strategy or should I start a new post? It's not that far off, I think I need to add more variables because I'm using the same ones for both the longs & shorts to get to the inputs.

    Comment


      #17
      Hello trdninstyle,

      If you have combined the strategies and now have new questions about that strategy I would suggest to make a new post for questions relating to that strategy.

      If you already have both long and short side strategies working the easiest way to go about combining them would be to rename the variables used in each strategy so that you have unique variable names. You can then make sure each strategy still works after doing that. That will make it easier to see in the 22 set strategy what would need to be changed or you could just remake the combined strategy again based off the two strategies with unique variable names.

      Comment


        #18
        In the inputs I changed the names slightly, I divided the longs & shorts in the inputs with *************

        I used those same variables though for the whole thing. Add another set of variables with unique names similar to the way I did for the inputs?

        Thanks, after this I'll create a new post after some work. Click image for larger version

Name:	2022-12-06 12_52_45-2022_12_06_12_50_07_Strategy_Builder.png
Views:	134
Size:	139.9 KB
ID:	1226420

        Comment


          #19
          Hello trdninstyle,

          When you combine the two strategies your essentially just copying everything over from each strategy so each variable and input name should be unique. The sample on the forum only has the long side so the variable names are less important in that use case. When you add the short side it needs its own inputs and variables so that you can control it correctly.

          Comment


            #20
            Okay, I still have to add the variables then, in unique names. From my pic I never added more variables, I used the same ones for buying and selling.
            Thank you, Jesse.

            This strategy is turning out to be a killer, the breakeven part I think is a hinderance I keep placing a high # on it to get it out of the picture.

            Comment


              #21
              Hello trdninstyle,

              Yes the variable and input names are important so that the right prices/triggers happen for each of the directions. If you share the variables then you may end up making the logic not work the same based on what each condition is checking for.

              If you wanted to remove the break even you can just remove the set for that. The main take away from that break even sample is how to calculate an orders price and then use that price for the order. It also shows how you should use the Sets logically to control when the order is being submitted and held as working until filled.

              Set 1 checks if the TriggerState was previously set to a higher number and if the position is flat, this will reset the strategy by setting TriggerState to 0.
              Set 2 is the entry condition, this checks for flat and whatever other entry conditions you needed. When an entry is submitted TriggerState is set to 1 so that set 3 can work.
              Set 3 Once the position is not flat this set checks if the break even price and trigger price have been set, they will be set and TriggerState is set to 2

              Set 4 is checking for TriggerState to equal 2 so we know that the stop price and trigger price are set. This also checks if the close is greater than the break even price, if so the stop price is modified and TriggerState is set to 3 so this set does not happen again. You can just remove this set if you don't want the breakeven to happen.

              Set 5 checks that the TriggerState is greater than or equal to 2 so that the order is always resubmitted for each bar. As long as a stop price was set and TriggerState is at least 2 then the stop is going to submit for each bar to maintain it.



              Removing set 4 won't affect the overall strategy because the last set is just making sure TriggerState is greater or equal to 2 meaning the entry was filled and a stop price had been calculated. You can add any number of sets before the last set to control setting the stop price, the main take away is that the last set needs to use the variables you are controlling in all the previous sets.





              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by NullPointStrategies, Today, 05:17 AM
              0 responses
              53 views
              0 likes
              Last Post NullPointStrategies  
              Started by argusthome, 03-08-2026, 10:06 AM
              0 responses
              130 views
              0 likes
              Last Post argusthome  
              Started by NabilKhattabi, 03-06-2026, 11:18 AM
              0 responses
              70 views
              0 likes
              Last Post NabilKhattabi  
              Started by Deep42, 03-06-2026, 12:28 AM
              0 responses
              44 views
              0 likes
              Last Post Deep42
              by Deep42
               
              Started by TheRealMorford, 03-05-2026, 06:15 PM
              0 responses
              49 views
              0 likes
              Last Post TheRealMorford  
              Working...
              X