Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Strategy Bars Required Question
Collapse
X
-
Strategy Bars Required Question
How about if I want minimum 20 bars required to trade for each daily new session? How to set it by using the firstbarofsession? Any code example or sample for this?Originally posted by NinjaTrader_Bertrand View PostLast edited by NinjaTrader_ChrisL; 02-22-2022, 09:50 AM.Tags: None
-
Hi stantenlee, thanks for posting. If a topic is greater than 1 year old, please start a new topic and reference the link to the related topic:
To wait for 20 bars after the session you need a counter in the strategy that will count up to 20 since FirstBarOfSession is true. Counters are only possible in unlocked scripts, so you will need to write this in C# rather than using the builder. The C# logic would look like this :
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
Best regards,
-ChrisL
-
-
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Mindset, 04-21-2026, 06:46 AM
|
0 responses
90 views
0 likes
|
Last Post
by Mindset
04-21-2026, 06:46 AM
|
||
|
Started by M4ndoo, 04-20-2026, 05:21 PM
|
0 responses
135 views
0 likes
|
Last Post
by M4ndoo
04-20-2026, 05:21 PM
|
||
|
Started by M4ndoo, 04-19-2026, 05:54 PM
|
0 responses
68 views
0 likes
|
Last Post
by M4ndoo
04-19-2026, 05:54 PM
|
||
|
Started by cmoran13, 04-16-2026, 01:02 PM
|
0 responses
119 views
0 likes
|
Last Post
by cmoran13
04-16-2026, 01:02 PM
|
||
|
Started by PaulMohn, 04-10-2026, 11:11 AM
|
0 responses
69 views
0 likes
|
Last Post
by PaulMohn
04-10-2026, 11:11 AM
|

Comment