removeIcon and removePoint API's?

Custom indicators, trading strategies, data export and recording and more...
rickbarlow
Posts: 43
Joined: Mon Feb 08, 2021 5:37 pm
Been thanked: 1 time

removeIcon and removePoint API's?

Post by rickbarlow » Mon May 17, 2021 2:09 am

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.

Andry API support
Posts: 548
Joined: Mon Jul 09, 2018 11:18 am
Has thanked: 25 times
Been thanked: 85 times

Re: removeIcon and removePoint API's?

Post by Andry API support » Mon May 17, 2021 12:42 pm

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).

Post Reply