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

number of down bars

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

    number of down bars

    Hello,

    Can anyone help on this please

    1) if secondary data has 6 consecutive red candles (15m)
    2) if primary data has 3 red candles in a row

    what function can be used on the above.

    Thanks!

    #2
    Hello ashmanz80,

    Thanks for your post.

    If I am understanding correctly you are asking how to detect for the two conditions.

    To detect for a red candle, this would mean that the Close is less than the Open. Using the bars ago referencing you can check to see is for the last 6 bars the Close was less than the open. IE: Close[0] < Open[0] && Close[1] < Open[1] && etc. etc.

    As you are using a multi time frame script you would need to adjust depending on how you have organized your code. For example:

    if (Close[0][0] < Opens[0][0] && Closes[1][0] <Open[1][0], etc, etc. where [0[0] refers to the current bar of the chart bars, [1][0] refers to the surrent bar of the 1st added data series. You may want to refer to this section of the helpguide: https://ninjatrader.com/support/help...nstruments.htm
    Paul H.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by elirion, Today, 01:36 AM
    0 responses
    3 views
    0 likes
    Last Post elirion
    by elirion
     
    Started by gentlebenthebear, Today, 01:30 AM
    0 responses
    4 views
    0 likes
    Last Post gentlebenthebear  
    Started by samish18, Yesterday, 08:31 AM
    2 responses
    9 views
    0 likes
    Last Post elirion
    by elirion
     
    Started by Mestor, 03-10-2023, 01:50 AM
    16 responses
    390 views
    0 likes
    Last Post z.franck  
    Started by rtwave, 04-12-2024, 09:30 AM
    4 responses
    34 views
    0 likes
    Last Post rtwave
    by rtwave
     
    Working...
    X