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
Determining Original Order
Collapse
X
-
Originally posted by NinjaTrader_Josh View PostThe signal strings need to be 100% the same. You can only call the Exit()s after you have successfully entered into a long position.
Comment
-
If you want an order to be placed for your long position you have to tell it to place it after you actually have a long position. Trying to place them before you even have a long position does not work. There is nothing for them to exit and as such they will be ignored.Josh P.NinjaTrader Customer Service
Comment
-
Originally posted by NinjaTrader_Josh View PostIf you want an order to be placed for your long position you have to tell it to place it after you actually have a long position. Trying to place them before you even have a long position does not work. There is nothing for them to exit and as such they will be ignored.
two more questions:
1) if i place a long order for 2 lots and in OnExecution I get notification of 1 lot being executed (e.g. a partial fill) I place my ExitlongLimit for 1 lot (as a target for the 1 lot filled) and then I get another notification in OnExecution to say the 2nd lot has been filled I need to call ExitlongLimit again to set up my target order for te 2nd lot ... do I a) just call ExitlongLimit again with one 1 lot and Ninja will update my ExitlongLimit order to 2 lots or b) should I call it with the new total amount .. e.g. 2 lots ..
2) will OnOrderUpdate always get called before OnExecution ... if that is the case and I need to do b) above I can then just access execution.Order.Filled to update my target order
Thanks again
Paul
Comment
-
1. Call it with 2 lots to amend the original order to a quantity of two.
2. Yes OnOrderUpdate() is before. You should not use .Order.Filled because the underlying object could be already ahead of the execution. Problem like when you have 3 lots. First one fills, then second one. On second you call execution.Order.Filled, but it is already at a complete filled state. Now you just submitted 3 lot order without seeing the execution first. This will cause problems and should not be done. You will want to keep track of the .Quantity that comes in to the OnExecution for your signal name and keep track of it manually.Josh P.NinjaTrader Customer Service
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by casabella, Today, 04:12 AM
|
1 response
17 views
0 likes
|
Last Post Today, 06:26 AM | ||
Started by ETFVoyageur, Today, 05:50 AM
|
0 responses
6 views
0 likes
|
Last Post
by ETFVoyageur
Today, 05:50 AM
|
||
Started by DawnTreader, 05-08-2024, 05:58 PM
|
17 responses
63 views
0 likes
|
Last Post Today, 05:36 AM | ||
Started by ttrader23, 05-08-2024, 09:04 AM
|
10 responses
48 views
0 likes
|
Last Post Today, 05:21 AM | ||
Started by agclub, 04-21-2024, 08:57 PM
|
6 responses
41 views
0 likes
|
Last Post Today, 05:18 AM |
Comment