Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

strategy limit order - stop chasing the candles

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

    strategy limit order - stop chasing the candles

    Hi, I know I've seen the answer in here somewhere, but can't find it. How do i tell the strategy to stop moving the limit order up as candles close higher above it?

    #2
    Hello trader3000a,

    Thank you for your note.

    Could you give a code sample of how you're currently placing/moving the Limit order in the strategy so I can best offer guidance?

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

    Comment


      #3
      if ((Close[0] > Open[0])
      && (Close[1] > Open[1]))
      {
      EnterLongLimit(Convert.ToInt32(DefaultQuantity), Median[0], "");
      }

      i'm sure it just keeps checking for 2 consecutive green candles if I'm flat, and then placing a new limit each time if the limit doesn't get hit, so i guess I'm wondering how to tell it to stop checking once the initial limit order is placed

      Comment


        #4
        Hello,

        Thank you for your reply.

        You could certainly use a bool. For example, if you make a bool called OrderPlaced, and set that to false, check that it's false before entering the order, then flipping the bool to true, you could then monitor in OnOrderUpdate for the order to be filled or cancelled and flip the bool back to false when that occurs to keep the order from firing again. Keep in mind that with limit orders the default behavior is to cancel the order once the conditions for entry are no longer true, so it'll get cancelled once the current and prior bar are no longer rising bars. If you want the order to stay live until cancelled, you can do that. Here's an example from our help guide on how to keep an order alive:



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

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by NullPointStrategies, Today, 05:17 AM
        0 responses
        38 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
        64 views
        0 likes
        Last Post NabilKhattabi  
        Started by Deep42, 03-06-2026, 12:28 AM
        0 responses
        41 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