Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
time based order entry
Collapse
X
-
time based order entry
Hello. I'm currently working in Unmanaged framework. Based on various signals, the strategy generates buys or sells, and each order effectively has a stop and profit target associated with it. However, I would like to add a condition such that if after a given amount of time the stop or profit target hasn't been hit, then I close that particular trade. For example,suppose I buy one unit. If after 24 periods the stop or profit target hasn't been reached, then I would like to sell that unit. Does anyone have any examples of this?Tags: None
-
Hello stewarco,
Thank you for your note.
What you could do is save the current bar plus 24 to a variable when you enter a position, then later in the script check if the current bar is greater than that variable, and if so exit the position.
I’ve put together a snippet of how you could do this in the managed approach, to do this in the unmanaged approach you’d just swap the managed order methods with the unmanaged order methods.
Please let us know if you need further assistance.Alan P.NinjaTrader Customer Service
-
BarsSinceEntryExecution()?Originally posted by stewarco View PostHello. I'm currently working in Unmanaged framework. Based on various signals, the strategy generates buys or sells, and each order effectively has a stop and profit target associated with it. However, I would like to add a condition such that if after a given amount of time the stop or profit target hasn't been hit, then I close that particular trade. For example,suppose I buy one unit. If after 24 periods the stop or profit target hasn't been reached, then I would like to sell that unit. Does anyone have any examples of this?
ref: https://ninjatrader.com/support/help...yexecution.htm
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by NullPointStrategies, Yesterday, 05:17 AM
|
0 responses
54 views
0 likes
|
Last Post
|
||
|
Started by argusthome, 03-08-2026, 10:06 AM
|
0 responses
130 views
0 likes
|
Last Post
by argusthome
03-08-2026, 10:06 AM
|
||
|
Started by NabilKhattabi, 03-06-2026, 11:18 AM
|
0 responses
72 views
0 likes
|
Last Post
|
||
|
Started by Deep42, 03-06-2026, 12:28 AM
|
0 responses
44 views
0 likes
|
Last Post
by Deep42
03-06-2026, 12:28 AM
|
||
|
Started by TheRealMorford, 03-05-2026, 06:15 PM
|
0 responses
49 views
0 likes
|
Last Post
|

Comment