Page 1 of 1

removeIcon and removePoint API's?

Posted: Mon May 17, 2021 2:09 am
by rickbarlow
I am using the simplified API. Is it possible that there's a corresponding remove API for each of the add API's, e.g. a removeIcon for the addIcon and a removePoint for an addPoint? There is an addShape and removeShape pair, but I'm using the other API's as well and need to do some cleanup.

Re: removeIcon and removePoint API's?

Posted: Mon May 17, 2021 12:42 pm
by Andry API support
Hi,

Code: Select all

    private IndicatorModifiable lastTradeIndicator;

    @Override
    public void initialize(String alias, InstrumentInfo info, Api api, InitialState initialState) {
        lastTradeIndicator = api.registerIndicatorModifiable(...
to remove points/icons your indicator must be an instance of IndicatorModifiable. Use #clear method to remove points/icons and you'll need to store the timestamp a point/icon was added. If you plotted an icon at timestamp t (implement TimeListener to collect t values) you can remove it calling indicator.clear(t, t+1).