예스스탁
예스스탁 답변
2019-11-26 14:16:17
안녕하세요
예스스탁입니다.
1
input:Percent(50),StartTime(93000),EndTime(103000);
Var:arr(0),j(0),cnt(0),HH(0),LL(0),Tick(0),TickVol(0),PrcVol(0),TotVol(0),SubTotVol(0),
MaxArr(0),UpArr(0),DnArr(0),MaxPrc(0),UpPrc(0),DwnPrc(0),Vol1(0),Vol2(0);
var : Tcond(false),idx(0);
Array:Prc[100](0),Vol[100](0);
if (sdate != sdate[1] and stime >= StartTime) or
(sdate == sdate[1] and stime >= StartTime and stime[1] < StartTime) Then
{
Tcond = true;
HH = H;
LL = L;
idx = 0;
}
if (sdate != sdate[1] and stime >= EndTime) or
(sdate == sdate[1] and stime >= EndTime and stime[1] < EndTime) Then
{
Tcond = false;
}
if Tcond == true then
{
idx = idx+1;
if H > HH Then
HH = H;
if L < LL Then
LL = L;
if CodeCategoryEX() == 51 then
Tick = round((HH-LL)/100,2);
else
Tick = Ceiling((HH-LL)/100/_TickValue())*_TickValue();
Prc[0] = HH;
Vol[0] = 0;
for arr = 1 to 99
{
Prc[arr] = Prc[arr-1] - Tick;
Vol[arr] = 0;
}
for j = 0 to idx-1
{
cnt = 0;
for arr = 0 to 99 {
if L[j] <= Prc[arr] and Prc[arr] <= H[j] then
cnt = cnt + 1;
}
TickVol = C[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;
PrcVol = 0;
MaxArr = 2;
for arr = 0 to 99 {
TotVol = TotVol + Vol[arr];
if L <= Prc[arr] and Prc[arr] <= H then {
PrcVol = PrcVol + 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);
2
특정시간의 저가이면 아래와 같이 작성해 사용하시면 됩니다.
input:nTime(93000);
if (sdate != sdate[1] and stime >= nTime) or
(sdate == sdate[1] and stime >= nTime and stime[1] < nTime) Then
{
var1 = O;
}
plot1(var1);
이전일의 일봉시가이면 아래와 같이 지정하시면 됩니다.
input : n(1);
plot1(dayopen(n),"n일전시가");
즐거운 하루되세요
> 성공예견 님이 쓴 글입니다.
> 제목 : 지표문의
> 1.아래는 매물대 지표인데요
2.아래지표를 9시30분 부터 계산해서 10시 30분 까지 만 표시 한걸 보구 싶어요
(9시 장 시작 연장이 아니라 9시30분봉 부터10시30분 봉까지)
수정좀해 주세요
3.참고로 특정시가 만 지표를 표시 해볼려면 지표 표시 하는법두 부탁드려요
Input:Period(60),Percent(50);
Var:arr(0),j(0),cnt(0),HH(0),LL(0),Tick(0),TickVol(0),PrcVol(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/_TickValue())*_TickValue();
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 = C[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;
PrcVol = 0;
MaxArr = 2;
for arr = 0 to 99 {
TotVol = TotVol + Vol[arr];
if L <= Prc[arr] and Prc[arr] <= H then {
PrcVol = PrcVol + 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);
4. 그럼 즐거운 하루 되세요