아래일간지표수치를 분차트에서도 동일 수치로 볼수있도록 부탁드립니다.
Inputs: Length(14);
Variables : ABull(0), ABear(0), BBull(0), BBear(0),ARatio(0), BRatio(0);
ABull = accumn(High - Open, Length);
ABear = Accumn(Open - Low, Length);
BBull = Accumn(High - Close[1], Length);
BBear = Accumn(Close[1] - Low, Length);
ARatio = ABull / ABear * 100;
BRatio = BBull / BBear * 100;
var1 = (ARatio+BRatio)/2;
Var2 = ma(var1,5);
Plot1(ARatio, "A-ratio",BLUE);
Plot2(BRatio, "B-ratio",RED);
Plot3(var1, "평균");
Plot4(var2, "이평");
답변 1
예스스탁
예스스탁 답변
2021-01-08 15:25:42
안녕하세요
예스스탁입니다.
Input : Length(14),sig(5);
Var : ABull(0), ABear(0), BBull(0), BBear(0),ARatio(0), BRatio(0);
var : sum(0),cnt1(0),cnt2(0);
sum = 0;
for cnt1 = 0 to sig-1
{
ABull = 0;
ABear = 0;
BBull = 0;
BBear = 0;
For cnt2 = cnt1+0 to cnt1+Length-1
{
ABull = ABull + (dayHigh(cnt2) - dayOpen(cnt2));
ABear = ABear + (dayOpen(cnt2) - dayLow(cnt2));
BBull = BBull + (dayHigh(cnt2) - dayclose(cnt2+1));
BBear = BBear + (dayClose(cnt2+1) - dayLow(cnt2));
}
value1 = ABull / ABear * 100;
value2 = BBull / BBear * 100;
Value3 = (value1+value2)/2;
if cnt1 == 0 Then
{
ARatio = value1;
BRatio = Value2;
var1 = value3;
}
sum = sum + Value3;
}
Var2 = sum/sig;
Plot1(ARatio, "A-ratio",BLUE);
Plot2(BRatio, "B-ratio",RED);
Plot3(var1, "평균");
Plot4(var2, "이평");
즐거운 하루되세요
> e편한신호 님이 쓴 글입니다.
> 제목 : 부탁드립니다.
> 아래일간지표수치를 분차트에서도 동일 수치로 볼수있도록 부탁드립니다.
Inputs: Length(14);
Variables : ABull(0), ABear(0), BBull(0), BBear(0),ARatio(0), BRatio(0);
ABull = accumn(High - Open, Length);
ABear = Accumn(Open - Low, Length);
BBull = Accumn(High - Close[1], Length);
BBear = Accumn(Close[1] - Low, Length);
ARatio = ABull / ABear * 100;
BRatio = BBull / BBear * 100;
var1 = (ARatio+BRatio)/2;
Var2 = ma(var1,5);
Plot1(ARatio, "A-ratio",BLUE);
Plot2(BRatio, "B-ratio",RED);
Plot3(var1, "평균");
Plot4(var2, "이평");