신심리도 추가, 투자심리도 수정

This commit is contained in:
Macbook
2026-05-29 23:03:47 +09:00
parent 320675ea6b
commit 359e6c9653
19 changed files with 226 additions and 74 deletions
+23 -10
View File
@@ -102,7 +102,7 @@ const DEF_DEFAULTS = {
obvPeriod: 9, obvSignal: 9,
bbPeriod: 20, bbStdDev: 2,
ichTenkan: 9, ichKijun: 26, ichSenkouB: 52,
newPsy: 12, investPsy: 10,
newPsy: 10, psyPeriod: 12, investPsy: 10,
williamsR: 14,
bwiPeriod: 20,
vrPeriod: 10,
@@ -118,7 +118,7 @@ const DEF_DEFAULTS = {
BWI: { over: 80, mid: 50, under: 20 },
VR: { over: 200, mid: 100, under: 50 },
PSYCHOLOGICAL: { over: 75, mid: 50, under: 25 },
NEW_PSYCHOLOGICAL: { over: 75, mid: 50, under: 25 },
NEW_PSYCHOLOGICAL: { over: 50, mid: 0, under: -50 },
INVEST_PSYCHOLOGICAL: { over: 75, mid: 50, under: 25 },
MACD: { mid: 0 },
ADX: { over: 40, mid: 25, under: 20 },
@@ -165,7 +165,8 @@ export function buildDef(activeIndicators: IndicatorConfig[]): DefType {
const vo = p('VolumeOscillator');
const vrInd = p('VR');
const disp = p('Disparity');
const nPsy = p('Psychological') ?? p('NewPsychological');
const psy = p('Psychological');
const nPsy = p('NewPsychological');
const iPsy = p('InvestPsychological');
const obvP = p('OBV');
// SMA (MA lines)→ type:'SMA', params keys depend on smaConfig
@@ -193,7 +194,7 @@ export function buildDef(activeIndicators: IndicatorConfig[]): DefType {
VR: 'VR',
DISPARITY: 'Disparity',
PSYCHOLOGICAL: 'Psychological',
NEW_PSYCHOLOGICAL: 'Psychological',
NEW_PSYCHOLOGICAL: 'NewPsychological',
INVEST_PSYCHOLOGICAL: 'InvestPsychological',
OBV: 'OBV',
BOLLINGER: 'BollingerBands',
@@ -251,6 +252,7 @@ export function buildDef(activeIndicators: IndicatorConfig[]): DefType {
ichTenkan: num(ich, 'conversionPeriods', DEF_DEFAULTS.ichTenkan),
ichKijun: num(ich, 'basePeriods', DEF_DEFAULTS.ichKijun),
ichSenkouB: num(ich, 'laggingSpan2Periods', DEF_DEFAULTS.ichSenkouB),
psyPeriod: num(psy, 'length', DEF_DEFAULTS.psyPeriod),
newPsy: num(nPsy, 'length', DEF_DEFAULTS.newPsy),
investPsy: num(iPsy, 'length', DEF_DEFAULTS.investPsy),
williamsR: num(wr, 'length', DEF_DEFAULTS.williamsR),
@@ -448,12 +450,11 @@ export const getFieldOpts = (
{ value:THRESHOLD_HL_MID, label:`중앙선(${mid})` },
]);
}
case 'PSYCHOLOGICAL':
case 'NEW_PSYCHOLOGICAL': {
case 'PSYCHOLOGICAL': {
const { over, mid, under } = th({ over:75, mid:50, under:25 });
const psyP = cond
? getConditionValuePeriod({ ...cond, indicatorType: ind }, DEF)
: DEF.newPsy;
: DEF.psyPeriod;
return condOpts([
{ value:'PSY_VALUE', label:`심리도 라인(${psyP}일)` },
{ value:THRESHOLD_HL_OVER, label:`${overTerm}(${over})` },
@@ -461,6 +462,18 @@ export const getFieldOpts = (
{ value:THRESHOLD_HL_UNDER, label:`${underTerm}(${under})` },
]);
}
case 'NEW_PSYCHOLOGICAL': {
const { over, mid, under } = th({ over:50, mid:0, under:-50 });
const nPsyP = cond
? getConditionValuePeriod({ ...cond, indicatorType: ind }, DEF)
: DEF.newPsy;
return condOpts([
{ value:'NEW_PSY_VALUE', label:`신심리도 라인(${nPsyP}일)` },
{ value:THRESHOLD_HL_OVER, label:`${overTerm}(${over})` },
{ value:THRESHOLD_HL_MID, label:`중앙선(${mid})` },
{ value:THRESHOLD_HL_UNDER, label:`${underTerm}(${under})` },
]);
}
case 'INVEST_PSYCHOLOGICAL': {
const { over, mid, under } = th({ over:75, mid:50, under:25 });
const ipsyP = cond
@@ -591,7 +604,7 @@ const getDefaultConditionFields = (ind: string, signalType: 'buy'|'sell', DEF: D
EMA: { l:`EMA${DEF.maLines[0]}`, r:`EMA${DEF.maLines[1]}` },
DISPARITY: { l:`DISPARITY${DEF.dispUltra}`, r: THRESHOLD_HL_MID },
PSYCHOLOGICAL: { l:'PSY_VALUE', r: THRESHOLD_HL_OVER },
NEW_PSYCHOLOGICAL: { l:'PSY_VALUE', r: THRESHOLD_HL_OVER },
NEW_PSYCHOLOGICAL: { l:'NEW_PSY_VALUE', r: THRESHOLD_HL_OVER },
INVEST_PSYCHOLOGICAL: { l:'INVEST_PSY_VALUE', r: THRESHOLD_HL_OVER },
WILLIAMS_R: { l:'WILLIAMS_R_VALUE', r: THRESHOLD_HL_OVER },
BWI: { l:'BWI_VALUE', r: THRESHOLD_HL_OVER },
@@ -669,7 +682,7 @@ export function resolveFieldOptionValue(indicatorType: string, field?: string):
TRIX: 'TRIX_VALUE',
VR: 'VR_VALUE',
PSYCHOLOGICAL: 'PSY_VALUE',
NEW_PSYCHOLOGICAL: 'PSY_VALUE',
NEW_PSYCHOLOGICAL: 'NEW_PSY_VALUE',
INVEST_PSYCHOLOGICAL: 'INVEST_PSY_VALUE',
};
const base = bases[indicatorType];
@@ -1020,7 +1033,7 @@ export const CondEditor: React.FC<CondEditorProps> = ({ cond, signalType, onChan
TRIX: 'TRIX_VALUE',
VR: 'VR_VALUE',
PSYCHOLOGICAL: 'PSY_VALUE',
NEW_PSYCHOLOGICAL: 'PSY_VALUE',
NEW_PSYCHOLOGICAL: 'NEW_PSY_VALUE',
INVEST_PSYCHOLOGICAL: 'INVEST_PSY_VALUE',
};
const base = bases[normalized.indicatorType];