예스스탁
예스스탁 답변
2025-04-11 17:00:48
안녕하세요
예스스탁입니다.
input : period1(12),multiplier1(3);
input : period2(11),multiplier2(2);
input : period3(10),multiplier3(1);
var : src(0);
var : AtrV1(0),upperBand1(0),lowerBand1(0), prevLowerBand1(0), prevUpperBand1(0);
var : prevSuperTrend1(0), direction1(0),alpha1(0),source1(0),SuperTrend1(C);
var : AtrV2(0),upperBand2(0),lowerBand2(0), prevLowerBand2(0), prevUpperBand2(0);
var : prevSuperTrend2(0), direction2(0),alpha2(0),source2(0),SuperTrend2(C);
var : AtrV3(0),upperBand3(0),lowerBand3(0), prevLowerBand3(0), prevUpperBand3(0);
var : prevSuperTrend3(0), direction3(0),alpha3(0),source3(0),SuperTrend3(C);
var : A(0),A1(0),A2(0),B(0),B1(0),B2(0);
src = (H+L)/2;
if CurrentBar > 1 Then
{
alpha1 = 1 / period1 ;
source1 = max(high - low, abs(high - close[1]), abs(low - close[1]));
ATrV1 = alpha1 * source1 + (1 - alpha1) * ATrV1[1]; //지수가중이평방식
upperBand1 = src + multiplier1 * AtrV1;
lowerBand1 = src - multiplier1 * AtrV1;
prevLowerBand1 = lowerBand1[1];
prevUpperBand1 = upperBand1[1];
if lowerBand1 > prevLowerBand1 or close[1] < prevLowerBand1 Then
lowerBand1 = lowerBand1;
Else
lowerBand1 = prevLowerBand1;
if upperBand1 < prevUpperBand1 or close[1] > prevUpperBand1 Then
upperBand1 = upperBand1;
Else
upperBand1 = prevUpperBand1;
if C > UpperBand1 Then
direction1 = 1;
if C < LowerBand1 Then
direction1 = -1;
if direction1 == 1 Then
SuperTrend1 = lowerband1;
Else
SuperTrend1 = upperband1;
alpha2 = 1 / period2 ;
source2 = max(high - low, abs(high - close[1]), abs(low - close[1]));
ATrV2 = alpha2 * source2 + (1 - alpha2) * ATrV2[1]; //지수가중이평방식
upperBand2 = src + multiplier2 * AtrV2;
lowerBand2 = src - multiplier2 * AtrV2;
prevLowerBand2 = lowerBand2[1];
prevUpperBand2 = upperBand2[1];
if lowerBand2 > prevLowerBand2 or close[1] < prevLowerBand2 Then
lowerBand2 = lowerBand2;
Else
lowerBand2 = prevLowerBand2;
if upperBand2 < prevUpperBand2 or close[1] > prevUpperBand2 Then
upperBand2 = upperBand2;
Else
upperBand2 = prevUpperBand2;
if C > UpperBand2 Then
direction2 = 1;
if C < LowerBand2 Then
direction2 = -1;
if direction2 == 1 Then
SuperTrend2 = lowerband2;
Else
SuperTrend2 = upperband2;
alpha3 = 1 / period3 ;
source3 = max(high - low, abs(high - close[1]), abs(low - close[1]));
ATrV3 = alpha3 * source3 + (1 - alpha3) * ATrV3[1]; //지수가중이평방식
upperBand3 = src + multiplier3 * AtrV3;
lowerBand3 = src - multiplier3 * AtrV3;
prevLowerBand3 = lowerBand3[1];
prevUpperBand3 = upperBand3[1];
if lowerBand3 > prevLowerBand3 or close[1] < prevLowerBand3 Then
lowerBand3 = lowerBand3;
Else
lowerBand3 = prevLowerBand3;
if upperBand3 < prevUpperBand3 or close[1] > prevUpperBand3 Then
upperBand3 = upperBand3;
Else
upperBand3 = prevUpperBand3;
if C > UpperBand3 Then
direction3 = 1;
if C < LowerBand3 Then
direction3 = -1;
if direction3 == 1 Then
SuperTrend3 = lowerband3;
Else
SuperTrend3 = upperband3;
A=supertrend1;
A1=supertrend2;
A2=supertrend3;
B=(highest(high,9)+lowest(low,9)+highest(high,26)+lowest(low,26))/4;
B1=(highest(high,52)+lowest(low,52))/2;
B2=ma(C,200);
if A<C && A1<C && A2<C && CROSSUP(C, MAX(B,B1,B2)) Then
PlotPaintBar(H,L,"강조");
}
즐거운 하루되세요
> 비리번 님이 쓴 글입니다.
> 제목 : 강조 수식 문의 드립니다
>
A=supertrend(12,3);
A1=supertrend(11,2);
A2=supertrend(10,1);
B=(highest(high,9)+lowest(low,9)+highest(high,26)+lowest(low,26))/4;
B1=(highest(high,52)+lowest(low,52))/2;
B2=AVG(C,200);
A<C && A1<C && A2<C && CROSSUP(C, MAX(B,B1,B2))