Are you a skilled C#/NinjaScript programmer?
Adding buttons and other controls to Chart Trader is probably non-trivial for the novice coder. But still, if you are determined, it can be done.
You can look here for some example user app code to add buttons to Chart Trader.
Even though that app is packaged as a strategy, the concepts of adding buttons to Chart Trader for an indicator are exactly the same.
As far as your indicator submitting orders (from one of your custom Chart Trader buttons, for example), utilizing the current Chart Trader settings, here is some code to get you started,
private void ChartTrader_SubmitOrder(int OrderDirection)
{
ChartControl.Dispatcher.InvokeAsync((Action)(() =>
{
Account a = ChartControl.OwnerChart.ChartTrader.Account;
int quantity = ChartControl.OwnerChart.ChartTrader.Quantity;
AtmStrategy atm = ChartControl.OwnerChart.ChartTrader.AtmStrategy;
Instrument instr = ChartControl.OwnerChart.ChartTrader.Instrument;
Order o = a.CreateOrder(instr, OrderDirection > 0 ? OrderAction.Buy : OrderAction.Sell, OrderType.Market,
OrderEntry.Automated, TimeInForce.Day, quantity, 0, 0, "", "Entry", Core.Globals.MaxDate, null);
if (atm == null)
// AtmStrategy was set to 'None' in ChartTrader
a.Submit(new[] { o });
else
NinjaTrader.NinjaScript.AtmStrategy.StartAtmStrategy(atm, o);
}));
}
Enjoy!
![]()