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.
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!
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
NinjaTrader
BoolSeries Check
Collapse
X
-
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
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by manueldecastro, Yesterday, 10:26 AM
|
4 responses
16 views
0 likes
|
Last Post Today, 02:56 AM | ||
Started by TraderIqbal, 10-20-2023, 10:12 AM
|
2 responses
118 views
0 likes
|
Last Post
by Funnywo
Today, 02:03 AM
|
||
Started by Creamers, 04-27-2024, 05:32 AM
|
12 responses
72 views
0 likes
|
Last Post
by Creamers
Today, 01:50 AM
|
||
Started by fredericlebre, Today, 01:19 AM
|
0 responses
7 views
0 likes
|
Last Post Today, 01:19 AM | ||
Started by TraderJA, Today, 12:06 AM
|
0 responses
10 views
0 likes
|
Last Post
by TraderJA
Today, 12:06 AM
|
Comment