Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Bars Ago

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

    Bars Ago

    Hi there...

    When referencing to make a indicator or strategy to look back, say, 3 bars ago, will it look for the condition I am calling it to search for during the 3rd, 2nd, 1st back, and current bar (i.e. 3, 2, 1, and 0)? Or will it only recognize the condition on the 3rd bar only exclusively?

    If only exclusively, then how can I make it search for the condition I am searching for to be called on the last 4 bars (i.e. the 3rd, 2nd, 1st, or current bar) with the least code possible to instruct it. The condition only has to happen 1 time during the last 3 + the current bar (totaling the last for bars)?



    Greg

    #2
    I'm not 100% sure I understand you, but if you mean you have a condition (or set of conditions) that could in theory be checked on each bar, you and want that condition to have been true on at least one bar in the last X bars, then take a look at:

    MRO

    Which is Most Recent Occurrence. Look in the ninjascript section of the help guide and do a search for MRO and read up. I think it might be what you're looking for.

    Comment


      #3
      coolmoss...thanks for the info...

      Just curious...is there a was to do MRO in the condition builder as well?

      Comment


        #4
        Greg, this would need to be used via directly coding in the NinjaScript editor.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by charlesugo_1, 05-26-2026, 05:03 PM
        0 responses
        59 views
        0 likes
        Last Post charlesugo_1  
        Started by DannyP96, 05-18-2026, 02:38 PM
        1 response
        143 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 05-11-2026, 05:56 AM
        0 responses
        161 views
        0 likes
        Last Post CarlTrading  
        Started by CarlTrading, 05-10-2026, 08:12 PM
        0 responses
        97 views
        0 likes
        Last Post CarlTrading  
        Started by Hwop38, 05-04-2026, 07:02 PM
        0 responses
        283 views
        0 likes
        Last Post Hwop38
        by Hwop38
         
        Working...
        X