When an indicator is instantiated by indicators.getIndicator("TestIndicator") there is no way to know where this indicator is going to be used and what the FeedDescriptor will be.
One workaround could be to set feedDescriptor into the indicator manually through a custom method like so:
indicators.registerCustomIndicator(TestIndicator.class);
TestIndicator testIndicator = indicators.getIndicator("TestIndicator");
chart=context.getLastActiveChart();
testIndicator.setFeed(chart.getFeedDescriptor());