I created a custom indicator snippet and tried to retrieve orders information. The compilation is successful but when I tested it in algowizard a tradingException is shown.
The only thing I modified for this custom indicator is the OnBarUpdate method, which looks like below
@Override
protected void OnBarUpdate() throws TradingException {
double result = 0;
int opencount = Strategy.Trader.getOpenOrdersCount()
Main.set(0, result);
}
Is it not possible to access strategy orders in custom indicators? is there any way to do it? I want to create exits similar to ExitAfterBars that uses BarsSinceOrderOpen, which uses the open order information.