답변완료
시스템 수식으로 바꿔주세요
input : P(9);
var : RSIV(0),T(0),TL1(0),TL2(0);
var : HIV(0),HIV1(0),HPV(0),HPV1(0);
var : LIV(0),LIV1(0),LPV(0),LPV1(0);
RSIv = RSI(P);
Plot1(RSIV, "RSI");
PlotBaseLine1(30, "기준선 30");
PlotBaseLine2(70, "기준선 70");
if RSIV > RSIV[1] Then
T = 1;
if rSIV < RSIV[1] Then
T = -1;
if T == 1 and T != T[1] Then
{
HIV = RSIv;
HIV1 = HIV[1];
HPV = H;
HPV1 = HPV[1];
if LIV > LIV1 and LPV < LPV1 and LPV1 > 0 Then
{
TL1 = TL_New(sDate,sTime,0,sDate,sTime,99999999);
TL2 = TL_New_Self(sDate,sTime,0,sDate,sTime,99999999);
TL_SetColor(TL1,RED);
TL_SetColor(TL2,RED);
}
}
if T == -1 and T != T[1] Then
{
LIV = RSIv;
LIV1 = LIV[1];
LPV = L;
LPV1 = LPV[1];
if HIV < HIV1 and HPV > HPV1 and HPV1 > 0 Then
{
TL1 = TL_New(sDate,sTime,0,sDate,sTime,99999999);
TL2 = TL_New_Self(sDate,sTime,0,sDate,sTime,99999999);
TL_SetColor(TL1,BLUE);
TL_SetColor(TL2,BLUE);
}
}
#RSI 상승구간 RSI최고와 가격최고 계산
if T == 1 Then
{
if RSIv > HIV Then
{
HIV = RSIv;
}
if H > HPV Then
{
RSIv = H;
}
}
#RSI 하락구간 RSI최저와 가격최저 계산
if T == -1 Then
{
if RSIv < LIV Then
{
LIV = RSIv;
}
if L < LPV Then
{
LPV = L;
}
}
기준선 70을 하향 돌파할때 매도
기준선 30을 상향 돌파할때 매수
2025-02-09
922
글번호 187958
시스템
답변완료
추세선 직전고저점
input : Period(130);
Var:j(0),T(0),tx(0),tx1(0),box(0),TL(0),upt(0),dnt(0);
Var: date11(0),date12(0),time11(0),time12(0),
date21(0),date22(0),time21(0),time22(0),
date31(0),date32(0),time31(0),time32(0);
Array:HiVal[20](0),LoVal[20](0),HiBar[20](0),LoBar[20](0);
For j = 0 To 19
{
HiBar[j] = HiBar[j] + 1;
LoBar[j] = LoBar[j] + 1;
}
if crossup(C,highest(H,Period)[1]) Then
T = 1;
if CrossDown(C,Lowest(L,Period)[1]) Then
T = -1;
If T == -1 Then
{
If T[1] != -1 Then
{
For j = 18 DownTo 0
{
LoVal[j+1] = LoVal[j];
LoBar[j+1] = LoBar[j];
}
LoVal[0] = L;
LoBar[0] = 0;
date11 = date[HiBar[0]];
time11 = stime[HiBar[0]];
Value11 = HiVal[0];
date12 = date[LoBar[0]];
time12 = stime[LoBar[0]];
Value12 = LoVal[0];
date21 = date[HiBar[0]];
time21 = stime[HiBar[0]];
date22 = date[0];
time22 = stime[0];
Text_Delete(dnt);
var1 = loval[0]-loval[1];
dnt = Text_New(date12,time12,value12,NewLine+NumToStr(abs(var1/PriceScale),0)+" "+NewLine);
Text_SetColor(dnt,iff(var1>0,Magenta,Blue));
Text_SetStyle(dnt,1,2);
Text_SetSize(dnt,35);
Text_SetBold(dnt,1);
Condition1 = False;
box = Box_New(date11,time11,Value11,date12,time12,Value12);
if abs(value12[1]-value11[1]) < 0.8 Then
Text_Delete(tx);
tx = Text_New(sDate,stime,value12,NumToStr(value11-value12,2));
Text_SetColor(Tx,Blue);
Text_SetStyle(tx,1,0);
Text_SetSize(tx,25);
Text_SetBold(tx,1);
}
If LoVal[0] > L Then
{
LoVal[0] = L;
LoBar[0] = 0;
date12 = date[LoBar[0]];
time12 = stime[LoBar[0]];
Value12 = LoVal[0];
date22 = date[0];
time22 = stime[0];
var1 = loval[0]-loval[1];
Text_SetLocation(dnt,date12,time12,value12);
Text_SetString(dnt,NewLine+NumToStr(abs(var1/PriceScale),0)+" ");
Text_SetColor(dnt,iff(var1>0,Magenta,Blue));
Text_SetStyle(dnt,1,2);
Text_SetSize(dnt,35);
Text_SetBold(dnt,1);
Box_SetEnd(box,date12,time12,Value12);
Text_SetString(tx,NumToStr(value11-value12,2));
Text_SetLocation(tx,sDate,sTime,value12);
}
if value12 > value11-0.5 Then
{
Box_SetColor(box,Cyan);
Box_SetFill(box,true,90);
}
else if value12 <= value11-0.5 and value12 > value11-0.7 Then
{
Box_SetColor(box,Blue);
Box_SetFill(box,true,50);
}
else if value12 <= value11-0.7 and value12 > value11-0.8 Then
{
Box_SetColor(box,Yellow);
Box_SetFill(box,true,150);
}
else if value12 <= value11-0.8 and value12 > value11-1.2 Then
{
Box_SetColor(box,Lime);
Box_SetFill(box,true,80);
}
else if value12 <= value11-1.2 and value12 > value11-1.6 Then
{
Box_SetColor(box,Cyan);
Box_SetFill(box,true,80);
}
else if value12 <= value11-1.6 and value12 > value11-1.9 Then
{
Box_SetColor(box,Blue);
Box_SetFill(box,true,30);
}
else
{
Box_SetColor(box,Yellow);
Box_SetFill(box,true,80);
}
if Condition1 == False and hival[0] < hival[1] and hival[1] < hival[2] and Loval[0] < loval[1] and Loval[1] < loval[2] Then
{
Condition1 = true;
tx1 = Text_New(sDate,sTime,L+0.6,"●");
Text_SetStyle(tx1,2,2);
Text_SetColor(tx1,Red);
Text_SetSize(tx1,40);
Sell();
}
}
If T == 1 Then
{
If T[1] != 1 Then
{
For j = 18 DownTo 0
{
HiVal[j+1] = HiVal[j];
HiBar[j+1] = HiBar[j];
}
HiVal[0] = H;
HiBar[0] = 0;
date11 = date[LoBar[0]];
time11 = stime[LoBar[0]];
Value11 = LoVal[0];
date12 = date[HiBar[0]];
time12 = stime[HiBar[0]];
Value12 = HiVal[0];
date31 = date[LoBar[0]];
time31 = stime[LoBar[0]];
date32 = date[0];
time32 = stime[0];
Text_Delete(upt);
var1 = hival[0]-hival[1];
upt = Text_New(date12,time12,value12,NumToStr(abs(var1/PriceScale),0)+" "+NewLine);
Text_SetColor(upt,iff(var1>0,Magenta,Blue));
Text_SetStyle(upt,1,2);
Text_SetSize(upt,35);
Text_SetBold(upt,1);
Condition2 = False;
box = Box_New(date11,time11,Value11,date12,time12,Value12);
if abs(value12[1]-value11[1]) < 0.8 Then
Text_Delete(tx);
tx = Text_New(sDate,stime,value12,NumToStr(value12-value11,2));
Text_SetColor(Tx,Red);
Text_SetStyle(tx,1,1);
Text_SetSize(tx,25);
Text_SetBold(tx,1);
}
If HiVal[0] < H Then
{
HiVal[0] = H;
HiBar[0] = 0;
date12 = date[HiBar[0]];
time12 = stime[HiBar[0]];
Value12 = HiVal[0];
date32 = date[0];
time32 = stime[0];
var1 = hival[0]-hival[1];
Text_SetLocation(upt,date12,time12,value12);
Text_SetString(upt,NumToStr(abs(var1/PriceScale),0)+" "+NewLine);
Text_SetColor(upt,iff(var1>0,Magenta,Blue));
Text_SetStyle(upt,1,2);
Text_SetSize(upt,35);
Text_SetBold(upt,1);
Box_SetEnd(box,date12,time12,Value12);
Text_SetString(tx,NumToStr(value12-value11,2));
Text_SetLocation(tx,sDate,sTime,value12);
}
if Value12 >= value11+1.9 Then
{
Box_SetColor(box,Pink);
Box_SetFill(box,true,70);
}
else if value12 >= value11+1.2 and value12 < value11+1.9 Then
{
Box_SetColor(box,Gray);
Box_SetFill(box,true,60);
}
else if value12 >= value11+0.8 and value12 < value11+1.2 Then
{
Box_SetColor(box,Magenta);
Box_SetFill(box,true,40);
}
else if value12 >= value11+0.5 and value12 < value11+0.8 Then
{
Box_SetColor(box,Orange);
Box_SetFill(box,true,100);
}
Else
{
Box_SetColor(box,Gold);
Box_SetFill(box,true,150);
}
if Condition2 == False and loval[0] > loval[1] and loval[1] > loval[2] and hival[0] > hival[1] and hival[1] > hival[2] Then
{
Condition2 = true;
tx1 = Text_New(sDate,sTime,H-0.6,"●");
Text_SetStyle(tx1,2,2);
Text_SetColor(tx1,Blue);
Text_SetSize(tx1,40);
Sell();
}
}
if MarketPosition == 1 and BarsSinceEntry == 1 Then ExitLong();
if MarketPosition == -1 and BarsSinceEntry == 1 Then ExitShort();
a.하락하는 주가가 직전 하락추세선의 저점에서 +2틱에서 -3틱 사이에 있으면 세로선 표시.
벗어나거나 양전환되면 삭제. 일시적으로 벗어났다 들어오면 다시 표시.
상승하는 주가가 직전 상승추세선의 고점에서 -2틱에서 +3틱 사이에 있으면 세로선 표시.
벗어나거나 음전환되면 삭제. (쌍바닥 쌍봉 위치 표시)
b.직전 고저점과의 차이를 틱수로 표시하는 부분을, (abs(var1/PriceScale),0)
단순 수치로 수정. (5틱을 0.25로). 감사합니다.
2025-02-09
504
글번호 187956
시스템