I would like to entry a trade between 1-3 seconds (Random) after the close of the bar. My strategy generates orders on Bar Update. How can I do this? Thanks
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Entry Time
Collapse
X
-
Hello Sandra73,
Thank you for your note.
You could start a timer when a bar closes and you want to submit an order, generate a random number between 1-3, then have the timer count up that many seconds.
You could then have the timer submit the order when count reaches the random number, however, this would only work in realtime. If you wanted something like that in historical you would have to work with a 1 second data series to achieve that.
An example of a timer may be found in this example from our help guide:
A fairly good example of creating a random numbers is available here:
Please let us know if we may be of further assistance to you.
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
137 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
120 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