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 funk10101, Today, 09:43 PM
    0 responses
    6 views
    0 likes
    Last Post funk10101  
    Started by pkefal, 04-11-2024, 07:39 AM
    11 responses
    37 views
    0 likes
    Last Post jeronymite  
    Started by bill2023, Yesterday, 08:51 AM
    8 responses
    44 views
    0 likes
    Last Post bill2023  
    Started by yertle, Today, 08:38 AM
    6 responses
    26 views
    0 likes
    Last Post ryjoga
    by ryjoga
     
    Started by algospoke, Yesterday, 06:40 PM
    2 responses
    24 views
    0 likes
    Last Post algospoke  
    Working...
    X