예스스탁
예스스탁 답변
2025-01-02 15:32:05
안녕하세요
예스스탁입니다.
input : period(60),multiplier(3);
var : src(0), AtrV(0),upperBand(0),lowerBand(0), prevLowerBand(0), prevUpperBand(0);
var : prevSuperTrend(0), direction(0),alpha(0),source(0),S(C),라인(0),K(0);
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
S = lowerband;
Else
S = upperband;
}
var : 조건(False),bs(0),mm(0);
mm = ma(C,20);
조건 = mm > mm[1] and CrossUp(s,mm);
if 조건 Then
bs = 0;
Else
bs = bs+1;
if bs > 0 and CrossDown(s,mm) and mm > mm[1] and c[1] < s[1] Then
Find(1);
즐거운 하루되세요
> 김승빈 님이 쓴 글입니다.
> 제목 : 검색식 문의
> 검색식 문의 드립니다
S=supertrend(period, multiplier);
M=ma(C,20);
조건=M>M(1) && CrossUp(S,M);
bs=BarsSince(조건);
bs>0 && CrossDown(S,M) &&
M>M(1) && C(1)<S(1)
항상 감사드립니다