I'm trying to code an addon for chart trader that allows me to launch my own algorithmic orders that are based on my proprietary research. I've added some controls to ChartTrader panel in an indicator code (strategies seem to block ChartTrader). I have added another namespace NinjaTrader.Strategy and inside that I have a class that is derived from Strategy class. I have an object of this strategy class on my indicator class. When I need to launch orders I call a method of this strategy class. Inside that method I have defined order entry like this:
EnterShortLimit(quantity, price - slippage * ticksize);
I also tried to switch unmanaged boolean to true and:
SubmitOrder(0, OrderAction.Buy, OrderType.Limit, quantity, entryprice, 0, "", "");
Either of these expressions throws an exception "Object reference not set to an instance of an object."
Is there no way I can launch orders from indicator? Alternatively, can I access Chart Trader somehow using stategy instead of indicator?
Can I call AT interface from ninjascript to submit orders?
This is a screenshot of the modified Chart Trader:
Comment