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
Order Management on Exiting a Position at Multiple Instances
Collapse
X
-
Order Management on Exiting a Position at Multiple Instances
I am trying to develop a more complicated order management on exiting positions for my strategy. Say my strategy enters me into a position of 2 contracts, what I want the exit strategy to do, is to sell 1 contract once a certain profit is seen and sell the other 1 contract on a trailing stop. Another method I want to test is to sell 1 contract once a certain profit is seen and sell the other 1 contract on a condition. I am at a complete loss of how to do this. ThanksTags: None
-
Hello Chris001,
Thank you for your post.
You can achieve this by entering the quantity with separate orders and then setting up exits that are appropriate to each entry. The main item to focus on is the signalName and fromEntrySignal strings which will allow you to tie entries and exits together. You will also need to implement your own trailing stop logic as the SetTrailStop() and Exit() methods will conflict based on the Internal Order Handling Rules: http://www.ninjatrader.com/support/h...d_approach.htm
Comment
-
I think I can define my own trailing stop. So should I create two identical conditions for two separate orders? One order with a set profit target, the other with none, then with separate conditions I define the trailing stops to these orders? I think I can manage that. Will there be any conflict with NT or the broker if I submit two simultaneous orders? Also to try and condense the code a bit, can I place two orders per condition?
Comment
-
Thanks,
My strategy is now entering two orders per direction. Say my strategy goes long, it purchases two contracts from two identical entry conditions, one contract has an exit signal, the other has the same exit signal and a profit target in a addition. The problem is that immediately after the profit target is met and an exit is made, a re-entry is then made unless both contracts per direction close at the same time (since the entry conditions are still met). I don't want this to happen, I only want both entries to occur together. help please.
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by nandhumca, Yesterday, 03:41 PM
|
1 response
12 views
0 likes
|
Last Post Today, 06:27 AM | ||
Started by The_Sec, Yesterday, 03:37 PM
|
1 response
11 views
0 likes
|
Last Post Today, 06:17 AM | ||
Started by vecnopus, Today, 06:15 AM
|
0 responses
1 view
0 likes
|
Last Post
by vecnopus
Today, 06:15 AM
|
||
Started by Aviram Y, Today, 05:29 AM
|
0 responses
5 views
0 likes
|
Last Post
by Aviram Y
Today, 05:29 AM
|
||
Started by quantismo, 04-17-2024, 05:13 PM
|
3 responses
27 views
0 likes
|
Last Post Today, 05:23 AM |
Comment