Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Barssince event using strategy builder NT8

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

    Barssince event using strategy builder NT8

    Is there a way to do a barsince type of function using strategy builder. Guessing there is a technique to it. (Would prefer to avoid writing the actual code),

    simple condition like:
    barsince (some group of indicator events).

    currently can think of only 2 methods:
    1) write an indicator that toggles between 0 & 1 and then use the cross over comparison function with look back. This means I need to hack together an indicator for it.
    2) create a set for each bar that I want to look back for. So if wanted to look back 5 bars would need to use 5 sets which is fairly clunky.

    any suggested method.
    Thank you

    #2
    Hello.

    Thanks for the post.

    NinjaScript offers the Most Recent Occurrence (MRO) function for this purpose, but one would have to write this in a script, it can not be used in the Strategy Builder. Making a function of this type would require looping so making multiple sets would be the only way to emulate a loop in the Strategy Builder.

    There is a sample use case of MRO on it's help guide page:



    Please let me know if I may be of any further assistance.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by NullPointStrategies, Today, 05:17 AM
    0 responses
    44 views
    0 likes
    Last Post NullPointStrategies  
    Started by argusthome, 03-08-2026, 10:06 AM
    0 responses
    124 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    65 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    42 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Started by TheRealMorford, 03-05-2026, 06:15 PM
    0 responses
    46 views
    0 likes
    Last Post TheRealMorford  
    Working...
    X