Thank you
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Place order, lose connection
Collapse
X
-
Place order, lose connection
I have a SetStopLoss statement in my Initialize event. Suppose my strategy places an order and I lose my connection - is a stop limit order on with my broker? What are my options in this situation?
Thank youTags: None
-
Thanks, Bertrand. Yes I use a SetProfitTarget statement as well:
Are you saying the SetStopLoss order will place a market order as opposed to a limit order?Code:SetProfitTarget(sENTRY1L, CalculationMode.Ticks, ProfitTarget); SetProfitTarget(sENTRY1S, CalculationMode.Ticks, ProfitTarget); SetStopLoss(CalculationMode.Ticks, StopLoss);
Also, is there a way I can verify this through a trace or log file?
Thank you.
Comment
-
That's correct , you can check the orders tab in the Control Center to verify what orders and types are placed.
Since you enter a stop / target order both would be linked via OCO logic, here the connection technology used determines if the OCO order management is done locally or natively at the broker's server :
Note: This information is relevant for NinjaTrader 7 only. For NinjaTrader 8, please click here (https://ninjatrader.com/support/helpGuides/nt8/where_do_your_orders_reside_.htm). CQG Orders in a state "Accepted" or "Working" are at the exchange. If the exchange does not support a specific order type, the
Comment
-
Thanks again, Bertrand. I happen to be using the CQG data provider.
Also, I came across the OnConnectionStatus event and was wondering how I might use this upon losing a connection. Is it worthwhile? Could you point me somewhere which codes this event in a useful way?
Comment
-
You're welcome, for CQG the management is local and this would mean NT has to be connected live in order to manage it for you (for example cancel the stop if target reports filled).
OnConnectionStatus() is useful for monitoring your connection state, for example if only the price connection goes down and you're not reconnected within x seconds you could attempt to close positions still within the strategy (provided the order connection is still running).
Another important setting is the ConnectionLoss Handling described here -
Comment
-
Bertrand,
I want to make sure I understand the process so please bear with me -
My data provider is CQG with AMP Futures. I am using SetProfitTarget and SetStopLoss in my strategy. Once an order is placed and filled via my strategy, two limit orders are virtually simultaneously placed, one for profit and one for stop. Then say I lose my connection before the target or stop orders are hit. If I understand, the two limit orders rest with my broker AMP, so despite my losing a connection, my orders are "safe" in that they are in the hands of the broker. Am I understanding this correctly?
Having said that, are you saying this may not be the case if my data provider and/or broker are different?
Please pardon my repetitiveness.
Thank you
Comment
-
The orders would going into 'accepted' (the stop) and 'working' state (the target) - what is not possible for NT then if you're losing connection is canceling the unneeded order if one part of your bracket fills while you're offline. So in turn the other still resting order could execute as well in this scenario if you do not reconnect in time to cancel it.
Comment
-
Thanks, Bertrand, I'm getting the picture. Just a follow up then-- you say that:
Assuming the unneeded order has not been filled yet, then when the connection is re-established, would the unneeded order be automatically disposed of properly?what is not possible for NT then if you're losing connection is canceling the unneeded order if one part of your bracket fills while you're offline. So in turn the other still resting order could execute as well in this scenario if you do not reconnect in time to cancel it.
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
666 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
376 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
110 views
0 likes
|
Last Post
by Mindset
02-09-2026, 11:44 AM
|
||
|
Started by Geovanny Suaza, 02-02-2026, 12:30 PM
|
0 responses
575 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
580 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|
Comment