커뮤니티

문의드립니다

프로필 이미지
처음처럼22
2025-09-24 02:59:38.0
63
글번호 194223
답변완료
해외선물5분봉챠트에서 사용하려고하는데 오류가 뜹니다 저는 잘이해가 되질않습니다 수정부탁드립니다 Inputs: // STS 파라미터 Length(20), Mult(2.0), SmoothLen(5), // Flow 파라미터 Period(240), Smooth(5), Thr(0.75), UseAutoScale(true), ScaleFix(10000); Vars: // STS 변수 Basis(0), Dev(0), Upper(0), Lower(0), UpTrend(false), DownTrend(false), Strength(0), StrengthSm(0), PriceArray(0), i(0), // Flow 변수 U(0), D(0), SU(0), SD(0), FlowRaw(0), Flow(0), Slope(0), Col(magenta), Scale(0); // --- 1차원 배열 선언 --- Array: PriceArr[1000]; // --- 최근 Length 봉 종가를 배열에 저장 --- For i = 0 to Length - 1 begin PriceArr[i] = Close[i]; end; // --- STS 이동평균 & 표준편차 --- Basis = Average(Close, Length); Dev = Mult * StandardDevArray(PriceArr, Length, 1); Upper = Basis + Dev; Lower = Basis - Dev; // --- STS 추세 판별 --- UpTrend = Close > Upper; DownTrend = Close < Lower; // --- STS 강도 계산 --- If Dev <> 0 Then Strength = (Close - Basis) / Dev; Else Strength = 0; // --- STS 강도 스무딩 --- StrengthSm = XAverage(Strength, SmoothLen); // --- Flow: 상승/하락 거래량 분해 --- If Close > Close[1] Then begin U = Volume; D = 0; end Else If Close < Close[1] Then begin U = 0; D = Volume; end Else begin U = Volume * 0.5; D = Volume * 0.5; end; // --- Flow: 최근 Period 합계 --- SU = Summation(U, Period); SD = Summation(D, Period); // --- Flow: 정규화 --- If (SU + SD) <> 0 Then FlowRaw = (SU - SD) / (SU + SD); Else FlowRaw = 0; // --- Flow: 스무딩 --- Flow = XAverage(FlowRaw, Smooth); // --- Flow: 기울기 색상 --- Slope = Flow - Flow[1]; If Slope > 0 Then Col = Magenta; Else If Slope < 0 Then Col = Cyan; // --- Flow: 자동 스케일 --- If UseAutoScale Then Scale = 1000 / MaxList(0.0001, Average(AbsValue(Flow), 200)); Else Scale = ScaleFix; // --- 통합 매수/매도 조건 --- If UpTrend and Flow > Thr Then begin Plot1(Close, "StrongBuy"); SetPlotColor(1, Green); end Else If DownTrend and Flow < -Thr Then begin Plot2(Close, "StrongSell"); SetPlotColor(2, Red); end; // --- 보조 플롯 --- Plot3(StrengthSm, "PriceStrength"); SetPlotColor(3, Orange); Plot4(Flow * Scale, "Flow xScale", Col); PlotBaseLine1(1000); Plot5(Thr * Scale, "UpperBand"); Plot6(-Thr * Scale, "LowerBand");
지표
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2025-09-24 13:30:16.0

