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, 05-11-2026, 05:56 AM
|
0 responses
67 views
0 likes
|
Last Post
by CarlTrading
05-11-2026, 05:56 AM
|
||
|
Started by CarlTrading, 05-10-2026, 08:12 PM
|
0 responses
41 views
0 likes
|
Last Post
by CarlTrading
05-10-2026, 08:12 PM
|
||
|
Started by Hwop38, 05-04-2026, 07:02 PM
|
0 responses
202 views
0 likes
|
Last Post
by Hwop38
05-04-2026, 07:02 PM
|
||
|
Started by CaptainJack, 04-24-2026, 11:07 PM
|
0 responses
366 views
0 likes
|
Last Post
by CaptainJack
04-24-2026, 11:07 PM
|
||
|
Started by Mindset, 04-21-2026, 06:46 AM
|
0 responses
284 views
0 likes
|
Last Post
by Mindset
04-21-2026, 06:46 AM
|

Comment