커뮤니티
수식 부탁드립니다.
지표에서는 외국인 콜 EI715 풋 EI719 랭귀는 불러오는데 스팟에서는
function RequestForeignData() {
try {
var optObj = GetActiveOptionObject();
if (optObj && typeof optObj.GetInvestorInfoByCategory === "function") {
// 파라미터 규격: GetInvestorInfoByCategory(nCategory, nInvestor, nAmountQty, nBuySell, nIndex)
// nCategory: 1 (KOSPI옵션전체)
// nInvestor: 1 (외국인)
// nAmountQty: 1 (금액)
// nBuySell: 2 (매수), 1 (매도)
// nIndex: 0 (당일)
var callBuy = optObj.GetInvestorInfoByCategory(1, 1, 1, 2, 0);
var callSell = optObj.GetInvestorInfoByCategory(1, 1, 1, 1, 0);
// 만약 KOSPI옵션전체(1) 내에서 콜/풋 구분이 통합 수급으로 잡히는 경우 전체 순매수로 반영
g_foreignTotalAmt = (callBuy - callSell);
g_foreignCallAmt = g_foreignTotalAmt; // 콜/풋 세부 구분이 필요할 경우 매핑 조정
g_foreignPutAmt = 0;
// 디버깅 로그로 정상 수신 여부 확인
if (typeof Main !== "undefined") {
Main.MessageLog(">>> [수급 데이터 수신 성공] 외인 옵션 순매수금액: " + (g_foreignTotalAmt / 100000000).toFixed(1) + "억 <<<");
}
} else {
if (typeof Main !== "undefined") {
Main.MessageLog(">>> [경고] Option1 객체 또는 GetInvestorInfoByCategory 함수를 찾을 수 없습니다. <<<");
}
}
} catch(e) {
if (typeof Main !== "undefined") {
Main.MessageLog(">>> [수급 연동 에러]: " + e.message + " <<<");
}
}
} 이렇게 불러오면 되는지 검토바람 외국인 선물수량 ,외국인 콜금액 외국인풋금액을 스팟에서 불러오는것 부탁드립니다.
답변 1
예스스탁 예스스탁 답변
2026-09-07 17:13:18