Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Anticipating a condition being met

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

    Anticipating a condition being met

    Hello,
    Is there a way to program a strategy to anticipate, in the current bar, if a condition will be met at the close of that bar? I use range bars in my strategy. I can physically see that at the close of current bar the condition will be met. If I were trading manually I would place a stoplimit order a tick above/below the close. I would like my strategy to anticipate as well and place a stop limit order at what is going to be the open of the next bar during the current bar in which the condition for entry is being met.
    Rick

    #2
    Rick, there are certainly ways to prepare orders in advance of the current bar closing, if you run the script on CalculateOnBarClose = false so it updates with each tick formed. For example you can check into this approach discussed and developed here - http://www.ninjatrader-support2.com/...ad.php?t=19502

    Comment


      #3
      Thank you for the info. I followed the thread you suggested and found information that might be helpful.

      I found suggestions that ref. the high/low of the current bar +/- Bar.Period.Value*TickSize. Does this ref. the completed range of the current bar? If so is there a way to plug that value into a stop limit order as soon as the bars range is completed?

      I would like to submit a stop limit order when the range bar has completed it's range. The order would be something like (completed range +/- 1 tick).

      Comment


        #4
        No, this just references the bars size on the chart the strategy / indicator was placed on. You can then calculate when a new bar needs to be forming given you know the high and low of the last completed one...thus you can then park at order at this price level for the next bar.

        Comment


          #5
          Great! Can you give me an example of how I would reference the current bar's range so that I can plug that value into a stoplimit order?

          Comment


            #6
            Rick, the current bar's range would just be the difference of High - Low run on CalculateOnBarClose = false, an alternative way would be using the Range() method.

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Geovanny Suaza, 02-11-2026, 06:32 PM
            0 responses
            666 views
            0 likes
            Last Post Geovanny Suaza  
            Started by Geovanny Suaza, 02-11-2026, 05:51 PM
            0 responses
            376 views
            1 like
            Last Post Geovanny Suaza  
            Started by Mindset, 02-09-2026, 11:44 AM
            0 responses
            110 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Started by Geovanny Suaza, 02-02-2026, 12:30 PM
            0 responses
            575 views
            1 like
            Last Post Geovanny Suaza  
            Started by RFrosty, 01-28-2026, 06:49 PM
            0 responses
            580 views
            1 like
            Last Post RFrosty
            by RFrosty
             
            Working...
            X