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 NullPointStrategies, Today, 05:17 AM
|
0 responses
50 views
0 likes
|
Last Post
|
||
|
Started by argusthome, 03-08-2026, 10:06 AM
|
0 responses
126 views
0 likes
|
Last Post
by argusthome
03-08-2026, 10:06 AM
|
||
|
Started by NabilKhattabi, 03-06-2026, 11:18 AM
|
0 responses
69 views
0 likes
|
Last Post
|
||
|
Started by Deep42, 03-06-2026, 12:28 AM
|
0 responses
42 views
0 likes
|
Last Post
by Deep42
03-06-2026, 12:28 AM
|
||
|
Started by TheRealMorford, 03-05-2026, 06:15 PM
|
0 responses
46 views
0 likes
|
Last Post
|

Comment