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:	131
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 Mindset, 04-21-2026, 06:46 AM
            0 responses
            87 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Started by M4ndoo, 04-20-2026, 05:21 PM
            0 responses
            132 views
            0 likes
            Last Post M4ndoo
            by M4ndoo
             
            Started by M4ndoo, 04-19-2026, 05:54 PM
            0 responses
            65 views
            0 likes
            Last Post M4ndoo
            by M4ndoo
             
            Started by cmoran13, 04-16-2026, 01:02 PM
            0 responses
            118 views
            0 likes
            Last Post cmoran13  
            Started by PaulMohn, 04-10-2026, 11:11 AM
            0 responses
            67 views
            0 likes
            Last Post PaulMohn  
            Working...
            X