Regards to all
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Limit orders using GetCurrentAsk()/Bid()
Collapse
X
-
Limit orders using GetCurrentAsk()/Bid()
I am getting order errors that state "cannot modify a filled order", is that because the limit order which uses GetCurrentAsk() will change the price as the getcurrentask() moves around and when partially filled the limit price cannot be moved / modified? If that is possibly the case would I need to create a static value out of the getCurrentAsk(1) or Closes[1][0] for example?
Regards to allTags: None
-
Hello elliot5,
Thanks for your post.
Testing with Trace Orders enabled can help to see where the original change order came from.
If you ultimately confirm that your observations are correct, you could rewrite your entry conditions so that the order is only placed once. For example, using a bool variable called orderPlaced to control:
if (conditions to enter && orderPlaced == false);
{
EnterLongLimit(...getCurrentAsk()...);
orderPlaced = true; // set to true so only placed once.
}
Once the order has filled you can then reset the bool back to false for the next entry.
-
Hello elliot5,
Thanks for your reply.
When the OnBarUpdate() is called and the order is submitted it would grab the Ask value in play at that time of that moment. If the OnBarUpdate() is called again and the order is executed again then it would again get the current ask which may be different. The logic example provided would prevent that situation.
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by NullPointStrategies, Today, 05:17 AM
|
0 responses
22 views
0 likes
|
Last Post
|
||
|
Started by argusthome, 03-08-2026, 10:06 AM
|
0 responses
120 views
0 likes
|
Last Post
by argusthome
03-08-2026, 10:06 AM
|
||
|
Started by NabilKhattabi, 03-06-2026, 11:18 AM
|
0 responses
63 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
45 views
0 likes
|
Last Post
|

Comment