예스스탁
예스스탁 답변
2025-05-16 08:41:23
안녕하세요
예스스탁입니다.
input : period(14),multiplier(3);
var : src(0), AtrV(0),upperBand(0),lowerBand(0), prevLowerBand(0), prevUpperBand(0);
var : prevSuperTrend(0), direction(0),alpha(0),source(0),SuperTrend(C);
if CurrentBar > 1 Then
{
src = (H+L)/2;
alpha = 1 / period ;
source = max(high - low, abs(high - close[1]), abs(low - close[1]));
ATrV = alpha * source + (1 - alpha) * ATrV[1]; //지수가중이평방식
//ATrV = ma(source,AtrPeriod); //단순이평방식
upperBand = src + multiplier * AtrV;
lowerBand = src - multiplier * AtrV;
prevLowerBand = lowerBand[1];
prevUpperBand = upperBand[1];
if lowerBand > prevLowerBand or close[1] < prevLowerBand Then
lowerBand = lowerBand;
Else
lowerBand = prevLowerBand;
if upperBand < prevUpperBand or close[1] > prevUpperBand Then
upperBand = upperBand;
Else
upperBand = prevUpperBand;
if C > UpperBand Then
direction = 1;
if C < LowerBand Then
direction = -1;
if direction == 1 Then
SuperTrend = lowerband;
Else
SuperTrend = upperband;
if CrossUp(C,SuperTrend) Then
Find(1);
}
즐거운 하루되세요
> 로즈버드 님이 쓴 글입니다.
> 제목 : 문의드립니다.
> 안녕하세요 더운 날씨에 노고가 많으십니다.
항상 감사하게 생각하고 있습니다.
---------------------------------------------
input : period(14),multiplier(3);
var : src(0), AtrV(0),upperBand(0),lowerBand(0), prevLowerBand(0), prevUpperBand(0);
var : prevSuperTrend(0), direction(0),alpha(0),source(0),SuperTrend(C);
if CurrentBar > 1 Then
{
src = (H+L)/2;
alpha = 1 / period ;
source = max(high - low, abs(high - close[1]), abs(low - close[1]));
ATrV = alpha * source + (1 - alpha) * ATrV[1]; //지수가중이평방식
//ATrV = ma(source,AtrPeriod); //단순이평방식
upperBand = src + multiplier * AtrV;
lowerBand = src - multiplier * AtrV;
prevLowerBand = lowerBand[1];
prevUpperBand = upperBand[1];
if lowerBand > prevLowerBand or close[1] < prevLowerBand Then
lowerBand = lowerBand;
Else
lowerBand = prevLowerBand;
if upperBand < prevUpperBand or close[1] > prevUpperBand Then
upperBand = upperBand;
Else
upperBand = prevUpperBand;
if C > UpperBand Then
direction = 1;
if C < LowerBand Then
direction = -1;
if direction == 1 Then
SuperTrend = lowerband;
Else
SuperTrend = upperband;
Plot1(SuperTrend,"SuperTrend",IFF(direction==1,Red,Blue));
}
-------------------------------------------------------------------
위의 지표를 통하여 종목검색을 하고 싶습니다.
당일 "0봉의 종가"로 슈퍼트렌드를 돌파한 종목만 검색하고 싶습니다
감사합니다.