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

BoolSeries Check

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

    BoolSeries Check

    I am either brain locked or am trying to put a square peg in a round hole.

    How can I wrote some code that will evaluate a BoolSeries to determine if at any point in the last 10 bars a TRUE was present.

    #2
    Hi TAJTrades, please take a look at this link - http://www.ninjatrader-support.com/H...gCommands.html

    You want to use a while loop to check -

    Code:
    [SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]int[/COLOR][/SIZE][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][SIZE=2] x = [/SIZE][/SIZE][SIZE=2][COLOR=#800080][SIZE=2][COLOR=#800080][SIZE=2][COLOR=#800080]0[/COLOR][/SIZE][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][SIZE=2];
    [/SIZE][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]while[/COLOR][/SIZE][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][SIZE=2] (x < [/SIZE][/SIZE][SIZE=2][COLOR=#800080][SIZE=2][COLOR=#800080][SIZE=2][COLOR=#800080]10[/COLOR][/SIZE][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][SIZE=2])
    {
          [/SIZE][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]if[/COLOR][/SIZE][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][SIZE=2] (myBoolSeries[x] == [/SIZE][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]true[/COLOR][/SIZE][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][SIZE=2])
               valueFound = [/SIZE][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]true[/COLOR][/SIZE][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][SIZE=2];
          x++;
    }
    [/SIZE][/SIZE]
    BertrandNinjaTrader Customer Service

    Comment


      #3
      Thanks Bertrand. I was thinking something along the lines of MRO, Highest or For loop. While loop may be the best option.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by manueldecastro, Yesterday, 10:26 AM
      4 responses
      16 views
      0 likes
      Last Post manueldecastro  
      Started by TraderIqbal, 10-20-2023, 10:12 AM
      2 responses
      118 views
      0 likes
      Last Post Funnywo
      by Funnywo
       
      Started by Creamers, 04-27-2024, 05:32 AM
      12 responses
      72 views
      0 likes
      Last Post Creamers  
      Started by fredericlebre, Today, 01:19 AM
      0 responses
      7 views
      0 likes
      Last Post fredericlebre  
      Started by TraderJA, Today, 12:06 AM
      0 responses
      10 views
      0 likes
      Last Post TraderJA  
      Working...
      X