전략편집기 수정, 보조지표 설정 수정

This commit is contained in:
Macbook
2026-05-27 23:59:30 +09:00
parent 8cc0d1c88c
commit 2713b2951d
17 changed files with 210 additions and 46 deletions
+2 -3
View File
@@ -73,9 +73,7 @@ export function histogramBarColor(
value: number,
prev: number | null | undefined,
plot: PlotDef,
pointColor?: string,
): string {
if (pointColor) return withHistogramAlpha(pointColor);
const isDown = prev != null && !isNaN(prev) && value < prev;
const isNeg = value < 0;
const raw = (isDown || isNeg) ? resolveHistogramDownColor(plot) : resolveHistogramUpColor(plot);
@@ -89,6 +87,7 @@ export function mapHistogramSeriesData(
return filtered.map((p, idx, arr) => ({
time: p.time as import('lightweight-charts').Time,
value: p.value,
color: histogramBarColor(p.value, idx > 0 ? arr[idx - 1].value : null, plot, p.color),
// lightweight-charts-indicators MACD 등이 막대별 color를 넣어도 설정(상승/하락) 색을 우선
color: histogramBarColor(p.value, idx > 0 ? arr[idx - 1].value : null, plot),
}));
}