답변완료
종목 검색부탁드립니다.
1. 수식4)가 기준선0 을 돌파할때 종목 검색식
2. 수식4)에서 기준선0 위에 있는 종목중 전일보다 수식4)가 상승한(많은) 종옥 검색식 부탁드립니다
---------------------------------
수식1)
// 캔들 구성 요소 계산
upper_wick = if(C>O, H-C, H-O);
lower_wick = if(C>O, O-L, C-L);
spread = H-L;
body_length = spread - (upper_wick + lower_wick);
// 비율 계산
percent_upper_wick = upper_wick/spread;
percent_lower_wick = lower_wick/spread;
percent_body_length = body_length/spread;
// 매수 거래량
buying_volume = if(C>O, (percent_body_length + (percent_upper_wick + percent_lower_wick)/2)*V, ((percent_upper_wick + percent_lower_wick)/2)*V);
// 누적 매수 거래량
eavg(buying_volume, cumulation_length)
수식2)
// 기본 계산 (수식1과 동일)
upper_wick = if(C>O, H-C, H-O);
lower_wick = if(C>O, O-L, C-L);
spread = H-L;
body_length = spread - (upper_wick + lower_wick);
percent_upper_wick = upper_wick/spread;
percent_lower_wick = lower_wick/spread;
percent_body_length = body_length/spread;
// 매도 거래량
selling_volume = if(C<O, (percent_body_length + (percent_upper_wick + percent_lower_wick)/2)*V, ((percent_upper_wick + percent_lower_wick)/2)*V);
// 누적 매도 거래량
eavg(selling_volume, cumulation_length)
수식3)
// 누적 거래량 계산
cumulative_buying = eavg(if(C>O, (((H-L)-(if(C>O,H-C,H-O)+if(C>O,O-L,C-L)))/(H-L) + ((if(C>O,H-C,H-O)+if(C>O,O-L,C-L))/2)/(H-L))*V, (((if(C>O,H-C,H-O)+if(C>O,O-L,C-L))/2)/(H-L))*V), cumulation_length);
cumulative_selling = eavg(if(C<O, (((H-L)-(if(C>O,H-C,H-O)+if(C>O,O-L,C-L)))/(H-L) + ((if(C>O,H-C,H-O)+if(C>O,O-L,C-L))/2)/(H-L))*V, (((if(C>O,H-C,H-O)+if(C>O,O-L,C-L))/2)/(H-L))*V), cumulation_length);
// 거래량 강도 파동의 EMA
volume_strength = if(cumulative_buying > cumulative_selling, cumulative_buying, cumulative_selling);
eavg(volume_strength, cumulation_length)
수식4)
// 매수/매도 거래량 재계산
buying_vol = eavg(if(C>O, (((H-L)-(if(C>O,H-C,H-O)+if(C>O,O-L,C-L)))/(H-L) + ((if(C>O,H-C,H-O)+if(C>O,O-L,C-L))/2)/(H-L))*V, (((if(C>O,H-C,H-O)+if(C>O,O-L,C-L))/2)/(H-L))*V), cumulation_length);
selling_vol = eavg(if(C<O, (((H-L)-(if(C>O,H-C,H-O)+if(C>O,O-L,C-L)))/(H-L) + ((if(C>O,H-C,H-O)+if(C>O,O-L,C-L))/2)/(H-L))*V, (((if(C>O,H-C,H-O)+if(C>O,O-L,C-L))/2)/(H-L))*V), cumulation_length);
// 델타 계산
buying_vol - selling_vol
-------
지표조건
cumulation_leng 28
기준선 0
2025-08-13
115
글번호 193218
종목검색
답변완료
수식 부탁드립니다
지표식 부탁 드립니다.
//@version=5
indicator("HL Optimized Trend Tracker", overlay=true)
// === inputs
length = input.int(2, "Period", minval=1)
percent = input.float(1.5, "Optimization Coeff", step=0.1, minval=0)
hllength = input.int(20, "Highest and Lowest Length", minval=1)
// === highest / lowest series used as VAR source
src = ta.highest(high, hllength)
srcl = ta.lowest(low, hllength)
// === VAR moving-average function (fixed VAR type)
Var_Func(src, length) =>
valpha = 2 / (length + 1)
vud1 = src > src[1] ? src - src[1] : 0
vdd1 = src < src[1] ? src[1] - src : 0
vUD = math.sum(vud1, 9)
vDD = math.sum(vdd1, 9)
vCMO = nz((vUD - vDD) / (vUD + vDD))
VAR = 0.0
VAR := nz(valpha * math.abs(vCMO) * src) + (1 - valpha * math.abs(vCMO)) * nz(VAR[1])
VAR
// === compute VAR-based MAs (top & low)
MAvg = Var_Func(src, length)
MAvgl = Var_Func(srcl, length)
// === HOTT (top) logic
fark = MAvg * percent * 0.01
longStop = MAvg - fark
longStopPrev = nz(longStop[1], longStop)
longStop := MAvg > longStopPrev ? math.max(longStop, longStopPrev) : longStop
shortStop = MAvg + fark
shortStopPrev = nz(shortStop[1], shortStop)
shortStop := MAvg < shortStopPrev ? math.min(shortStop, shortStopPrev) : shortStop
dir = 1
dir := nz(dir[1], dir)
dir := dir == -1 and MAvg > shortStopPrev ? 1 : dir == 1 and MAvg < longStopPrev ? -1 : dir
MT = dir == 1 ? longStop : shortStop
HOTT = MAvg > MT ? MT * (200 + percent) / 200 : MT * (200 - percent) / 200
// === LOTT (low) logic (mirror)
farkl = MAvgl * percent * 0.01
longStopl = MAvgl - farkl
longStopPrevl = nz(longStopl[1], longStopl)
longStopl := MAvgl > longStopPrevl ? math.max(longStopl, longStopPrevl) : longStopl
shortStopl = MAvgl + farkl
shortStopPrevl = nz(shortStopl[1], shortStopl)
shortStopl := MAvgl < shortStopPrevl ? math.min(shortStopl, shortStopPrevl) : shortStopl
dirl = 1
dirl := nz(dirl[1], dirl)
dirl := dirl == -1 and MAvgl > shortStopPrevl ? 1 : dirl == 1 and MAvgl < longStopPrevl ? -1 : dirl
MTl = dirl == 1 ? longStopl : shortStopl
LOTT = MAvgl > MTl ? MTl * (200 + percent) / 200 : MTl * (200 - percent) / 200
// === Plot only HOTT & LOTT
plot(nz(HOTT[2]), title="HOTT", color=color.blue, linewidth=2)
plot(nz(LOTT[2]), title="LOTT", color=color.red, linewidth=2)
2025-08-13
110
글번호 193208
지표
답변완료
수식 부탁드립니다.
조건: 분봉에서 2개봉 이상 매수볼륨이 매도볼륨보다 40%많은 종목을 검색이 조건값인데
파워종목검색을 돌려보면
결과값에는 40%미만인 종목과 매도볼륨이 더 많은 종목 등이 검색 되네요
조건값이 제대로 나오게 코드 수정 가능할까요?
Variables: total_range(0), candle_body_length(0), upper_wick_length(0), lower_wick_length(0),
percent_body_length(0), percent_upper_wick(0), percent_lower_wick(0),
buying_volume(0), selling_volume(0), buying_dominant(false),
consec_buying_dominant_bars(0);
if Volume > 0 and High > Low then
begin
total_range = High - Low;
candle_body_length = AbsValue(Close - Open);
upper_wick_length = High - MaxList(Open, Close);
lower_wick_length = MinList(Open, Close) - Low;
if total_range > 0 then
begin
percent_body_length = candle_body_length / total_range;
percent_upper_wick = upper_wick_length / total_range;
percent_lower_wick = lower_wick_length / total_range;
// IFF 함수 사용한 볼륨 계산
buying_volume = iff(Close > Open,
(percent_body_length + (percent_upper_wick + percent_lower_wick)/2) * Volume,
((percent_upper_wick + percent_lower_wick)/2) * Volume);
selling_volume = iff(Close < Open,
(percent_body_length + (percent_upper_wick + percent_lower_wick)/2) * Volume,
((percent_upper_wick + percent_lower_wick)/2) * Volume);
// 매수우위 판단
if selling_volume > 0 then
begin
buying_dominant = buying_volume >= selling_volume * 1.4;
end
else
begin
buying_dominant = false;
end;
// 연속 봉 계산
if buying_dominant then
begin
consec_buying_dominant_bars = consec_buying_dominant_bars[1] + 1;
end
else
begin
consec_buying_dominant_bars = 0;
end;
end;
end;
// 최종 조건
if consec_buying_dominant_bars >= 2 then
begin
Find(1);
end;
답변완료
문의드립니다.
종목 검색식 부탁드립니다..
3종류입니다..
첫번째 ========================
input : PERIOD(20),N(20),K(8)
A=100*eavg(C,Period)/eavg(C(n),Period);
B=100*eavg(eavg(C,Period)/eavg(C(n),Period),k);
A>B
두번째===========================
a=valuewhen(1,crossup(avg(C,1), avg(C,60)),avg(c,60));
a1=valuewhen(1,crossdown(avg(C,20), avg(C,60)),avg(C,60));
a2=valuewhen(1,crossdown(eavg(C,20), eavg(C,60)),eavg(C,60));
a3=valuewhen(1,crossdown(avg(C,5), avg(C,20)),avg(C,20));
C > a and C > a1 and C > a2 and C > a3
세번째 =================================
a=valuewhen(1,crossup(avg(C,1), avg(C,60)),avg(c,60));
a1=valuewhen(1,crossdown(avg(C,20), avg(C,60)),avg(C,60));
a2=valuewhen(1,crossdown(eavg(C,20), eavg(C,60)),eavg(C,60));
a3=valuewhen(1,crossdown(avg(C,5), avg(C,20)),avg(C,20));
Crossup(C,a) and Crossup(C,a1) and Crossup(C,a2) and Crossup(C,a3)
==========================================================
매번 간단한 질문을 드려 죄송합니다.
이렇게 종목 검색을 만들려면 어디서 공부해야 하나요?
다시 한번 감사드립니다.
2025-08-12
115
글번호 193203
종목검색