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 Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        670 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        379 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        111 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
        582 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X