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 adeelshahzad, Today, 03:54 AM
    5 responses
    32 views
    0 likes
    Last Post NinjaTrader_BrandonH  
    Started by stafe, 04-15-2024, 08:34 PM
    7 responses
    32 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by merzo, 06-25-2023, 02:19 AM
    10 responses
    823 views
    1 like
    Last Post NinjaTrader_ChristopherJ  
    Started by frankthearm, Today, 09:08 AM
    5 responses
    19 views
    0 likes
    Last Post NinjaTrader_Clayton  
    Started by jeronymite, 04-12-2024, 04:26 PM
    3 responses
    43 views
    0 likes
    Last Post jeronymite  
    Working...
    X