Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

strategy won't place stops

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

    strategy won't place stops

    Hi, can you please review and tell me why the strategy won't place stops (at all)?
    Attached Files

    #2
    Hello trader3000a,

    Thank you for your note.

    While I do see stops being placed with the attached test script, I think you're pretty likely to run into issues here. You're setting the stop to the low of the previous bar. If the low of the prior bar is equal to the open of the next bar, and the price immediately continues to move down, you're going to get a rejected order as Stop Market orders cannot be placed above the current market price. If this occurs, the strategy will disable itself. This may be what's occurring when you're testing. Also, keep in mind that if you're running this On Bar Close, the stop order for the entry will not be placed until the close of the bar the entry was made on, as the position will not have had time to update, so if you're running this on a 60 minute chart, the stop wouldn't get placed until the 60 minute bar the order was placed on closes.

    Do you see stops being placed when using the test reproduction below? If not, what instrument and bar type/interval are you testing with?

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

    Comment


      #3
      Hi Kate, I realize now that what I want to do is this:

      1. We get a green candle with a higher low and a higher high than the prior red candle

      2. Provided that price is above the high of that red candle, place a limit buy order at that red candle's high, and a stop loss at that red candle's low

      I get buy orders filled, but no stops are generated. I can't get the strategy builder to place a stop. I tried asking it to wait until a 3rd bar's price is above the red candle's high to place the orders, but it still only places the buy order. Any losing trades hold until the end of session.

      Is it because, in the strat builder, we can't place a stop unless we are filled first? And at that point, I can't figure out how to tell it to look back to that first red candle's low since the fill could be any number of candles later...
      Last edited by trader3000a; 09-24-2021, 07:28 AM.

      Comment


        #4
        Hello trader3000a,

        Thank you for your reply.

        Yes, exit orders would be ignored until the entry order has filled. This would apply to any strategy using the Managed Approach, not just Strategy Builder strategies.

        You could save the low price of the bar to a variable called something like StopPrice when the entry order is placed. Then, when the position is long, submit the ExitLongStopMarket. I'd again caution you with this that if you have two bars, one red, one green where the low and high are above the prior low and high, but they don't have a very large range, and are followed by wider ranging bars, you could easily hit that same issue with the stop price being above the market by the time the order has filled. I've attached an example script that illustrates this approach, and if you run it for a bit you'll likely run into a rejection for that reason. I would suggest calculating the stop price as a number of ticks off the average entry price instead to avoid this scenario.

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

        Comment


          #5
          Kate, that's a great help, thank-you!

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by NullPointStrategies, Yesterday, 05:17 AM
          0 responses
          54 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
          72 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