커뮤니티

부탁드립니다.

프로필 이미지
까시서방
2015-10-21 21:36:54
151
글번호 91565
답변완료
아래 내용을 2분봉 챠트에서 4분봉의 것으로 볼수 있게 부탁드립니다. Input:Period(20),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); 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(MaxPrc);
지표
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2015-10-22 16:09:37

안녕하세요 예스스탁입니다. 문의하신 내용 수식 자체에서 계산할수는 없고 참조데이터를 이용하셔야 합니다. 차트에 참조데이터로 4분봉 데이터를 차트에 추가하시고 아래식 적용하시면 됩니다. 참조데이터는 차트왼쪽 상단의 종목선택버튼 중 오른쪽 클릭하신후에 선택해서 추가하시면 됩니다. Input:Period(20),Percent(50); Var:arr(0,data2),j(0,data2),cnt(0,data2),HH(0,data2),LL(0,data2),Tick(0,data2),TickVol(0,data2), TotVol(0,data2),SubTotVol(0,data2),MaxArr(0,data2),UpArr(0,data2),DnArr(0,data2),MaxPrc(0,data2), UpPrc(0,data2),DwnPrc(0,data2),Vol1(0,data2),Vol2(0,data2); var : H2(0,data2),L2(0,data2),v2(0,data2); Array:Prc[100](0,data2),Vol[100](0,data2); H2 = data2(H); L2 = data2(L); V2 = data2(V); HH = data2(Highest(H,Period)); LL = data2(Lowest(L,Period)); 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 L2[j] <= Prc[arr] and Prc[arr] <= H2[j] then cnt = cnt + 1; } TickVol = V2[j]/cnt; for arr = 0 to 99 { if L2[j] <= Prc[arr] and Prc[arr] <= H2[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(MaxPrc); 즐거운 하루되세요 > 까시서방 님이 쓴 글입니다. > 제목 : 부탁드립니다. > 아래 내용을 2분봉 챠트에서 4분봉의 것으로 볼수 있게 부탁드립니다. Input:Period(20),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); 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(MaxPrc);