예스스탁
예스스탁 답변
2025-08-21 10:38:29
안녕하세요
예스스탁입니다.
input : ndate(20250818),ntime(90000);
var : price(0),vwapsum(0),volumesum(0),myvwap(0);
if Condition1 == False and sDate >= ndate and sTime >= ntime Then
{
Condition1 = true;
}
if Condition1 == true Then
{
price = (o+h+l+c)/4;
vwapsum = vwapsum + price*volume;
volumesum = volumesum + Volume;
myvwap = vwapsum/volumesum;
plot1(myvwap,"AVWAP");
}
즐거운 하루되세요
> 행복만땅 님이 쓴 글입니다.
> 제목 : 검색식 부탁합니다
> 트레이딩뷰에 있는 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)