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
Cancelled pending exit order, since associated position is closed,
Collapse
X
-
Thank you, Chelsea! That's what I'm now doing based on your comment, Set methods should always be set or reset before the entry is called. That aspect of my strategy is now working.
-
Leave a comment:
-
Hi Chelsea,
Thank you for confirming that should work. So, I did get it to work when I moved the SetProfitTarget and SetStopLoss calls immediately after the entry call in OnBarUpdate. Like this:
Code:scalpTrades[i].EntryOrder = EnterShort(scalpTrades[i].Quantity, scalpTrades[i].EntrySignalName); SetProfitTarget(scalpTrades[i].EntrySignalName, CalculationMode.Ticks, (tpDelta / TickSize), false); SetStopLoss(scalpTrades[i].EntrySignalName, CalculationMode.Price, stopLossInitial, false);
Code:SetProfitTarget(scalpTrades[i].EntrySignalName, CalculationMode.Ticks, (tpDelta / TickSize), false); SetStopLoss(scalpTrades[i].EntrySignalName, CalculationMode.Price, stopLossInitial, false);
Thanks!
Stealth
Leave a comment:
-
Hello Stealth,
When using unique From entry signals with the exit orders, like SetStopLoss(), this will create a separate stop and target for each entry with a unique signal name.
If you want 4 stop losses and profit targets use 4 unique entry signal names. Call SetStopLoss() 4 times with each unique signal name. 4 separate stop losses will be produced.
Leave a comment:
-
More info... For each scalp entry, I have the following code:
SetProfitTarget(scalpTrades[i].EntrySignalName, CalculationMode.Price, scalpTrades[i].TargetPrice, false);
SetStopLoss(scalpTrades[i].EntrySignalName, CalculationMode.Price, scalpTrades[i].StopLossPrice, false);
So, I'm using the unique Entry Signal Name SetProfitTarget/SetStopLoss method call.
Leave a comment:
-
Hello Chelsea/NT8 Support,
A quick follow up... As described above, I'm looking to set 4 scalping orders once my entry price is hit. I now have 4 unique entries (Entry Signal Names..."Scalp1", "Scalp2", etc). In the OnExecutionUpdate, which gets call for each order, I am trying to use SetProfitTarget and SetStopLoss. That is, I would like to set 4 sets of OCO Profit Target and Stop Loss orders each for the scalp entries. It doesn't appear that NT8 likes this since it creates each Profit Target and Stop Loss order with the same signal names ("Profit Target"/"Stop Loss"). Is what I'm trying to do possible?
Thanks,
Stealth
Leave a comment:
-
Hello Chelsea,
I recommend you use unique signal names and individual orders for each quantity that will be scaled.
Kind regards,
Stealth
Leave a comment:
-
Hello Stealth,
If you are attempting to scale in, scale out, I recommend you use unique signal names and individual orders for each quantity that will be scaled.
Cancelling an order would not close a position. Are you having trouble cancelling orders, are you having trouble with an exit order that was submitted that did not fill, or both?
Use TraceOrders and Print() to see what orders are being submitted and filled, and include the output saved to a text file with your next post.
Below is a link to a forum post that demonstrates using prints and TraceOrders to understand behavior.
Leave a comment:
-
Cancelled pending exit order, since associated position is closed,
Hello NT8 Forum,
I'm developing a strategy that enters with 6 contracts, 4 are scalpers and 2 are runners. I have a single market order for the entry with quantity of 6. I handle the setup of partial fills until all 6 are filled. However, I'm getting some scalp target orders cancelled when I get partial fills. For example, with 2 entries and then 4 entries, the 4 target limit orders are set but when the first two targets are met the next two are getting canceled, leaving two position unaccounted for in my scalper logic. (The other two are handled by the runners logic.)
I get this message in the cancelled order process: Cancelled pending exit order, since associated position is closed
But, as explained, there are two remaining positions. Is this happening since 2 positions were filled by a separate order than the other 4?
Even though I use the same Entry Signal Name, there are two Order ids for fulfillment. Therefore, when creating the TP orders (ExitLongLimit orders), the remaining two TP orders are getting canceled since one of the associated Order Ids have been completed with the 2 completed scalps. Is this correct?
(Sorry, if that was clear as mud. )
Thanks,
StealthTags: None
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by rocketman7, Today, 02:12 AM
|
7 responses
28 views
0 likes
|
Last Post Today, 09:23 AM | ||
Started by guillembm, Yesterday, 11:25 AM
|
3 responses
16 views
0 likes
|
Last Post Today, 09:11 AM | ||
Started by junkone, 04-21-2024, 07:17 AM
|
10 responses
148 views
0 likes
|
Last Post Today, 09:03 AM | ||
Started by tsantospinto, 04-12-2024, 07:04 PM
|
6 responses
101 views
0 likes
|
Last Post
by tsantospinto
Today, 08:57 AM
|
||
Started by trilliantrader, 04-18-2024, 08:16 AM
|
7 responses
28 views
0 likes
|
Last Post Today, 07:56 AM |
Leave a comment: