예스스탁
예스스탁 답변
2024-11-01 16:12:18
안녕하세요
예스스탁입니다.
input : 타주기분(30);
input : ATRLength(9), ATRMult(1);
var : src(0), AtrV(0),upperBand(0),lowerBand(0), prevLowerBand(0), prevUpperBand(0);
var : prevSuperTrend(0), superTrend(C), direction(0),alpha(0),source(0);
var : S1(0),D1(0),TM(0),TF(0),cnt(0),ATrV1(0);
Array : HH[20](0),LL[20](0),CC[20](0);
if Bdate != Bdate[1] Then
{
S1 = TimeToMinutes(stime);
D1 = sdate;
}
if D1 > 0 then{
if sdate == D1 Then
TM = TimeToMinutes(stime)-S1;
Else
TM = TimeToMinutes(stime)+1440-S1;
TF = TM%타주기분;
if Bdate != Bdate[1] or
(Bdate == Bdate[1] and 타주기분 > 1 and TF < TF[1]) or
(Bdate == Bdate[1] and 타주기분 > 1 and TM >= TM[1]+타주기분) or
(Bdate == Bdate[1] and 타주기분 == 1 and TM > TM[1]) Then
{
for cnt = 19 downto 1
{
HH[cnt] = HH[cnt-1];
LL[cnt] = LL[cnt-1];
CC[cnt] = CC[cnt-1];
}
HH[0] = H;
LL[0] = L;
prevLowerBand = lowerBand[1];
prevUpperBand = upperBand[1];
ATrV1 = ATrV[1];
}
if H > HH[0] Then
HH[0] = H;
if L < LL[0] Then
LL[0] = L;
CC[0] = C;
if CC[1] > 1 Then
{
src = (HH[0]+LL[0])/2;
alpha = 1 / ATRLength ;
source = max(HH[0] - LL[0], abs(HH[0] - CC[1]), abs(LL[0] - CC[1]));
ATrV = alpha * source + (1 - alpha) * ATrV1;
upperBand = src + ATRMult * AtrV;
lowerBand = src - ATRMult * AtrV;
if prevLowerBand > 0 and prevUpperBand > 0 Then
{
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);
}
}
}
즐거운 하루되세요
> 레전드 님이 쓴 글입니다.
> 제목 : 문의
>
vars: ATRLength(9), ATRMult(1), Strength(9);
vars: strend(0),st(0);
st = SuperTrend(ATRLength, ATRMult, Strength, strend);
Plot1(st,"SuperTrend",iff(strend == 1,REd,Blue));
타주기분봉으로 부탁드립니다,타주기 표시는 외부변수로 부탁드립니다