커뮤니티
갭보정좀 부탁드립니다.
2012-02-07 12:05:24
313
글번호 47453
이 지표의 갭보정 좀 부탁드립니다.
감사드립니다.
Input:Period(60),Percent(50);
Var:arr(0),j(0),cnt(0),HH(0),LL(0),Tick(0),TickVol(0),
TotVol(0),SubTotVol(0),MaxArr(0),UpArr(0),DnArr(0),MaxPrc(0),
UpPrc(0),DwnPrc(0),Vol1(0),Vol2(0);
Array:Prc[100](0),Vol[100](0);
HH = Highest(H,Period);
LL = Lowest(L,Period);
if CodeCategoryEX() == 51 then
Tick = Round((HH-LL)/100,2);
else
Tick = Ceiling((HH-LL)/100/PriceScale)*PriceScale;
Prc[0] = HH;
Vol[0] = 0;
for arr = 1 to 99 {
Prc[arr] = Prc[arr-1] - Tick;
Vol[arr] = 0;
}
for j = 0 to Period-1 {
cnt = 0;
for arr = 0 to 99 {
if L[j] <= Prc[arr] and Prc[arr] <= H[j] then
cnt = cnt + 1;
}
TickVol = V[j]/cnt;
for arr = 0 to 99 {
if L[j] <= Prc[arr] and Prc[arr] <= H[j] then {
Vol[arr] = Vol[arr] + TickVol;
}
}
}
TotVol = 0;
MaxArr = 2;
for arr = 0 to 99 {
TotVol = TotVol + Vol[arr];
if arr >= 2 and arr <= 97 then {
if Vol[MaxArr-2]+Vol[MaxArr-1]+Vol[MaxArr]+Vol[MaxArr+1]+Vol[MaxArr+2] <
Vol[arr-2] +Vol[arr-1] +Vol[arr] +Vol[arr+1] +Vol[arr+2] then
MaxArr = arr;
}
}
UpArr = MaxArr;
DnArr = MaxArr;
SubTotVol = Vol[MaxArr];
for j = 0 to 99 {
Vol1 = iff(UpArr-1>=0,Vol[UpArr-1],0);
Vol2 = iff(DnArr+1<=99,Vol[DnArr+1],0);
if Vol1 > Vol2 then {
SubTotVol = SubTotVol + Vol1;
UpArr = UpArr - 1;
}
else if Vol1 < Vol2 then {
SubTotVol = SubTotVol + Vol2;
DnArr = DnArr + 1;
}
else if Vol1 == Vol2 and Vol1 > 0 and Vol2 > 0 then {
SubTotVol = SubTotVol + Vol1;
UpArr = UpArr - 1;
if SubTotVol < TotVol * Percent/100 then {
SubTotVol = SubTotVol + Vol2;
DnArr = DnArr + 1;
}
}
else if Vol1 + Vol2 == 0 then {
if UpArr >= (99 - DnArr) then Uparr = UpArr - 1;
else DnArr = DnArr + 1;
}
if SubTotVol >= TotVol * Percent/100 then
j = 99;
}
MaxPrc = Prc[MaxArr];
UpPrc = Prc[UpArr];
DwnPrc = Prc[DnArr];
plot1(UpPrc);
Plot2(DwnPrc);
Plot3(MaxPrc);
답변 1
예스스탁 예스스탁 답변
2012-02-07 16:34:06
안녕하세요
예스스탁입니다.
Input:Period(60),Percent(50);
Var:arr(0),j(0),cnt(0),HH(0),LL(0),Tick(0),TickVol(0),
TotVol(0),SubTotVol(0),MaxArr(0),UpArr(0),DnArr(0),MaxPrc(0),
UpPrc(0),DwnPrc(0),Vol1(0),Vol2(0);
Array:Prc[100](0),Vol[100](0);
var : sumGap(0), gap(0), GO(0), GH(0), GL(0), GC(0);
if date!=date[1] then { // 날짜가 변경되는 봉에서
gap = Open-Close[1]; // 일간갭
sumGap = sumGap+gap; // 일간갭 누적
}
GO = O - sumGap; // 시가에서 갭누적값을 차감
GH = H - sumGap; // 고가에서 갭누적값을 차감
GL = L - sumGap; // 저가에서 갭누적값을 차감
GC = C - sumGap; // 종가에서 갭누적값을 차감
HH = Highest(GH,Period);
LL = Lowest(GL,Period);
if CodeCategoryEX() == 51 then
Tick = Round((HH-LL)/100,2);
else
Tick = Ceiling((HH-LL)/100/PriceScale)*PriceScale;
Prc[0] = HH;
Vol[0] = 0;
for arr = 1 to 99 {
Prc[arr] = Prc[arr-1] - Tick;
Vol[arr] = 0;
}
for j = 0 to Period-1 {
cnt = 0;
for arr = 0 to 99 {
if GL[j] <= Prc[arr] and Prc[arr] <= GH[j] then
cnt = cnt + 1;
}
TickVol = V[j]/cnt;
for arr = 0 to 99 {
if GL[j] <= Prc[arr] and Prc[arr] <= GH[j] then {
Vol[arr] = Vol[arr] + TickVol;
}
}
}
TotVol = 0;
MaxArr = 2;
for arr = 0 to 99 {
TotVol = TotVol + Vol[arr];
if arr >= 2 and arr <= 97 then {
if Vol[MaxArr-2]+Vol[MaxArr-1]+Vol[MaxArr]+Vol[MaxArr+1]+Vol[MaxArr+2] <
Vol[arr-2] +Vol[arr-1] +Vol[arr] +Vol[arr+1] +Vol[arr+2] then
MaxArr = arr;
}
}
UpArr = MaxArr;
DnArr = MaxArr;
SubTotVol = Vol[MaxArr];
for j = 0 to 99 {
Vol1 = iff(UpArr-1>=0,Vol[UpArr-1],0);
Vol2 = iff(DnArr+1<=99,Vol[DnArr+1],0);
if Vol1 > Vol2 then {
SubTotVol = SubTotVol + Vol1;
UpArr = UpArr - 1;
}
else if Vol1 < Vol2 then {
SubTotVol = SubTotVol + Vol2;
DnArr = DnArr + 1;
}
else if Vol1 == Vol2 and Vol1 > 0 and Vol2 > 0 then {
SubTotVol = SubTotVol + Vol1;
UpArr = UpArr - 1;
if SubTotVol < TotVol * Percent/100 then {
SubTotVol = SubTotVol + Vol2;
DnArr = DnArr + 1;
}
}
else if Vol1 + Vol2 == 0 then {
if UpArr >= (99 - DnArr) then Uparr = UpArr - 1;
else DnArr = DnArr + 1;
}
if SubTotVol >= TotVol * Percent/100 then
j = 99;
}
MaxPrc = Prc[MaxArr];
UpPrc = Prc[UpArr];
DwnPrc = Prc[DnArr];
plot1(UpPrc);
Plot2(DwnPrc);
Plot3(MaxPrc);
즐거운 하루되세요
> 머나먼여정 님이 쓴 글입니다.
> 제목 : 갭보정좀 부탁드립니다.
> 이 지표의 갭보정 좀 부탁드립니다.
감사드립니다.
Input:Period(60),Percent(50);
Var:arr(0),j(0),cnt(0),HH(0),LL(0),Tick(0),TickVol(0),
TotVol(0),SubTotVol(0),MaxArr(0),UpArr(0),DnArr(0),MaxPrc(0),
UpPrc(0),DwnPrc(0),Vol1(0),Vol2(0);
Array:Prc[100](0),Vol[100](0);
HH = Highest(H,Period);
LL = Lowest(L,Period);
if CodeCategoryEX() == 51 then
Tick = Round((HH-LL)/100,2);
else
Tick = Ceiling((HH-LL)/100/PriceScale)*PriceScale;
Prc[0] = HH;
Vol[0] = 0;
for arr = 1 to 99 {
Prc[arr] = Prc[arr-1] - Tick;
Vol[arr] = 0;
}
for j = 0 to Period-1 {
cnt = 0;
for arr = 0 to 99 {
if L[j] <= Prc[arr] and Prc[arr] <= H[j] then
cnt = cnt + 1;
}
TickVol = V[j]/cnt;
for arr = 0 to 99 {
if L[j] <= Prc[arr] and Prc[arr] <= H[j] then {
Vol[arr] = Vol[arr] + TickVol;
}
}
}
TotVol = 0;
MaxArr = 2;
for arr = 0 to 99 {
TotVol = TotVol + Vol[arr];
if arr >= 2 and arr <= 97 then {
if Vol[MaxArr-2]+Vol[MaxArr-1]+Vol[MaxArr]+Vol[MaxArr+1]+Vol[MaxArr+2] <
Vol[arr-2] +Vol[arr-1] +Vol[arr] +Vol[arr+1] +Vol[arr+2] then
MaxArr = arr;
}
}
UpArr = MaxArr;
DnArr = MaxArr;
SubTotVol = Vol[MaxArr];
for j = 0 to 99 {
Vol1 = iff(UpArr-1>=0,Vol[UpArr-1],0);
Vol2 = iff(DnArr+1<=99,Vol[DnArr+1],0);
if Vol1 > Vol2 then {
SubTotVol = SubTotVol + Vol1;
UpArr = UpArr - 1;
}
else if Vol1 < Vol2 then {
SubTotVol = SubTotVol + Vol2;
DnArr = DnArr + 1;
}
else if Vol1 == Vol2 and Vol1 > 0 and Vol2 > 0 then {
SubTotVol = SubTotVol + Vol1;
UpArr = UpArr - 1;
if SubTotVol < TotVol * Percent/100 then {
SubTotVol = SubTotVol + Vol2;
DnArr = DnArr + 1;
}
}
else if Vol1 + Vol2 == 0 then {
if UpArr >= (99 - DnArr) then Uparr = UpArr - 1;
else DnArr = DnArr + 1;
}
if SubTotVol >= TotVol * Percent/100 then
j = 99;
}
MaxPrc = Prc[MaxArr];
UpPrc = Prc[UpArr];
DwnPrc = Prc[DnArr];
plot1(UpPrc);
Plot2(DwnPrc);
Plot3(MaxPrc);
다음글