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

Bars since THAT happened.... "HowToDoIt" ?????

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

    Bars since THAT happened.... "HowToDoIt" ?????

    Hello.

    I am searching the forum, but I can not find any Ninjascript development
    relative article or any help about this.

    I want to return the << BARS since the Nth most recent time
    that something happened >>.

    For example, I want to get "the number of BARS that have passed",
    since the LAST time (the 1st most recent time ago),
    that the CLOSE was greater than the OPEN.

    So, at the specific example,
    If we had 4 red bars in a row (including the currentbar),
    that Close was less than the Open...,
    I want today my "Bars since" indicator, or my "Bars since" variable,
    to return the value of 4.


    How can I do it ? What expressions should I use to succeed on that ?

    Is also possible to calculate the Nth (where N>1) most recent time...., that THIS happened ???

    For example not the 1st most recent, but the 2nd time ago
    that my required expression (Close>Open) was true.


    Please help if anyone got the answer, or a reference link.
    Thanx.

    #2
    Hi Andy, please take a look at the links below, they point to the Most Recent / Least Recent Occurence methods, which should do the job for you.

    1. Most Recent Occurence - http://www.ninjatrader-support.com/H...urenceMRO.html

    2. Least Recent Occurence - http://www.ninjatrader-support.com/H...urenceLRO.html
    BertrandNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by tkaboris, Today, 08:32 AM
    3 responses
    6 views
    0 likes
    Last Post NinjaTrader_Jesse  
    Started by dcriador, Today, 08:56 AM
    1 response
    11 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by algospoke, Yesterday, 06:36 PM
    2 responses
    13 views
    0 likes
    Last Post algospoke  
    Started by RaddiFX, Yesterday, 09:55 PM
    3 responses
    27 views
    0 likes
    Last Post NinjaTrader_Gaby  
    Started by geotrades1, Today, 08:33 AM
    2 responses
    11 views
    0 likes
    Last Post geotrades1  
    Working...
    X