Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How long is EnterLongStop valid and more

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

    How long is EnterLongStop valid and more

    Hi;
    I am calling the EnterLongStop method in the OnBarUpdate eventhandler and I am just wondering if it is valid only for the current bar? Basically can I call it on the first bar of the session and then forget about it or do I need to call it on every bar (assuming it hasn't beed filled).

    Also just wondering if I call EnterLongStop for a specific price (e.g. 2322) and the current price is 2330, will it still execute? I have seen instances on my chart where this is ignore even if the current bars high and low engulf the stop price. The price then continued higher and gets filled when it touches again.

    Thanks for any help

    Thomas

    #2
    Thomas, per default this order would expire on the next bar update, but you could always work with the advanced overload offering the liveUntilCancelled parameter, if you set this to 'true' the order is persisted until you cancel it or the end of session handling takes care and expires it.

    The EnterLongStop can only be placed above the current market for a buy, it would not execute in your case then, if you want to buy 2322 when price is at 2330 use a regular buy limit order here.

    Comment


      #3
      Ok thanks, just a follow-up questions on this. I am subscribed to IB data, which does not deliver tick data. I believe the history is stored in minutes. Lets say the Low of the bar is 2100, the high is 2120, open and close are equal at 2115. Will a EnterLongStop 2105 execute in backtesting and what price is taken for Market orders?

      Thanks
      Thomas

      Comment


        #4
        That's correct, you could record the tick data received yourself though or for example use our preferred datafeed Kinetick www.kinetick.com for this backfill.

        It will depend when you submit the EnterLongStop with the price value as long as it's a valid order it's accepted and executed on the next bar, this would be the earliest possible trade location then.

        Comment


          #5
          Dankeschoen again for the quick reply. How can I record my own tick data?

          Also I have attached and image that illustrates the problem very well. I start calling the EnterLongStop method on every bar after 7pm. I have indicated with red arrows where I would have expected the fill. The stop order was at 2204. As you can see the order was then filled 4 hours later.

          It almost seems it requires two consecutive bars to at least touch the stop price for the execution to happen. It's getting late here, but I will test if it works better if I only call EnterLongStop once and leave the order active.

          Regards
          Thomas
          Attached Files

          Comment


            #6
            The tick data received while connected live would be recorded by NT if 'save chart data as historical' is checked under Tools > Options > Data.

            For the order, please work with TraceOrders = true in the Initialize() to debug what's going on under the hood here - this will print out valuable debug info about your order submission to the output window.



            Are those stop market or stop limit orders you place?

            Comment


              #7
              Ok will do tomorrow, just quickly this is the syntax when I place the orders:
              EnterLongStop(highestHigh + (breakoutPips),"Long 1"), so I assume it is a stop limit order. I want it to execute once it touches the price in a breakout scenario.

              Thomas

              Comment


                #8
                That'a stop Market order it would executed as market order once triggered. For a StopLimit use please :

                EnterLongStopLimit(highestHigh + (breakoutPips),"Long 1")

                Comment


                  #9
                  Thanks Bertrand, the TraceOrders helped a lot. I changed the script to use persistant orders instead, and it looks much better than before. There are still some funnies mainly when the breakout occurs around the consolidation zone but I can live with that at the moment.

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                  0 responses
                  635 views
                  0 likes
                  Last Post Geovanny Suaza  
                  Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                  0 responses
                  365 views
                  1 like
                  Last Post Geovanny Suaza  
                  Started by Mindset, 02-09-2026, 11:44 AM
                  0 responses
                  106 views
                  0 likes
                  Last Post Mindset
                  by Mindset
                   
                  Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                  0 responses
                  567 views
                  1 like
                  Last Post Geovanny Suaza  
                  Started by RFrosty, 01-28-2026, 06:49 PM
                  0 responses
                  571 views
                  1 like
                  Last Post RFrosty
                  by RFrosty
                   
                  Working...
                  X