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 charlesugo_1, 05-26-2026, 05:03 PM
            0 responses
            52 views
            0 likes
            Last Post charlesugo_1  
            Started by DannyP96, 05-18-2026, 02:38 PM
            1 response
            142 views
            0 likes
            Last Post NinjaTrader_ChelseaB  
            Started by CarlTrading, 05-11-2026, 05:56 AM
            0 responses
            160 views
            0 likes
            Last Post CarlTrading  
            Started by CarlTrading, 05-10-2026, 08:12 PM
            0 responses
            96 views
            0 likes
            Last Post CarlTrading  
            Started by Hwop38, 05-04-2026, 07:02 PM
            0 responses
            275 views
            0 likes
            Last Post Hwop38
            by Hwop38
             
            Working...
            X