안녕하세요 예스스탁입니다. Inputs: // STS 파라미터 Length(20), Mult(2.0), SmoothLen(5), // Flow 파라미터 Period(240), Smooth(5), Thr(0.75), UseAutoScale(true), ScaleFix(10000); Vars: // STS 변수 Basis(0), Dev(0), Upper(0), Lower(0), UpTrend(false), DownTrend(false), Strength(0), StrengthSm(0), PriceArray(0), i(0), // Flow 변수 U(0), D(0), SU(0), SD(0), FlowRaw(0), Flow(0), Slope(0), Col(magenta), Scale(0); // --- 1차원 배열 선언 --- Array: PriceArr[1000](0); // --- 최근 Length 봉 종가를 배열에 저장 --- For i = 0 to Length - 1 begin PriceArr[i] = Close[i]; end; // --- STS 이동평균 & 표준편차 --- Basis = ma(Close, Length); Dev = Mult * StandardDevArray(PriceArr, Length, 1); Upper = Basis + Dev; Lower = Basis - Dev; // --- STS 추세 판별 --- UpTrend = Close > Upper; DownTrend = Close < Lower; // --- STS 강도 계산 --- If Dev <> 0 Then Strength = (Close - Basis) / Dev; Else Strength = 0; // --- STS 강도 스무딩 --- StrengthSm = Ema(Strength, SmoothLen); // --- Flow: 상승/하락 거래량 분해 --- If Close > Close[1] Then begin U = Volume; D = 0; end Else If Close < Close[1] Then begin U = 0; D = Volume; end Else begin U = Volume * 0.5; D = Volume * 0.5; end; // --- Flow: 최근 Period 합계 --- SU = AccumN(U, Period); SD = AccumN(D, Period); // --- Flow: 정규화 --- If (SU + SD) <> 0 Then FlowRaw = (SU - SD) / (SU + SD); Else FlowRaw = 0; // --- Flow: 스무딩 --- Flow = Ema(FlowRaw, Smooth); // --- Flow: 기울기 색상 --- Slope = Flow - Flow[1]; If Slope > 0 Then Col = Magenta; Else If Slope < 0 Then Col = Cyan; // --- Flow: 자동 스케일 --- If UseAutoScale Then Scale = 1000 / MaxList(0.0001, ma(AbsValue(Flow), 200)); Else Scale = ScaleFix; // --- 통합 매수/매도 조건 --- If UpTrend and Flow > Thr Then begin Plot1(Close, "StrongBuy",Green); end Else If DownTrend and Flow < -Thr Then begin Plot2(Close, "StrongSell",Red); end; // --- 보조 플롯 --- Plot3(StrengthSm, "PriceStrength",Orange); Plot4(Flow * Scale, "Flow xScale", Col); PlotBaseLine1(1000); Plot5(Thr * Scale, "UpperBand"); Plot6(-Thr * Scale, "LowerBand"); 즐거운 하루되세요 > 처음처럼22 님이 쓴 글입니다. > 제목 : 문의드립니다 > 해외선물5분봉챠트에서 사용하려고하는데 오류가 뜹니다 저는 잘이해가 되질않습니다 수정부탁드립니다 Inputs: // STS 파라미터 Length(20), Mult(2.0), SmoothLen(5), // Flow 파라미터 Period(240), Smooth(5), Thr(0.75), UseAutoScale(true), ScaleFix(10000); Vars: // STS 변수 Basis(0), Dev(0), Upper(0), Lower(0), UpTrend(false), DownTrend(false), Strength(0), StrengthSm(0), PriceArray(0), i(0), // Flow 변수 U(0), D(0), SU(0), SD(0), FlowRaw(0), Flow(0), Slope(0), Col(magenta), Scale(0); // --- 1차원 배열 선언 --- Array: PriceArr[1000]; // --- 최근 Length 봉 종가를 배열에 저장 --- For i = 0 to Length - 1 begin PriceArr[i] = Close[i]; end; // --- STS 이동평균 & 표준편차 --- Basis = Average(Close, Length); Dev = Mult * StandardDevArray(PriceArr, Length, 1); Upper = Basis + Dev; Lower = Basis - Dev; // --- STS 추세 판별 --- UpTrend = Close > Upper; DownTrend = Close < Lower; // --- STS 강도 계산 --- If Dev <> 0 Then Strength = (Close - Basis) / Dev; Else Strength = 0; // --- STS 강도 스무딩 --- StrengthSm = XAverage(Strength, SmoothLen); // --- Flow: 상승/하락 거래량 분해 --- If Close > Close[1] Then begin U = Volume; D = 0; end Else If Close < Close[1] Then begin U = 0; D = Volume; end Else begin U = Volume * 0.5; D = Volume * 0.5; end; // --- Flow: 최근 Period 합계 --- SU = Summation(U, Period); SD = Summation(D, Period); // --- Flow: 정규화 --- If (SU + SD) <> 0 Then FlowRaw = (SU - SD) / (SU + SD); Else FlowRaw = 0; // --- Flow: 스무딩 --- Flow = XAverage(FlowRaw, Smooth); // --- Flow: 기울기 색상 --- Slope = Flow - Flow[1]; If Slope > 0 Then Col = Magenta; Else If Slope < 0 Then Col = Cyan; // --- Flow: 자동 스케일 --- If UseAutoScale Then Scale = 1000 / MaxList(0.0001, Average(AbsValue(Flow), 200)); Else Scale = ScaleFix; // --- 통합 매수/매도 조건 --- If UpTrend and Flow > Thr Then begin Plot1(Close, "StrongBuy"); SetPlotColor(1, Green); end Else If DownTrend and Flow < -Thr Then begin Plot2(Close, "StrongSell"); SetPlotColor(2, Red); end; // --- 보조 플롯 --- Plot3(StrengthSm, "PriceStrength"); SetPlotColor(3, Orange); Plot4(Flow * Scale, "Flow xScale", Col); PlotBaseLine1(1000); Plot5(Thr * Scale, "UpperBand"); Plot6(-Thr * Scale, "LowerBand");