Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Postpone or Delay a Long entry for the next 5 bars??? Help

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

    Postpone or Delay a Long entry for the next 5 bars??? Help

    Hello Ninjatrader Team,

    I would like to know how I can Postpone a long entry by 5 bars. For example I have a strategy that goes long, every time the volume is 50,000 on a 5 min bar. So once that condition is met it should wait five bars THEN take the long trade. How can I do this.

    Thank you

    #2
    Originally posted by wallsteetking View Post
    Hello Ninjatrader Team,

    I would like to know how I can Postpone a long entry by 5 bars. For example I have a strategy that goes long, every time the volume is 50,000 on a 5 min bar. So once that condition is met it should wait five bars THEN take the long trade. How can I do this.

    Thank you
    You record the barNumber where your condition is triggered, then check for the barNumber that is 5 greater, and place your entry.

    Code:
     
    private int entryBar = -1;
    Code:
     
    if (EntryConditionsMet)
    {
    entryBar = CurrentBar + 5;
    }
    Code:
     
    if (CurrentBar == entryBar)
    {
    //enter trades here, EnterLong() et.c., then reset the entryBar variable.
    entryBar = -1;
    }

    Comment


      #3
      I have one more question for you, how can i do the same thing but instead of bars i want to work with price. for example lets say i don't want to enter right away, i want to wait when the price falls 3 points, then enter. how can i achieve this.

      Comment


        #4
        To your first question I would just ask Vol[5] > 50000.
        To your curent question, just put a limit order.

        Comment


          #5
          Hello wallsteetking,

          You may capture the price from your entry condition like you did when you captured the bar number and add the price that you want to see:

          Code:
          private double capturedPrice = 0;
          Code:
          if (EntryConditionsMet)
          {
          capturedPrice = Close[0] - 3;
          }
          Then check the current price if it is lower or equal to the price that you have set.

          Code:
          if (Close[0] <= capturedPrice)
          {
          // Enter your trade
          }

          Let us know if that will work for you.
          JCNinjaTrader Customer Service

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by argusthome, 03-08-2026, 10:06 AM
          0 responses
          110 views
          0 likes
          Last Post argusthome  
          Started by NabilKhattabi, 03-06-2026, 11:18 AM
          0 responses
          59 views
          0 likes
          Last Post NabilKhattabi  
          Started by Deep42, 03-06-2026, 12:28 AM
          0 responses
          37 views
          0 likes
          Last Post Deep42
          by Deep42
           
          Started by TheRealMorford, 03-05-2026, 06:15 PM
          0 responses
          41 views
          0 likes
          Last Post TheRealMorford  
          Started by Mindset, 02-28-2026, 06:16 AM
          0 responses
          78 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Working...
          X