DaveN
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Limit Orders in Automated Trading
Collapse
X
-
Limit Orders in Automated Trading
I have been experimenting with using limit orders to enter or exit an order withing a strategy wizard generated ninjascript. It seems that sometimes a limit order is left in place for a long time, while other times it seems to be replaced by a different limit order. What I think is going on is when the next bar conditions change such that a new limit order results, it places that order and cancels the old one. If conditions don't change that would generate a new order, the old order persists. Is this accurate? How long will a limit order persist when placed by an automated strategy? Is there any way within the strategy wizard to cancel the order after some period of time or some number of bars?
DaveNTags: None
-
Limit Orders continued
I have one other question related to this thread. When I run my strategy, I sometimes get a message which also cancels the strategy. The message is something like, "order rejected, you cannot place a buy order above the market". I have been using stop orders to trigger a buy or sell, based on the location of a moving average. Is there a different order type I should be using to enter a position since it really doesn't like what I'm doing right now?
DaveN
-
If the limit order is left in place for a long time, it would indicate the market did not fill the order yet. Depending on what setting is used for TIF (time in force), orders will be active until cancelled or are cancelled at the end of the day. For example, if you would use GTC (good till cancelled), the limit order will be working untill it fills.
Unfortunately, it is not possible to cancel the order after some period or number of bars using the Strategy Wizard; you will need to custom code the strategy to establish this.
As per your second post, it seems your strategy submits a sell stop order above the market or a buy stop order below the market; this is not possible. I suggest to submit a limit order instead.
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by NullPointStrategies, Today, 05:17 AM
|
0 responses
41 views
0 likes
|
Last Post
|
||
|
Started by argusthome, 03-08-2026, 10:06 AM
|
0 responses
124 views
0 likes
|
Last Post
by argusthome
03-08-2026, 10:06 AM
|
||
|
Started by NabilKhattabi, 03-06-2026, 11:18 AM
|
0 responses
64 views
0 likes
|
Last Post
|
||
|
Started by Deep42, 03-06-2026, 12:28 AM
|
0 responses
41 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