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
question about unmanaged
Collapse
X
-
question about unmanaged
good day, please help, I'm trying to understand the unmanaged mode, I decided to do a little strategy with placing orders, but for some reason they don't open, could you please tell me what my error is? Below attached code.Tags: None
-
Originally posted by Papercut110 View Postgood day, please help, I'm trying to understand the unmanaged mode, I decided to do a little strategy with placing orders, but for some reason they don't open, could you please tell me what my error is? Below attached code.
These may be easier to get started with than the Limit entry
orders you're trying to use.
Another problem I see: your entryOrder never gets set back
to null after the entry order is filled.
Otherwise, your use of SubmitOrder() looks fine to me.
On a possibly different note ...
Your OnExecution is not robust enough.
If DefaultQuantity > 1 expect problems with partial fills,
since I see your OnExecution doesn't handle that.
Partial fills for your protective stop and profit target will
also fail for similar reasons.
Why? OnExecution is called for every fill or partial fill of
every order: whether entry, stop, or target.
Consider this:
Your stop order gets partial filled which invokes OnExecution
where your code sets a new stop and target order (which
is obviously not what you will be wanting).
You will only see these major problems with DefaultQuantity > 1
but never with strategy analyzer (which doesn't do partial fills).
You can allow/deny partial fills in Sim101 via the Options dialog.
Study this reference tutorial here for some ideas on a better
and more robust OnExecution:
The OnOrderUpdate() and OnExecution() methods are reserved for experienced programmers. Instead of using Set() methods to submit stop-loss and profit target orders, you can submit and update them manually through the use of IOrder and IExecution objects in the OnOrderUpdate() and OnExecution() methods. The OnOrderUpdate()
-
Hello Papercut110,
Thank you for your post.
bltdavid provides some good insight into what you are performing. I would also recommend implementing debugging techniques such as TraceOrders so that you can see what is happening with the orders. I would also recommend checking the Log tab of the Control Center for any messages on your orders.
For information on TraceOrders please visit the following link: http://ninjatrader.com/support/forum...ead.php?t=3627
Please let me know if you have any questions.
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by samish18, Today, 01:01 PM
|
1 response
6 views
0 likes
|
Last Post Today, 01:25 PM | ||
Started by WHICKED, Today, 12:56 PM
|
1 response
8 views
0 likes
|
Last Post Today, 01:17 PM | ||
Started by cre8able, Today, 01:16 PM
|
0 responses
3 views
0 likes
|
Last Post
by cre8able
Today, 01:16 PM
|
||
Started by chbruno, 04-24-2024, 04:10 PM
|
2 responses
47 views
0 likes
|
Last Post
by chbruno
Today, 01:15 PM
|
||
Started by WHICKED, Today, 12:45 PM
|
1 response
11 views
0 likes
|
Last Post Today, 01:08 PM |
Comment