Regards to all
Announcement
Collapse
Looking for a User App or Add-On built by the NinjaTrader community?
Visit NinjaTrader EcoSystem and our free User App Share!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less
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.
Paul H.NinjaTrader Customer Service
-
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.Paul H.NinjaTrader Customer Service
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by halgo_boulder, 04-20-2024, 08:44 AM
|
2 responses
21 views
0 likes
|
Last Post Today, 09:41 AM | ||
Started by mishhh, 05-25-2010, 08:54 AM
|
19 responses
6,189 views
0 likes
|
Last Post
by rene69851
Today, 09:29 AM
|
||
Started by gwenael, Today, 09:29 AM
|
0 responses
5 views
0 likes
|
Last Post
by gwenael
Today, 09:29 AM
|
||
Started by Karado58, 11-26-2012, 02:57 PM
|
8 responses
14,830 views
0 likes
|
Last Post Today, 09:09 AM | ||
Started by Option Whisperer, Today, 09:05 AM
|
0 responses
2 views
0 likes
|
Last Post Today, 09:05 AM |
Comment