Customizing indicators
This page explains how to configure, add, and manage indicators in the DXcharts Android SDK.
You can perform the following actions:
-
Add custom indicators (
addStudy). -
Set available indicators (
setAvailableStudiesByUuid). -
Manage favorite indicators (
setFavoriteStudiesByUuid,addFavoriteStudiesByUuid,removeFavoriteStudiesByUuid,removeAllFavoriteStudies).
Core concepts
StudyUuid: Anenumclass whose entries are objects containing the UUIDs of indicators.StudySettingsItems: A generated object that contains constants ofStudiesSetting.- It is generated automatically and cannot be modified.
- Use it as a source for creating or copying
StudiesSettingobjects.
Adding or replacing custom indicators
Use addStudy to add a custom indicator based on a base configuration.
- If you specify a new
UUID, the indicator will be added to the list. - If the
UUIDalready exists, the existing indicator will be replaced with the new settings.
studiesRepository.addStudy(study = StudySettingsItems.sma.copy(uuid = "NEW_SMA",title = "SMA50"))
Setting available indicators
Use setAvailableStudies to define which indicators are available in the UI.
studiesRepository.setAvailableStudies(setOf(StudySettingsItems.aroonOscillator,StudySettingsItems.bollingerBands,StudySettingsItems.adx,StudySettingsItems.roc,StudySettingsItems.zigZag,StudySettingsItems.sma.copy(uuid = "NEW_SMA"),))
Setting favorite indicators
Use setFavoriteStudiesByUuid to define the list of favorite indicators.
This method replaces the current favorites with the specified ones.
studiesRepository.setFavoriteStudiesByUuid(setOf(StudyId.AROON_OSCILLATOR,StudyId.BOLLINGER_BANDS,"NEW_SMA",))
Adding favorite indicators
Use addFavoriteStudiesByUuid to add new indicators to the favorites list without removing the existing ones.
studiesRepository.addFavoriteStudiesByUuid(setOf(StudyId.ROC,StudyId.ZIG_ZAG,"NEW_SMA",))
Removing specific favorite indicators
Use removeFavoriteStudiesByUuid to remove specific indicators from the favorites list.
studiesRepository.removeFavoriteStudiesByUuid(setOf(StudyId.ZIG_ZAG,"NEW_SMA",))
Removing all favorite indicators
Use removeAllFavoriteStudies to clear the favorites list entirely.
studiesRepository.removeAllFavoriteStudies()