답변완료
표시 이동
Input : 전환(0.15);
Var:j(0),jj(0),HH(0),LL(0),hiBar(0),loBar(0),최종꼭지점(""),처리구분("");
Array:고[10,4](0),저[10,4](0);
var : box(0), TL(0),TX(0),TX2(0);
HH = H;
LL = L;
If Index == 0 Then
{
고[1,1] = HH;
고[1,2] = 0;
고[1,3] = sDate;
고[1,4] = sTime;
저[1,1] = LL;
저[1,2] = 0;
저[1,3] = sDate;
저[1,4] = sTime;
}
If Index > 0 Then
{
hiBar = hiBar + 1;
loBar = loBar + 1;
}
If HH[hiBar] < HH Then hiBar = 0;
If LL[loBar] > LL Then loBar = 0;
Condition1 = 저[1,1]+전환 <= HH and hiBar == 0;
Condition2 = 고[1,1]-전환 >= LL and loBar == 0;
처리구분 = "";
If Condition1 and Condition2 Then
{
If 최종꼭지점 == "저점" Then
{
If 저[1,1] > LL Then 처리구분 = "저점처리";
Else 처리구분 = "고점처리";
}
Else If 최종꼭지점 == "고점" Then
{
If 고[1,1] < HH Then 처리구분 = "고점처리";
Else 처리구분 = "저점처리";
}
}
Else If Condition1 Then 처리구분 = "고점처리";
Else If Condition2 Then 처리구분 = "저점처리";
If 처리구분 == "고점처리" Then
{
If 최종꼭지점 == "저점" Then
{
For j = 10 DownTo 2
{
For jj = 1 To 4
{
고[j,jj] = 고[j-1,jj];
}
}
고[1,1] = HH[hiBar];
고[1,2] = Index - hiBar;
고[1,3] = sDate[hiBar];
고[1,4] = sTime[hiBar];
hiBar = -1;
loBar = -1;
tx2 = Text_New(저[1,3],저[1,4],저[1,1],"●");
Text_SetStyle(tx2,2,2);
Text_SetColor(tx2,Green);
Text_SetSize(tx2,13);
}
Else If 고[1,1] < HH[hiBar] Then
{
고[1,1] = HH[hiBar];
고[1,2] = Index - hiBar;
고[1,3] = sDate[hiBar];
고[1,4] = sTime[hiBar];
hiBar = -1;
loBar = -1;
}
최종꼭지점 = "고점";
Plot1(고[1,1]);
NoPlot(2);
}
If 처리구분 == "저점처리" Then
{
If 최종꼭지점 == "고점" Then
{
For j = 10 DownTo 2
{
For jj = 1 To 4
{
저[j,jj] = 저[j-1,jj];
}
}
저[1,1] = LL[loBar];
저[1,2] = Index - loBar;
저[1,3] = sDate[loBar];
저[1,4] = sTime[loBar];
hiBar = -1;
loBar = -1;
tx2 = Text_New(고[1,3],고[1,4],고[1,1],"●");
Text_SetStyle(tx2,2,2);
Text_SetColor(tx2,Magenta);
Text_SetSize(tx2,13);
}
Else If 저[1,1] > LL[loBar] Then
{
저[1,1] = LL[loBar];
저[1,2] = Index - loBar;
저[1,3] = sDate[loBar];
저[1,4] = sTime[loBar];
hiBar = -1;
loBar = -1;
}
최종꼭지점 = "저점";
Plot2(저[1,1]);
NoPlot(1);
}
상승전환하면 하단 시작점에 동그라미 표시 되는 것을,
상승 추세선 상단 시작점 봉 위에 표시 후 상단을 따라 상승 이동하다가, 하락전환시 추세선의 최고점봉 위에 저장. 하락은 반대. 감사합니다.
2023-12-20
970
글번호 175043
지표
답변완료
부탁드립니다2
수고 많으십니다.
아래 1)거래량 지표와 아래 2)의 Data2 거래량 지표를 합친 수식을 만들고자합니다.
번거롭더라도 도와주시면 감사하겠습니다.
오늘도 좋은하루 되시길 바랍니다.
====================
1)지표
input : R1(0),G1(0),B1(0);
input : R2(0),G2(0),B2(0);
var : hh(0),ll(0);
if Bdate != Bdate[1] Then
{
var1 = 0;
Var2 = Upvol-DownVol;
}
var1 = var1 + (Upvol-DownVol);
if CurrentDate == sDate Then
Plot1(var1,"당일실매수거래량",iff(var1 > 0,RGB(0,0,0),RGB(0,0,0)));
if CurrentDate == sDate Then
plot2(Var2,"첫봉종가");
if Bdate != Bdate[1] Then
{
hh = var1;
ll = var1;
}
Else
{
if var1 > hh Then
hh = var1;
if var1 < ll Then
ll = var1;
}
if CurrentDate == sDate Then
plot11(Var2+75,"첫봉종가+50");
if Bdate != Bdate[1] Then
{
hh = var1;
ll = var1;
}
Else
{
if var1 > hh Then
hh = var1;
if var1 < ll Then
ll = var1;
}
if CurrentDate == sDate Then
plot12(Var2-75,"첫봉종가-50");
if Bdate != Bdate[1] Then
{
hh = var1;
ll = var1;
}
Else
{
if var1 > hh Then
hh = var1;
if var1 < ll Then
ll = var1;
}
if CurrentDate == sDate Then
{
Plot3(hh,"최고");
plot4(ll,"최저");
plot5(ll+(hh-ll)*0.25,"25.0%");
plot6(ll+(hh-ll)*0.382,"38.2%");
plot7(ll+(hh-ll)*0.500,"50.0%");
plot8(ll+(hh-ll)*0.508+0.08,"50+0.02%");
plot9(ll+(hh-ll)*0.618,"61.8%");
plot10(ll+(hh-ll)*0.75,"75.0%");
plot13(ll+(hh-ll)*0.125,"12.5%");
plot14(ll+(hh-ll)*0.875,"87.5%");
plot15(ll+(hh-ll)*0.500+70,"10+60%");
plot16(ll+(hh-ll)*0.500-70,"220-60%");
Plot17(var1+20,"당일실매수거래량2",iff(var1 > 0,RGB(0,0,0),RGB(0,0,0)));
plot18(ll+(hh-ll)*0.243,"25.30%");
plot19(ll+(hh-ll)*0.743,"75.30%");
PlotBaseLine1(0);
}
2) 지표
var : C2(0,Data2),H2(0,Data2),L2(0,Data2),cnt(0,Data2);
var : Sidx(0,Data2),Sidx1(0,Data2),Eidx(0,Data2),Eidx1(0,Data2),Pre1(0,Data2);
C2 = Data2(c);
if Data2(Bdate != Bdate[1]) Then
{
H2 = C2;
L2 = C2;
Sidx = data2(Index);
Sidx1 = Sidx[1];
Eidx1 = Eidx[1];
}
Eidx = data2(Index);
if data2(Bdate != Bdate[1] or (Bdate == bdate[1] and C2 > h2)) Then
h2 = C2;
if data2(Bdate != Bdate[1] or (Bdate == Bdate[1] and C2 < l2)) Then
l2 = C2;
if Sidx1 > 0 Then
{
pre1 = 0;
For cnt = data2(Index)-Eidx1 to data2(Index)-Sidx1
{
if data2(sDate[cnt] < sDate and sTime[cnt] <= sTime) Then
{
pre1 = C2[cnt];
cnt = data2(Index-Sidx1+1);
}
}
}
// if CurrentDate == sDate and Data1(sDate) == Data2(sDate) Then
{
Plot1(C2,"참조",IFf(C2 >0,RGB(0,0,0),RGB(0,0,0)));
Plot2(H2,"최고");
Plot3(L2,"최저");
Plot4(pre1,"전일");
PlotBaseLine1(0);
Plot5(Data2(OpenD(0)),"D2당일시가");
Plot6(Data2(HighD(0)),"D2당일고가");
Plot7(Data2(LowD(0)),"D2당일저가");
Plot8(Data2(LowD(0)+(HighD(0)- LowD(0))*0.236),"23.6%");
Plot9(Data2(LowD(0)+(HighD(0)- LowD(0))*0.764),"76.4%");
Plot10(Data2(LowD(0)+(HighD(0)- LowD(0))*0.382),"38.2%");
Plot11(Data2(LowD(0)+(HighD(0)- LowD(0))*0.618),"61.8%");
Plot12(Data2(LowD(0)+(HighD(0)- LowD(0))*0.50),"50.0%");
Plot13(Data2(LowD(0)+(HighD(0)- LowD(0))*0.50-50),"-50.0%");
}
2023-12-20
1000
글번호 175037
지표
답변완료
부탁드립니다.
안녕하세요?
아래 지표에서 2일 시작선에서 pt1과, 2일 시작선에서 pt2사이를 채우기하는것이 아니라
PT1과 PT2 사이를 채우기하고자 합니다.
노고에 감사드리며 부탁드려봅니다.
===================================
input : p(2),pt1(1.25),pt2(1.5);
input : 굵기1(5),R1(255),G1(0),B1(0);
input : 굵기2(5),R2(255),G2(0),B2(0);
input : 굵기3(5),R3(0),G3(0),B3(255);
input : 굵기4(5),R4(0),G4(0),B4(255);
var : cnt(0),sum(0),mav(0);
var : TL1(0),TL2(0),TL3(0),TL4(0),TL5(0);
var : box1(0),box2(0),box3(0),box4(0);
sum = DayOpen(0);
if P >= 2 Then
{
For cnt = 1 to P-1
{
sum = sum + DayClose(cnt);
}
}
mav = sum/P;
if Index == 0 or (sTime >= 152000 and sTime[1] < 152000) Then
{
var1 = sDate;
Var2 = stime;
}
if Bdate != Bdate[1] Then
{
if var1 > 0 and Var2 > 0 Then
{
#mav+pt2 ~ mav+pt1
box1 = box_new(var1,Var2,mav+pt2,sDate,sTime,mav+pt1);
#mav+pt1 ~ mav
box2 = box_new(var1,Var2,mav+pt1,sDate,sTime,mav);
#mav ~ mav-pt1
box3 = box_new(var1,Var2,mav,sDate,sTime,mav-pt1);
#mav-pt1 ~ mav-pt2
box4 = box_new(var1,Var2,mav-pt2,sDate,sTime,mav-pt1);
box_SetColor(box1,RGB(R1,G1,B1));
box_SetColor(box2,RGB(R2,G2,B2));
box_SetColor(box3,RGB(R3,G3,B3));
box_SetColor(box4,RGB(R4,G4,B4));
box_SetSize(box1, 굵기1);
box_SetSize(box2, 굵기2);
box_SetSize(box3, 굵기3);
box_SetSize(box4, 굵기4);
Box_SetFill(box1,true,10);#채우기 투명도 10
Box_SetFill(box2,true,10);#채우기 투명도 10
Box_SetFill(box3,true,10);#채우기 투명도 10
Box_SetFill(box4,true,10);#채우기 투명도 10
}
}
Else
{
if sTime < 150000 Then
{
box_SetBegin(box1,var1,Var2,mav+pt2);
box_SetEnd(box1,sDate,sTime,mav+pt1);
box_SetBegin(box2,var1,Var2,mav+pt1);
box_SetEnd(box2,sDate,sTime,mav);
box_SetBegin(box3,var1,Var2,mav);
box_SetEnd(box3,sDate,sTime,mav-pt1);
box_SetBegin(box4,var1,Var2,mav-pt1);
box_SetEnd(box4,sDate,sTime,mav-pt2);
}
}
2023-12-20
790
글번호 175036
지표
답변완료
문의드립니다
a=c>c(1)*p1;
b=c>h(1);
d=c(1)<l(2);
조건=a && b && d;
고가=VALUEWHEN(1,조건,DAYHIGH());
저가=VALUEWHEN(1,조건,DAYLOW());
중심=(고가+저가)/2;
결과=crossdown(c,저가);
결과2=crossup(c,고가);
s=sum(1);
a_cnt=valuewhen(1,조건,s);
b_cnt=valuewhen(1,결과,s);
c_cnt=valuewhen(1,결과2,s);
결과3=a_cnt<b_cnt && b_cnt<c_cnt;
결과4=결과3(1) && 저가>c;
결과값=countsince(조건,결과4)==1;
결과값2=결과4 && 결과값;
시가=valuewhen(1,결과값2(1),o);
시가2=(시가*p2)*p2;
저가이탈=crossdown(l,시가2);
d_cnt=valuewhen(1,결과값2,s);
e_cnt=valuewhen(1,저가이탈,s);
조건2=d_cnt<e_cnt;
결과값3=countsince(결과값2,조건2)==1;
결과값4=조건2 && 결과값3
p1=1.03
p2=0.97
종목검색식으로 변환 부탁드립니다!
위 조건에 해당하는 봉을 화살표로 표시하는 지표식도 같이 부탁드려요!
추운데 감기조심하세요!
2023-12-19
878
글번호 175035
사용자 함수