예스스탁
예스스탁 답변
2024-10-11 16:16:05
안녕하세요
예스스탁입니다.
Input : shortPeriod(5), midPeriod(20), longPeriod(40);
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);
var : count(-1);
value1 = ma(C,shortPeriod);
value2 = ma(C,midPeriod);
value3 = ma(C,longPeriod);
If value1 > value2 && value1 > value3 && value3 > value2 Then
count = 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;
if CountIf(C > supertrend and max(C,O) > var1,3) == 3 Then
{
if count >= 0 Then
{
count = count+1;
if count == 1 Then
Find(1);
}
}
}
즐거운 하루되세요
> 비밀통로 님이 쓴 글입니다.
> 제목 : 종목검색식 부탁드립니다.
> 아래의 (조건1)을 만족한 후에 첫번째로 발생하는 (조건2)에 대한
종목검색식을 부탁드립니다,
감사합니다...^^
(조건1)
Input : shortPeriod(5), midPeriod(20), longPeriod(40);
value1 = ma(C,shortPeriod);
value2 = ma(C,midPeriod);
value3 = ma(C,longPeriod);
If value1 > value2 && value1 > value3 && value3 > value2 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;
if CountIf(C > supertrend and max(C,O) > var1,3) == 3 Then
Find(1);
}