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 cmtjoancolmenero, Yesterday, 03:58 PM
|
12 responses
42 views
0 likes
|
Last Post Today, 12:09 PM | ||
Started by FrazMann, Today, 11:21 AM
|
0 responses
5 views
0 likes
|
Last Post
by FrazMann
Today, 11:21 AM
|
||
Started by geddyisodin, Yesterday, 05:20 AM
|
8 responses
52 views
0 likes
|
Last Post Today, 10:45 AM | ||
Started by DayTradingDEMON, Today, 09:28 AM
|
4 responses
27 views
0 likes
|
Last Post Today, 10:47 AM | ||
Started by George21, Today, 10:07 AM
|
1 response
22 views
0 likes
|
Last Post Today, 10:43 AM |
Comment