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 SalmaTrader, 07-07-2026, 10:26 PM
        0 responses
        47 views
        0 likes
        Last Post SalmaTrader  
        Started by CarlTrading, 07-05-2026, 01:16 PM
        0 responses
        22 views
        0 likes
        Last Post CarlTrading  
        Started by CaptainJack, 06-17-2026, 10:32 AM
        0 responses
        15 views
        0 likes
        Last Post CaptainJack  
        Started by kinfxhk, 06-17-2026, 04:15 AM
        0 responses
        21 views
        0 likes
        Last Post kinfxhk
        by kinfxhk
         
        Started by kinfxhk, 06-17-2026, 04:06 AM
        0 responses
        23 views
        0 likes
        Last Post kinfxhk
        by kinfxhk
         
        Working...
        X