Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Stop order not executed because of bar close below

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

    Stop order not executed because of bar close below

    Hi,
    I use strategy builder to create my strats. For most of them I can't use targets and stops with the atm functionality in the tab Stops and Targets. I am programming the exits under conditions, because they employ dynamic values based on vairables. I am repeatedly facing the following problem:

    When the bar with the entry drops already below the stop or shoots above the target, the stop order or target limit order throw an error, becaue the close of the bar is already below the stop value or above the limit value. This is shown in the screenshot, where the horizontol shows the stop value. It is only executed after the price closed back above and the stop order could finally be placed. What could be an elegant way to solve this problem? I have been thinking about running it on a lower time frame and use an additional series for the logic, but it makes it much more complicated incl. the testing and I would like to avoid it, if possible.
    Click image for larger version

Name:	image.png
Views:	118
Size:	26.9 KB
ID:	1336993

    Thanks!
    Philipp

    #2
    Hello philmg,

    Are you seeing a rejection based on the order price being on the wrong side of the market? If so that would generally require using a more granular series so the targets can be placed at the correct positions in contrast to the current market.

    Comment


      #3
      yes, this is the corresponding error:
      An order has been ignored since the stop price ‘9355’ near the bar stamped ‘05/22/2019 20:11:00’ is invalid based on the price range of the bar. This is an invalid order and subsequent orders may also be ignored.

      Comment


        #4
        Hello philmg,

        That is a message for historical processing, the only way to avoid that is to submit an order within the bar range. That would require editing the logic to make sure the offsets are within the bar range.

        Comment


          #5
          I understand, thanks. The problem with creating the exits in conditions, is that after the entry at the open of a bar, the position is not protected until the bar is closed and the stop order is placed. How can I ensure, that the position is protected until the close of the entry bar?

          My logic for the exits is based on
          If market position = long
          ...
          then place stop market order at price below

          Comment


            #6
            Hello philmg,

            In the builder the only way to do that is by using the stops and targets page. If you use a set to submit the exit order it will be at the bar close or price change/tick depending on the calculate setting. Additionally that setting only applies in realtime, backtests will be at bar close .

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by NullPointStrategies, Today, 05:17 AM
            0 responses
            44 views
            0 likes
            Last Post NullPointStrategies  
            Started by argusthome, 03-08-2026, 10:06 AM
            0 responses
            124 views
            0 likes
            Last Post argusthome  
            Started by NabilKhattabi, 03-06-2026, 11:18 AM
            0 responses
            65 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