답변완료
검색식 부탁 드려요
1. 아래 수식을 참조하여'
수식4) 가 기준선0 위에 있는 모든 종목 검색식 부탁드려요.
----------아래--------------------
수식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
답변완료
검색식 부탁합니다
트레이딩뷰에 있는 Anchored VWAP 입니다.
지표와 종목검색 부탁드립니다
study("Anchored VWAP",overlay=true)
Year = input(2017, minval = 1, maxval = 2099, type=integer, title='Year')
Month = input(10, minval = 1, maxval = 12, type=integer, title='Month')
Day = input(10, minval = 1, maxval = 31, type=integer, title='Day')
Hour = input(12, minval = 0, maxval = 23, type=integer, title='Hour')
Minute = input(0, minval = 0, maxval = 59, type=integer, title='Minute')
DebugMode = input(false, type=bool, title='Debug Mode')
start = security(tickerid, '1', time)
impulse_func = iff(timestamp(Year,Month,Day,Hour,Minute) == time, 1, 0)
newSession = iff(change(start), 1, 0)
startSession = newSession * impulse_func
vwapsum = iff(startSession, ohlc4*volume, vwapsum[1]+ohlc4*volume)
volumesum = iff(startSession, volume, volumesum[1]+volume)
myvwap = vwapsum/volumesum
plot(myvwap, linewidth=3, transp=0, title='AVWAP')
plot(DebugMode ? hour : na)
plot(DebugMode ? minute : na)
2025-08-21
103
글번호 193390
종목검색