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 CarlTrading, 03-31-2026, 09:41 PM
|
1 response
45 views
0 likes
|
Last Post
|
||
|
Started by CarlTrading, 04-01-2026, 02:41 AM
|
0 responses
21 views
0 likes
|
Last Post
by CarlTrading
04-01-2026, 02:41 AM
|
||
|
Started by CaptainJack, 03-31-2026, 11:44 PM
|
0 responses
31 views
1 like
|
Last Post
by CaptainJack
03-31-2026, 11:44 PM
|
||
|
Started by CarlTrading, 03-30-2026, 11:51 AM
|
0 responses
50 views
0 likes
|
Last Post
by CarlTrading
03-30-2026, 11:51 AM
|
||
|
Started by CarlTrading, 03-30-2026, 11:48 AM
|
0 responses
42 views
0 likes
|
Last Post
by CarlTrading
03-30-2026, 11:48 AM
|

Comment