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 CarlTrading, 03-31-2026, 09:41 PM
        1 response
        67 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 04-01-2026, 02:41 AM
        0 responses
        36 views
        0 likes
        Last Post CarlTrading  
        Started by CaptainJack, 03-31-2026, 11:44 PM
        0 responses
        59 views
        1 like
        Last Post CaptainJack  
        Started by CarlTrading, 03-30-2026, 11:51 AM
        0 responses
        62 views
        0 likes
        Last Post CarlTrading  
        Started by CarlTrading, 03-30-2026, 11:48 AM
        0 responses
        53 views
        0 likes
        Last Post CarlTrading  
        Working...
        X