Thank you
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
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:
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, theBertrandNinjaTrader Customer Service
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 -
BertrandNinjaTrader Customer Service
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.BertrandNinjaTrader Customer Service
Comment
-
Thanks, Bertrand, I'm getting the picture. Just a follow up then-- you say that:
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 ETFVoyageur, Today, 07:05 PM
|
0 responses
7 views
0 likes
|
Last Post
by ETFVoyageur
Today, 07:05 PM
|
||
Started by Orion815, 05-02-2024, 08:39 AM
|
2 responses
18 views
0 likes
|
Last Post
by Orion815
Today, 06:24 PM
|
||
Started by suroot, 02-25-2017, 04:43 AM
|
11 responses
2,552 views
0 likes
|
Last Post
by Zilvercat
Today, 05:36 PM
|
||
Started by Rogers101, 05-05-2024, 11:30 AM
|
16 responses
50 views
0 likes
|
Last Post
by Rogers101
Today, 04:44 PM
|
||
Started by ninza33, Today, 12:31 PM
|
2 responses
12 views
0 likes
|
Last Post
by ninza33
Today, 03:52 PM
|
Comment