예스스탁
예스스탁 답변
2025-11-19 15:03:57
안녕하세요
예스스탁입니다.
A = Supertrend(period, multiplier)
B = CrossDown(C,A)
W = ValueWhen(1, B, B(1))
올리신 수식에서 B는 조건만족하면 1아니면 0값입니다.
그러므로 W 는 조건만족봉의 전봉의 B이므로 0값만 리턴됩니다.
해당식으로 돌파조건이 성립될수 없습니다.
W = ValueWhen(1, B, C(1))
w를 B조건만족봉의 전봉의 종가로 변경해서 작성해 드립니다.
수식 내용 확인하시고 수정해 사용하시기 바랍니다.
1
input : period(10),multiplier(3),N(5);
var : src(0), alpha(0),ATRV(0),upperBand(0),lowerBand(0),direction(0),SuperTrend(C);
var : A(0),B(False),W(Nan);
if CurrentBar > 1 Then
{
src = (H+L)/2;
alpha = 1 / period ;
ATRV = IFf(IsNan(ATRV[1]) == true, ma(TrueRange,period) , alpha * TrueRange + (1 - alpha) * IFf(isnan(ATRV[1])==true,0,ATRV[1]));
upperBand = src + multiplier * AtrV;
lowerBand = src - multiplier * AtrV;
if lowerBand > lowerBand[1] or close[1] < lowerBand[1] Then
lowerBand = lowerBand;
Else
lowerBand = lowerBand[1];
if upperBand < upperBand[1] or close[1] > upperBand[1] Then
upperBand = upperBand;
Else
upperBand = upperBand[1];
if C > UpperBand Then
direction = 1;
if C < LowerBand Then
direction = -1;
if direction == 1 Then
SuperTrend = lowerband;
Else
SuperTrend = upperband;
}
A = Supertrend;
B = CrossDown(C,A);
if B == true Then
W = C[1];
if CrossUp(C,W) and CountIf(B==true,N) >= 1 Then
Find(1);
2
input : period(10),multiplier(3),N(5);
var : src(0), alpha(0),ATRV(0),upperBand(0),lowerBand(0),direction(0),SuperTrend(C);
var : A(0),B(False),W(Nan),count(nan);
if CurrentBar > 1 Then
{
src = (H+L)/2;
alpha = 1 / period ;
ATRV = IFf(IsNan(ATRV[1]) == true, ma(TrueRange,period) , alpha * TrueRange + (1 - alpha) * IFf(isnan(ATRV[1])==true,0,ATRV[1]));
upperBand = src + multiplier * AtrV;
lowerBand = src - multiplier * AtrV;
if lowerBand > lowerBand[1] or close[1] < lowerBand[1] Then
lowerBand = lowerBand;
Else
lowerBand = lowerBand[1];
if upperBand < upperBand[1] or close[1] > upperBand[1] Then
upperBand = upperBand;
Else
upperBand = upperBand[1];
if C > UpperBand Then
direction = 1;
if C < LowerBand Then
direction = -1;
if direction == 1 Then
SuperTrend = lowerband;
Else
SuperTrend = upperband;
}
A = Supertrend;
B = CrossDown(C,A);
if B == true Then
W = C[1];
if sdate != sdate[1] then
count = 0;
if CrossUp(C,W) and CountIf(B==true,N) >= 1 Then
count = count+1;
if count >= 1 then
Find(1);
즐거운 하루되세요
예스스탁
예스스탁 답변
2025-11-20 14:25:46
안녕하세요
예스스탁입니다.
1
input : period(10),multiplier(3),N(5);
var : src(0), alpha(0),ATRV(0),upperBand(0),lowerBand(0),direction(0),SuperTrend(C);
var : A(0),B(0);
if CurrentBar > 1 Then
{
src = (H+L)/2;
alpha = 1 / period ;
ATRV = IFf(IsNan(ATRV[1]) == true, ma(TrueRange,period) , alpha * TrueRange + (1 - alpha) * IFf(isnan(ATRV[1])==true,0,ATRV[1]));
upperBand = src + multiplier * AtrV;
lowerBand = src - multiplier * AtrV;
if lowerBand > lowerBand[1] or close[1] < lowerBand[1] Then
lowerBand = lowerBand;
Else
lowerBand = lowerBand[1];
if upperBand < upperBand[1] or close[1] > upperBand[1] Then
upperBand = upperBand;
Else
upperBand = upperBand[1];
if C > UpperBand Then
direction = 1;
if C < LowerBand Then
direction = -1;
if direction == 1 Then
SuperTrend = lowerband;
Else
SuperTrend = upperband;
}
A = Supertrend;
if CrossDown(C,A) Then
B = A[1];
if CountIf(CrossUp(C,B),N) >= 1 Then
Find(1);
2
input : period(10),multiplier(3);
var : src(0), alpha(0),ATRV(0),upperBand(0),lowerBand(0),direction(0),SuperTrend(C);
var : A(0),B(0),count(Nan);
if CurrentBar > 1 Then
{
src = (H+L)/2;
alpha = 1 / period ;
ATRV = IFf(IsNan(ATRV[1]) == true, ma(TrueRange,period) , alpha * TrueRange + (1 - alpha) * IFf(isnan(ATRV[1])==true,0,ATRV[1]));
upperBand = src + multiplier * AtrV;
lowerBand = src - multiplier * AtrV;
if lowerBand > lowerBand[1] or close[1] < lowerBand[1] Then
lowerBand = lowerBand;
Else
lowerBand = lowerBand[1];
if upperBand < upperBand[1] or close[1] > upperBand[1] Then
upperBand = upperBand;
Else
upperBand = upperBand[1];
if C > UpperBand Then
direction = 1;
if C < LowerBand Then
direction = -1;
if direction == 1 Then
SuperTrend = lowerband;
Else
SuperTrend = upperband;
}
A = Supertrend;
if CrossDown(C,A) Then
B = A[1];
if sdate != sDate[1] Then
count = 0;
if CrossUp(C,B) Then
count = count+1;
if count >= 1 Then
Find(1);
즐거운 하루되세요