How are you displaying your bracket orders on the chart without having the Chart Trader panel open?
On my setup, the orders execute correctly even when Chart Trader is closed, but the stop loss and profit target brackets are not visible on the chart. The only time I can see the bracket orders is when the Chart Trader side panel is open.
I’m trying to determine whether this is a NinjaTrader setting, an ATM configuration, or something related to how the orders are being submitted.
Has anyone found a way to keep stop-loss and target orders visible directly on the chart at all times without needing the Chart Trader panel displayed?
Any insight would be appreciated. My executions are working properly the only issue is the visibility of the bracket orders when Chart Trader is hidden.
It’s been a bit since I’ve looked at it, but that seems about right. With unmanaged you can have more control. For example, you can set ATR based targets and stops.
You can start here. Basically anything that can be done from the UI can be done through Ninjascript’s unmanaged order handling. The docs are kind of obscure, but the functionality is there
Okay, so if I have an stop order in place, with a quantity that’s equal to twice what the entry order was (to act as a stop-and-reverse), but then the auto-breakeven level gets hit, I can use this to change the quantity of the SAR order and make it so it is just an exit, without having to cancel and replace the order?
Once the order object of the SAR order is known then the two lines contained in the if statement make the qty change. Simple. Getting the order object becomes the challenge and there is no substitute for experimentation.
An order update event can also be used like the second code block. Seems simpler at the outset but I found them to be more difficult to manage because they fire for each successive state of the order and sometimes state changes are only milliseconds apart.
Some things to note:
-The orders collection contains all previous orders, cancelled, pending, filled, rejected etc
-When an entry order is executed with an atm attached the stop/target orders each have their own order objects.
-Order states change frequently sometimes within milliseconds.
-I have not experimented with NT8.1.x server level atms so there may be considerations there.
Good trading !
private void ChangeQty(Account Acct, int Qty)
{
foreach (Order order in Acct.Orders)
{
bool c1=order.OrderType==OrderType.StopLimit;
bool c2=order.OrderState==OrderState.Working;
bool c3=order.OrderType==OrderType.StopLimit;
if (c1 && c2 && c3)
{
order.QuantityChanged=Qty;
Acct.Change(new[] { order });
break;
}
}
}