Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Delay Trade for A Day

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

    Delay Trade for A Day

    Hello,

    I know this has probably been discussed previously, but if I have a strategy that triggers on a certain day, but I want to delay the execution until the next day or some following day. How can you simply do that using the EnterLong/ExitLong commands? I'm using a daily chart period and simple market orders.

    Thanks,

    Regards,

    Lee

    #2
    Hello Lee,

    Thanks for your post.

    You can change your strategy to set a logic variable true instead of placing an order when your conditions are true. You would also save the current bar number and then compare that to later bars (days) and then you can set the number of days when you actually do place your order.

    For the following pseudocode:
    readyToPlaceOrder is set a bool variable (true or false) to indicate when your entry conditions are in agreement
    entryConditionsTrueBar is an integer variable that will hold the bar number when the entry conditions were true, this then sets what day that was.


    if (all of your conditions to enter && !readyToPlaceOrder)
    {
    readyToPlaceOrder = true; // set bool true
    entryConditionsTrueBar = CurrentBar; // save the current bar (day that conditions are true)
    }

    if (readyToPlaceOrder && CurrentBar != entryConditionsTrueBar)
    {
    if (CurrentBar - entryConditionsTrueBar > = (you choose number of days here))
    {
    // your entry orders here
    readyToPlaceOrder = false; // reset
    }

    }

    Comment


      #3
      Paul,

      Thank you for the info as this is what I was looking for! I will give this a try and see how it works.

      Thanks again!

      Regards,

      Lee

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by CarlTrading, 03-31-2026, 09:41 PM
      1 response
      81 views
      1 like
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 04-01-2026, 02:41 AM
      0 responses
      41 views
      0 likes
      Last Post CarlTrading  
      Started by CaptainJack, 03-31-2026, 11:44 PM
      0 responses
      64 views
      2 likes
      Last Post CaptainJack  
      Started by CarlTrading, 03-30-2026, 11:51 AM
      0 responses
      66 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 03-30-2026, 11:48 AM
      0 responses
      54 views
      0 likes
      Last Post CarlTrading  
      Working...
      X