Files
goldenChart/frontend/src/utils/indicatorMainTab.ts
T

63 lines
2.5 KiB
TypeScript

/** 지표 선택 팝업 탭 키 */
export type IndicatorTabKey = 'All' | 'Main' | `custom:${string}`;
export function customTabKey(id: string): IndicatorTabKey {
return `custom:${id}`;
}
export function parseCustomTabKey(key: IndicatorTabKey): string | null {
return key.startsWith('custom:') ? key.slice(7) : null;
}
export function isCustomTabKey(key: IndicatorTabKey): key is `custom:${string}` {
return key.startsWith('custom:');
}
/** Main 탭 고정 지표 (표시 순서) */
export const MAIN_INDICATOR_TYPES: readonly string[] = [
'RSI',
'Stochastic',
'BollingerBands',
'IchimokuCloud',
'ADX',
'DMI',
'CCI',
'MACD',
'WilliamsPercentRange',
'TRIX',
'OBV',
'VolumeOscillator',
'VR',
'Disparity',
'Psychological',
'NewPsychological',
'InvestPsychological',
'SMA',
] as const;
/** Main 탭 전용 표시 라벨 (업비트 주요 지표 명칭) */
export const MAIN_INDICATOR_LABELS: Record<string, { ko: string; en: string }> = {
RSI: { ko: 'RSI (상대강도지수)', en: 'Relative Strength Index' },
Stochastic: { ko: 'Stochastic Slow', en: 'Stochastic Slow' },
BollingerBands: { ko: '볼린저밴드', en: 'Bollinger Bands' },
IchimokuCloud: { ko: '일목균형표', en: 'Ichimoku Cloud' },
ADX: { ko: 'ADX (평균방향성지수)', en: 'Average Directional Index' },
DMI: { ko: 'DMI (방향성이동지수)', en: 'Directional Movement Index' },
CCI: { ko: 'CCI (상품채널지수)', en: 'Commodity Channel Index' },
MACD: { ko: 'MACD (이동평균수렴발산)', en: 'Moving Average Convergence Divergence' },
WilliamsPercentRange: { ko: 'Williams %R', en: 'Williams %R' },
TRIX: { ko: 'TRIX', en: 'TRIX' },
OBV: { ko: 'OBV (잔량균형지수)', en: 'On Balance Volume' },
VolumeOscillator: { ko: 'Volume Oscillator', en: 'Volume Oscillator' },
VR: { ko: 'VR (거래량비율)', en: 'Volume Ratio' },
Disparity: { ko: '이격도', en: 'Disparity' },
Psychological: { ko: '심리도', en: 'Psychological Line' },
NewPsychological: { ko: '신심리도', en: 'New Psychological Line' },
InvestPsychological: { ko: '투자심리도', en: 'Invest Psychological Line' },
SMA: { ko: '단순 이동평균', en: 'Simple Moving Average' },
};
export function isMainIndicatorType(type: string): boolean {
return (MAIN_INDICATOR_TYPES as readonly string[]).includes(type);
}