예스스탁
예스스탁 답변
2024-11-22 10:09:09
안녕하세요
예스스탁입니다.
1
input : A(20),B(3),D(20);
var : src(0), AtrV(0),upperBand(0),lowerBand(0), prevLowerBand(0), prevUpperBand(0);
var : prevSuperTrend(0), direction(0),alpha(0),source(0),S(C);
if CurrentBar > 1 Then
{
src = (H+L)/2;
alpha = 1 / A ;
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 + B * AtrV;
lowerBand = src - B * 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 : T(0),P1(0),P2(0);
T = LRL(C,D) + LRS(C,D);
if CrossUp(C,S) Then
{
P1 = S[1];
P2 = S;
}
if CrossUp(C, S) && T[1] < (P1+P2)/2 && O < (P1-P2)/4 * 3 + P2 && C > O Then
Find(1);
2
input : A(20),B(3),D(20),봉수(10);
var : src(0), AtrV(0),upperBand(0),lowerBand(0), prevLowerBand(0), prevUpperBand(0);
var : prevSuperTrend(0), direction(0),alpha(0),source(0),S(C);
if CurrentBar > 1 Then
{
src = (H+L)/2;
alpha = 1 / A ;
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 + B * AtrV;
lowerBand = src - B * 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 : T(0),P1(0),P2(0);
T = LRL(C,D) + LRS(C,D);
if CrossUp(C, S) && countif(T > T[1], 봉수)==봉수 && CrossUp(T, S) Then
Find(1);
즐거운 하루되세요
> onlypsn 님이 쓴 글입니다.
> 제목 : 종목검색식 요청드립니다.
> 아래키움수식1과 키움수식2의 신호가 발생하는 종목검색식을 각각 만들고 싶습니다. 도움 부탁드리겠습니다. 감사합니다.
키움수식1. (지표변수 - A(20),B(3),D(20))
S = SuperTrend(A, B);
T = LRL(D) + LRS(D);
P1 = Valuewhen(1, CrossUp(C, S), S(1));
P2 = Valuewhen(1, CrossUp(C, S), S);
CrossUp(C, S) &&
T(1) < (P1+P2)/2 &&
O < (P1-P2)/4 * 3 + P2 &&
C > O
키움수식2. (지표변수 - A(20),B(3),D(20),봉수(10)))
S = SuperTrend(A, B);
T = LRL(D) + LRS(D);
CrossUp(C, S) &&
sum(T > T(1), 봉수)==봉수 &&
CrossUp(T, S)