obv 수정

This commit is contained in:
Macbook
2026-06-09 22:30:19 +09:00
parent 7b4fc1f811
commit 420050dfb7
4 changed files with 31 additions and 7 deletions
+10
View File
@@ -0,0 +1,10 @@
import type { OHLCVBar } from '../types';
/** OBV 본선 계산에 필요한 최소 거래량 품질 (some>0 만으로는 STOMP volume=0 history 통과) */
export function barsMeetObvVolumeRequirement(bars: OHLCVBar[]): boolean {
if (bars.length < 2) return false;
const withVol = bars.filter(b => (Number(b.volume) || 0) > 0).length;
const volSum = bars.reduce((s, b) => s + (Number(b.volume) || 0), 0);
const minBarsWithVol = Math.max(20, Math.floor(bars.length * 0.5));
return volSum > 0 && withVol >= minBarsWithVol;
}