removeIcon and removePoint API's?
-
- Posts: 43
- Joined: Mon Feb 08, 2021 5:37 pm
- Been thanked: 1 time
removeIcon and removePoint API's?
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.
-
- Posts: 548
- Joined: Mon Jul 09, 2018 11:18 am
- Has thanked: 25 times
- Been thanked: 85 times
Re: removeIcon and removePoint API's?
Hi,
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).
Code: Select all
private IndicatorModifiable lastTradeIndicator;
@Override
public void initialize(String alias, InstrumentInfo info, Api api, InitialState initialState) {
lastTradeIndicator = api.registerIndicatorModifiable(...