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 Rapine Heihei, Today, 08:19 PM
    1 response
    6 views
    0 likes
    Last Post NinjaTrader_Manfred  
    Started by Rapine Heihei, Today, 08:25 PM
    0 responses
    5 views
    0 likes
    Last Post Rapine Heihei  
    Started by f.saeidi, Today, 08:01 PM
    1 response
    4 views
    0 likes
    Last Post NinjaTrader_Manfred  
    Started by Rapine Heihei, Today, 07:51 PM
    0 responses
    6 views
    0 likes
    Last Post Rapine Heihei  
    Started by frslvr, 04-11-2024, 07:26 AM
    5 responses
    97 views
    1 like
    Last Post caryc123  
    Working...
    X