답변완료
수식 부탁드립니다.
안녕하세요 수고에 감사드립니다.
아래의 조건을 모두 만족하는 종목검색식을 만들고 싶습니다.
1. macd(단기3,장기25,시그널10)가 시그널선 이상
macd(3,25,10)가 0선 이상
macd(3,25,10)시그널선이 0선 이상
maccd오실레이터(3,25,10)가 0선 이상
2. RSI(9)의 다중시그널(9)선이 E, D, T, F 입니다. 기간은 변수처리
RSI(9) > E >= D >= T >= F를 만족할 것.(정배열)
E는 R=sum(if(C-C(1)>0,C-C(1),0),기간)/sum(if(C-C(1)>0,C-C(1),C(1)-C),기간)*100;
//R=RSI(기간)
eavg(R,signal)
D는 R=sum(if(C-C(1)>0,C-C(1),0),기간)/sum(if(C-C(1)>0,C-C(1),C(1)-C),기간)*100;
//R=RSI(기간)
dema(R,signal)
T는 R=sum(if(C-C(1)>0,C-C(1),0),기간)/sum(if(C-C(1)>0,C-C(1),C(1)-C),기간)*100;
//R=RSI(기간)
tema(R,signal)
F는 R=sum(if(C-C(1)>0,C-C(1),0),기간)/sum(if(C-C(1)>0,C-C(1),C(1)-C),기간)*100;
//R=RSI(기간)
eavg(tema(R,signal),signal)
3. input : 횡보율(0.3),이평(5);
var : 상승개수(0) ,AA(0), DD(0), TT(0), FF(0);
#10지수이평~30지수이평 중 정봉대비 횡보율만큼 상승한 갯수
상승개수 = iff(Ema(c,10)>Ema(c,10)[1]*(1+횡보율/100),1,0)+
iff(Ema(c,11)>Ema(c,11)[1]*(1+횡보율/100),1,0)+
iff(Ema(c,12)>Ema(c,12)[1]*(1+횡보율/100),1,0)+
iff(Ema(c,13)>Ema(c,13)[1]*(1+횡보율/100),1,0)+
iff(Ema(c,14)>Ema(c,14)[1]*(1+횡보율/100),1,0)+
iff(Ema(c,15)>Ema(c,15)[1]*(1+횡보율/100),1,0)+
iff(Ema(c,16)>Ema(c,16)[1]*(1+횡보율/100),1,0)+
iff(Ema(c,17)>Ema(c,17)[1]*(1+횡보율/100),1,0)+
iff(Ema(c,18)>Ema(c,18)[1]*(1+횡보율/100),1,0)+
iff(Ema(c,19)>Ema(c,19)[1]*(1+횡보율/100),1,0)+
iff(Ema(c,20)>Ema(c,20)[1]*(1+횡보율/100),1,0)+
iff(Ema(c,21)>Ema(c,21)[1]*(1+횡보율/100),1,0)+
iff(ema(c,22)>Ema(c,22)[1]*(1+횡보율/100),1,0)+
iff(Ema(c,23)>Ema(c,23)[1]*(1+횡보율/100),1,0)+
iff(Ema(c,24)>Ema(c,24)[1]*(1+횡보율/100),1,0)+
iff(Ema(c,25)>Ema(c,25)[1]*(1+횡보율/100),1,0)+
iff(Ema(c,26)>Ema(c,26)[1]*(1+횡보율/100),1,0)+
iff(Ema(c,27)>Ema(c,27)[1]*(1+횡보율/100),1,0)+
iff(Ema(c,28)>Ema(c,28)[1]*(1+횡보율/100),1,0)+
iff(Ema(c,29)>Ema(c,29)[1]*(1+횡보율/100),1,0)+
iff(Ema(c,30)>Ema(c,30)[1]*(1+횡보율/100),1,0);
AA = 상승개수/21*100;
DD = Ema(Ema(AA,이평),이평);
TT = EmA(EmA(EmA(AA,이평),이평),이평);
FF =EmA(TT,이평);
if DD >= TT and TT >= FF Then 정배열 구하는 조건이 맞는지요?
Find(1);
위의 1번, 2번, 3번 조건을 동시에 모두 만족하는 종목검색식을 부탁드립니다.
늘 고맙습니다!!
2024-07-26
845
글번호 181893
종목검색
답변완료
수정부탁드립니다.
안녕하세요
더운 날씨에 저희의 수고를 덜어주셔서 감사드립니다.
아래 시스템과 지표의 수식을 다시한번 수정 부탁드립니다.
고맙습니다.
진입은 틱챠트에서 합니다
1.매수조건 (3개의 조건이 한개라도 안맞을시 신호 불가)
- 1시간봉 시가선을 지수5 이평이 상향크로스
- 15 분봉 시가선을 지수5 이평이 상향크로스
- 3 분봉에서는 오직 20삼각가중선을 지수 5 이평이 상향 크로스할때 매수
(분봉 시가선, 삼각가중, 지수이평은 변수)
2.매도조건 (3개의 조건이 한개라도 안맞을시 신호 불가)
- 1시간봉 시가선을 지수5 이평이 하향크로스
- 15 분봉 시가선을 지수5 이평이 하향크로스
- 3 분봉에서는 오직 20삼각가중선을 지수 5 이평이 하향 크로스할때 매도
(분봉 시가선, 삼각가중, 지수이평은 변수)
1
input : 타주기분1(3),타주기분2(60),타주기분3(240),전환선기간(9);
var : S1(0),D1(0),TM(0),cnt(0),hh(0),ll(0),전환선(0);
var : TF1(0),TF2(0),TF3(0),O2(0),O3(0),H2(0),L2(0);
Array : H1[100](0),L1[100](0);
if Bdate != Bdate[1] Then
{
S1 = TimeToMinutes(stime);
D1 = sdate;
}
if D1 > 0 then
{
if sdate == D1 Then
TM = TimeToMinutes(stime)-S1;
Else
TM = TimeToMinutes(stime)+1440-S1;
TF1 = TM%타주기분1;
if Bdate != Bdate[1] or
(Bdate == Bdate[1] and 타주기분1 > 1 and TF1 < TF1[1]) or
(Bdate == Bdate[1] and 타주기분1 > 1 and TM >= TM[1]+타주기분1) or
(Bdate == Bdate[1] and 타주기분1 == 1 and TM > TM[1]) Then
{
For cnt = 99 DownTo 1
{
H1[cnt] = H1[cnt-1];
L1[cnt] = L1[cnt-1];
}
H1[0] = H;
L1[0] = L;
}
if H1[0] > 0 and H > H1[0] Then
H1[0] = H;
if L1[0] > 0 and L < L1[0] Then
L1[0] = L;
TF2 = TM%타주기분2;
if Bdate != Bdate[1] or
(Bdate == Bdate[1] and 타주기분2 > 1 and TF2 < TF2[1]) or
(Bdate == Bdate[1] and 타주기분2 > 1 and TM >= TM[1]+타주기분1) or
(Bdate == Bdate[1] and 타주기분2 == 1 and TM > TM[1]) Then
{
O2 = O;
H2 = H;
L2 = L;
}
if H2 > 0 and H > H2 Then
H2 = H;
if L2 > 0 and L < L2 Then
L2 = L;
TF3 = TM%타주기분3;
if Bdate != Bdate[1] or
(Bdate == Bdate[1] and 타주기분3 > 1 and TF3 < TF3[1]) or
(Bdate == Bdate[1] and 타주기분3 > 1 and TM >= TM[1]+타주기분3) or
(Bdate == Bdate[1] and 타주기분3 == 1 and TM > TM[1]) Then
{
O3 = O;
}
if O2 > 0 and O3 > 0 and H1[전환선기간-1] > 0 and L1[전환선기간-1] > 0 Then
{
hh = 0;
ll = 0;
For cnt = 0 to 전환선기간-1
{
if hh == 0 or (hh > 0 and H1[cnt] > hh) Then
hh = H1[cnt];
if ll == 0 or (ll > 0 and L1[cnt] < ll) Then
ll = L1[cnt];
}
전환선 = (hh+ll)/2;
if C > O3 and
C > O2 and
C >= L2+(H2-L2)*0.25 and
C > 전환선 then
Buy();
if C < O3 and
C < O2 and
C <= H2-(H2-L2)*0.25 and
C < 전환선 then
Sell();
}
}
2
input : 타주기분1(3),타주기분2(60),타주기분3(240),전환선기간(9);
var : S1(0),D1(0),TM(0),cnt(0),hh(0),ll(0),전환선(0);
var : TF1(0),TF2(0),TF3(0),O2(0),O3(0),H2(0),L2(0),tx(0);
Array : H1[100](0),L1[100](0);
if Bdate != Bdate[1] Then
{
S1 = TimeToMinutes(stime);
D1 = sdate;
}
if D1 > 0 then
{
if sdate == D1 Then
TM = TimeToMinutes(stime)-S1;
Else
TM = TimeToMinutes(stime)+1440-S1;
TF1 = TM%타주기분1;
if Bdate != Bdate[1] or
(Bdate == Bdate[1] and 타주기분1 > 1 and TF1 < TF1[1]) or
(Bdate == Bdate[1] and 타주기분1 > 1 and TM >= TM[1]+타주기분1) or
(Bdate == Bdate[1] and 타주기분1 == 1 and TM > TM[1]) Then
{
For cnt = 99 DownTo 1
{
H1[cnt] = H1[cnt-1];
L1[cnt] = L1[cnt-1];
}
H1[0] = H;
L1[0] = L;
}
if H1[0] > 0 and H > H1[0] Then
H1[0] = H;
if L1[0] > 0 and L < L1[0] Then
L1[0] = L;
TF2 = TM%타주기분2;
if Bdate != Bdate[1] or
(Bdate == Bdate[1] and 타주기분2 > 1 and TF2 < TF2[1]) or
(Bdate == Bdate[1] and 타주기분2 > 1 and TM >= TM[1]+타주기분1) or
(Bdate == Bdate[1] and 타주기분2 == 1 and TM > TM[1]) Then
{
O2 = O;
H2 = H;
L2 = L;
}
if H2 > 0 and H > H2 Then
H2 = H;
if L2 > 0 and L < L2 Then
L2 = L;
TF3 = TM%타주기분3;
if Bdate != Bdate[1] or
(Bdate == Bdate[1] and 타주기분3 > 1 and TF3 < TF3[1]) or
(Bdate == Bdate[1] and 타주기분3 > 1 and TM >= TM[1]+타주기분3) or
(Bdate == Bdate[1] and 타주기분3 == 1 and TM > TM[1]) Then
{
O3 = O;
}
if O2 > 0 and O3 > 0 and H1[전환선기간-1] > 0 and L1[전환선기간-1] > 0 Then
{
hh = 0;
ll = 0;
For cnt = 0 to 전환선기간-1
{
if hh == 0 or (hh > 0 and H1[cnt] > hh) Then
hh = H1[cnt];
if ll == 0 or (ll > 0 and L1[cnt] < ll) Then
ll = L1[cnt];
}
전환선 = (hh+ll)/2;
if C > O3 and
C > O2 and
C >= L2+(H2-L2)*0.25 and
C > 전환선 then
{
tx = Text_New(sDate,sTime,H,"●");
Text_SetColor(tx,Red);
Text_SetStyle(tx,2,1);
Text_SetSize(tx,12);
}
if C < O3 and
C < O2 and
C <= H2-(H2-L2)*0.25 and
C < 전환선 then
{
tx = Text_New(sDate,sTime,H,"●");
Text_SetColor(tx,Blue);
Text_SetStyle(tx,2,1);
Text_SetSize(tx,12);
}
plot1(O2);
plot2(O3);
plot3(전환선);
plot4(L2+(H2-L2)*0.25);
plot5(H2-(H2-L2)*0.25);
}
}
2024-07-25
854
글번호 181889
시스템
답변완료
파라볼릭 2파
Input : af(0.02), maxAF(0.2);
var : T(0),B(0),S(0),tx(0),tx2(0),txx(0),HH(0),LL(0),box(0),B1(0),S1(0),B2(0),S2(0),H1(0),L1(0),H2(0),L2(0),TL(0);
var : Z(0),dd(0),tt(0);
var1 = CSar(af,maxAF);
plot1(var1, "CSAR",IFF(c>var1,Red,Blue));
if CrossUp(C,var1) Then
{
T = 1;
B = var1;
B1 = B[1];
B2 = B1[1];
HH = H;
H1 = HH[1];
H2 = H1[1];
dd = sDate;
tt = sTime;
if abs(S-LL) < 1 Then
Text_Delete(tx);
tx = Text_New(sDate,sTime,HH,NumToStr(abs(HH-B),2));
Text_SetColor(tx,Red);
Text_SetSize(tx,25);
Text_SetStyle(tx,1,1);
Text_SetBold(tx,1);
box = Box_New(sDate,sTime,B,NextBarSdate,NextBarStime,HH);
Condition1 = False;
Condition2 = False;
Condition5 = False;
}
if CrossDown(C,var1) Then
{
T = -1;
S = var1;
S1 = S[1];
S2 = S1[1];
LL = L;
L1 = LL[1];
L2 = L1[1];
dd = sDate;
tt = sTime;
if abs(B-HH) < 1 Then
Text_Delete(tx);
tx = Text_New(sDate,sTime,LL,NumToStr(abs(LL-S),2));
Text_SetColor(tx,Blue);
Text_SetSize(tx,25);
Text_SetStyle(tx,1,0);
Text_SetBold(tx,1);
box = Box_New(sDate,sTime,S,NextBarSdate,NextBarStime,LL);
Condition3 = False;
Condition4 = False;
Condition6 = False;
}
if T == 1 Then
{
if var1 < B Then
{
B = var1;
box_SetBegin(box,dd,tt,S);
}
if H > HH Then
HH = H;
Text_SetString(tx,NumToStr(abs(HH-B),2));
Text_SetLocation(tx,sDate,sTime,HH);
Box_SetEnd(box,NextBarSdate,NextBarStime,hh);
if HH < B+0.6 Then
{
Box_SetColor(box,Orange);
Box_SetFill(box,true,120);
}
Else if HH >= B+0.6 and HH < B+0.8 Then
{
Box_SetColor(box,Gray);
Box_SetFill(box,true,80);
}
Else if HH >= B+0.8 and HH < B+1.3 Then
{
Box_SetColor(box,Magenta);
Box_SetFill(box,true,60);
}
Else if HH >= B+1.3 and HH < B+1.9 Then
{
Box_SetColor(box,Gray);
Box_SetFill(box,true,60);
}
Else
{
Box_SetColor(box,Pink);
Box_SetFill(box,true,90);
}
if B1 > 0 and B > B1 and H > H1 and Condition1 == False Then
{
Condition1 = true;
TL_Delete(TL);
TL =TL_New(sDate,sTime,0,sDate,sTime,999);
TL_SetColor(TL,Lime);
TL_SetSize(TL,2);
}
if B1 > 0 and B > B1 and H > H1 and B1 > B2 and H1 > H2 and Condition2 == False Then
{
Condition2 = true;
txx = Text_New(sdate,sTime,HH+0.13,"●");
Text_SetStyle(txx,2,2);
Text_SetColor(txx,Green);
Text_SetSize(txx,15);
}
if Condition5 == False and HH >= B+0.8 Then
{
Condition5 = true;
Text_Delete(tx2);
tx2 = Text_New(sdate,sTime,LL-0.18,"■");
Text_SetStyle(tx2,2,2);
Text_SetColor(tx2,Blue);
Text_SetSize(tx2,40);
}
}
if T == -1 Then
{
if var1 > S Then
{
S = var1;
box_SetBegin(box,dd,tt,S);
}
if L < LL Then
LL = L;
Text_SetString(tx,NumToStr(abs(LL-S),2));
Text_SetLocation(tx,sDate,sTime,LL);
Box_SetEnd(box,NextBarSdate,NextBarStime,LL);
if LL > S-0.6 Then
{
Box_SetColor(box,Cyan);
Box_SetFill(box,true,150);
}
Else if LL <= S-0.6 and ll > S-0.8 Then
{
Box_SetColor(box,Yellow);
Box_SetFill(box,true,150);
}
Else if LL <= S-0.8 and ll > S-1.3 Then
{
Box_SetColor(box,Lime);
Box_SetFill(box,true,120);
}
Else if LL <= S-1.3 and ll > S-1.6 Then
{
Box_SetColor(box,Cyan);
Box_SetFill(box,true,90);
}
Else if LL <= S-1.6 and ll > S-1.9 Then
{
Box_SetColor(box,Blue);
Box_SetFill(box,true,30);
}
Else
{
Box_SetColor(box,Yellow);
Box_SetFill(box,true,120);
}
if S1 > 0 and S < S1 and L < L1 and Condition3 == False Then
{
Condition3 = true;
TL_Delete(TL);
TL =TL_New(sDate,sTime,0,sDate,sTime,999);
TL_SetColor(TL,Gold);
TL_SetSize(TL,3);
}
if S1 > 0 and S < S1 and L < L1 and S1 < S2 and L1 < L2 and Condition4 == False Then
{
Condition4 = true;
txx = Text_New(sdate,sTime,LL-0.13,"●");
Text_SetStyle(txx,2,2);
Text_SetColor(txx,Magenta);
Text_SetSize(txx,15);
}
if Condition6 == False and LL <= S-0.8 Then
{
Condition6= true;
Text_Delete(tx2);
tx2 = Text_New(sdate,sTime,HH+0.18,"■");
Text_SetStyle(tx2,2,2);
Text_SetColor(tx2,Magenta);
Text_SetSize(tx2,40);
}
}
직전 저점이 깨지면 2파 세로선 생기는 조건을,
깨진후 2파 크기가 0.8 이상이 되면 세로선 표시로 수정.
직저 깨지기 전에 크기가 0.8 이상이면 깨질 때 세로선.
상승은 반대. 감사합니다.
2024-07-25
824
글번호 181856
지표