Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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.
    Chris L.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by cmtjoancolmenero, Yesterday, 03:58 PM
    1 response
    17 views
    0 likes
    Last Post NinjaTrader_Gaby  
    Started by benmarkal, Yesterday, 12:52 PM
    3 responses
    23 views
    0 likes
    Last Post NinjaTrader_Gaby  
    Started by helpwanted, Today, 03:06 AM
    1 response
    20 views
    0 likes
    Last Post sarafuenonly123  
    Started by Brevo, Today, 01:45 AM
    0 responses
    12 views
    0 likes
    Last Post Brevo
    by Brevo
     
    Started by pvincent, 06-23-2022, 12:53 PM
    14 responses
    244 views
    0 likes
    Last Post Nyman
    by Nyman
     
    Working...
    X