예스스탁
예스스탁 답변
2024-08-23 16:55:35
안녕하세요
예스스탁입니다.
1
input : AtrPeriod(13),factor(3);
var : src(0), AtrV(0),upperBand(0),lowerBand(0), prevLowerBand(0), prevUpperBand(0);
var : prevSuperTrend(0), superTrend(C), direction(0),alpha(0),source(0);
if CurrentBar > 1 Then
{
src = (H+L)/2;
alpha = 1 / AtrPeriod ;
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 + factor * AtrV;
lowerBand = src - factor * 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);
}
2
input : AtrPeriod(13),factor(3);
var : src(0), AtrV(0),upperBand(0),lowerBand(0), prevLowerBand(0), prevUpperBand(0);
var : prevSuperTrend(0), superTrend(C), direction(0),alpha(0),source(0);
if CurrentBar > 1 Then
{
src = (H+L)/2;
alpha = 1 / AtrPeriod ;
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 + factor * AtrV;
lowerBand = src - factor * 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
{
var1 = supertrend[1];
Var2 = Index;
}
if var1 > 0 and Index > Var2 and Index <= Var2+5 and CrossUp(c,var1) Then
Find(1);
}
3
input : AtrPeriod(13),factor(3);
var : src(0), AtrV(0),upperBand(0),lowerBand(0), prevLowerBand(0), prevUpperBand(0);
var : prevSuperTrend(0), superTrend(C), direction(0),alpha(0),source(0);
if CurrentBar > 1 Then
{
src = (H+L)/2;
alpha = 1 / AtrPeriod ;
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 + factor * AtrV;
lowerBand = src - factor * 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
var1 = supertrend[1];
if var1 > 0 and CrossDown(c,var1) Then
Find(1);
}
즐거운 하루되세요
> downlord 님이 쓴 글입니다.
> 제목 : 종목 검색 부탁드립니다..
> 안녕하세요..
트레이딩뷰의 슈퍼 트렌드 지표를 참고하여 종목검색을 하고싶습니다..
슈퍼트렌드 (기간 14, 배수 3)
1. 슈퍼트렌드를 주가가 돌파할때 검색,
2. 슈퍼트렌드를 주가가 돌파(5봉전)한 후 1~5봉이내에 6봉 전(돌파전수치) 슈퍼트렌드의 수치를 재돌파할 때 검색,
3. 슈퍼트렌드를 주가가 돌파한 후 돌파 1봉전 수치를 주가가 이탈할 때 검색,
부탁드립니다.수고하세요