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 Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
581 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
338 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
103 views
0 likes
|
Last Post
by Mindset
02-09-2026, 11:44 AM
|
||
|
Started by Geovanny Suaza, 02-02-2026, 12:30 PM
|
0 responses
554 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
552 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment