removeIcon and removePoint API's?

Custom indicators, trading strategies, data export and recording and more...
rickbarlow
Posts: 30
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.

AndreyR
Posts: 409
Joined: Mon Jul 09, 2018 11:18 am
Has thanked: 17 times
Been thanked: 70 times

Re: removeIcon and removePoint API's?

Post by AndreyR » 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