Execute Code on Method Stop

Indicator can receive onStop method call when it is removed from platform. To do that indicator needs to implement IStopListener interface and register itself with IndicatorsProvider.

public class Indicator implements IIndicator, IStopListener {

    public void onStart(IIndicatorContext context) {
        ...
        context.getIndicatorsProvider().addIndicatorStopListener(this, this);
    }

    ...

    public void onStop() {
        console.getOut().println("onStop");
    }
}

IndicatorOnStop.java

The information on this web site is provided only as general information, which may be incomplete or outdated. Click here for full disclaimer.