예스스탁
예스스탁 답변
2025-02-26 08:47:01
안녕하세요
예스스탁입니다.
Input : PEriod(10), signal(9),굵기(3);
Var : R(0) , Rsig(0),T(0);
var : HIV(0),HID(0),HIT(0),HIV1(0),HID1(0),HIT1(0),HI(0),HI1(0);
var : HPV(0),HPD(0),HPT(0),HPV1(0),HPD1(0),HPT1(0);
var : LIV(0),LID(0),LIT(0),LIV1(0),LID1(0),LIT1(0),LI(0),LI1(0);
var : LPV(0),LPD(0),LPT(0),LPV1(0),LPD1(0),LPT1(0);
var : TL1(0),TL2(0),TX1(0),TX2(0);
var : TL3(0),TL4(0),TL5(0),i1(0),i2(0);
R = RSI(Period);
Rsig = ₩ma(R,signal);
if crossup(R,Rsig) Then
{
T = 1;
HIV = R;
HID = sdate;
HIT = stime;
HI = Index;
HIV1 = HIV[1];
HID1 = HID[1];
HIT1 = HIT[1];
HPV = H;
HPD = sdate;
HPT = stime;
HI1 = HI[1];
HPV1 = HPV[1];
HPD1 = HPD[1];
HPT1 = HPT[1];
Condition1 = false;
}
if CrossDown(R,Rsig) Then
{
T = -1;
LIV = R;
LID = sdate;
LIT = stime;
LI = Index;
LIV1 = LIV[1];
LID1 = LID[1];
LIT1 = LIT[1];
LPV = L;
LPD = sdate;
LPT = stime;
LI1 = LI[1];
LPV1 = LPV[1];
LPD1 = LPD[1];
LPT1 = LPT[1];
Condition2 = false;
}
if T == 1 Then
{
if R > HIV Then
{
HIV = R;
HID = sdate;
HIT = stime;
}
if H > HPV Then
{
HPV = H;
HPD = sdate;
HPT = stime;
}
if Condition1 == false and HPV1 > 0 and HPV > HPV1 and HIV < HIV1 and HI <= HI1+30 Then
{
TL1 = TL_New(HPD1,HPT1,HPV1,HPD,HPT,HPV);
TL2 = TL_New_Self(HID1,HIT1,HIV1,HID,HIT,HIV);
TL_SetColor(TL1,cyan);
TL_SetColor(TL2,cyan);
TL_SetSize(TL1,굵기);
TL_SetSize(TL2,굵기);
tx1 = Text_New(HPD1,HPT1,HPV1,NumToStr(HPV1,2));
tx2 = Text_New(HPD,HPT,HPV,NumToStr(HPV,2));
Text_SetStyle(tx1,2,1);
Text_SetStyle(tx2,2,1);
TL3 = TL_New(HPD1,HPT1,HPV1,sdate,stime,HPV1);
TL4 = TL_New(HPD1,HPT1,HPV,HPD,HPT,HPV);
TL5 = TL_New(HPD1,HPT1,(HPV1+HPV)/2,HPD,HPT,(HPV1+HPV)/2);
Condition1 = true;
}
if Condition1 == true then
{
if HPV > HPV1 and HIV < HIV1 then
{
TL_SetEnd(TL1,HPD,HPT,HPV);
TL_SetEnd(TL2,HID,HIT,HIV);
Text_SetLocation(tx2,HPD,HPT,HPV);
Text_SetString(tx2,NumToStr(HPV,2));
i1 = index;
}
Else
{
TL_Delete(TL1);
TL_Delete(TL2);
TL_Delete(TL3);
TL_Delete(TL4);
TL_Delete(TL5);
Text_Delete(tx1);
Text_Delete(tx2);
}
}
}
if T == -1 Then
{
if R < LIV Then
{
LIV = R;
LID = sdate;
LIT = stime;
}
if L < LPV Then
{
LPV = L;
LPD = sdate;
LPT = stime;
}
if Condition2 == false and LPV1 > 0 and LPV < LPV1 and LIV > LIV1 and LI <= LI1+30 Then
{
TL1 = TL_New(LPD1,LPT1,LPV1,LPD,LPT,LPV);
TL2 = TL_New_Self(LID1,LIT1,LIV1,LID,LIT,LIV);
TL_SetColor(TL1,RED);
TL_SetColor(TL2,RED);
TL_SetSize(TL1,굵기);
TL_SetSize(TL2,굵기);
tx1 = Text_New(LPD1,LPT1,LPV1,NumToStr(LPV1,2));
tx2 = Text_New(LPD,LPT,LPV,NumToStr(LPV,2));
Text_SetStyle(tx1,2,1);
Text_SetStyle(tx2,2,1);
TL3 = TL_New(LPD1,LPT1,LPV1,sdate,stime,LPV1);
TL4 = TL_New(LPD1,LPT1,LPV,LPD,LPT,LPV);
TL5 = TL_New(LPD1,LPT1,(LPV1+LPV)/2,LPD,LPT,(LPV1+LPV)/2);
Condition2 = true;
}
if Condition2 == true then
{
if LPV < LPV1 and LIV > LIV1 then
{
TL_SetEnd(TL1,LPD,LPT,LPV);
TL_SetEnd(TL2,LID,LIT,LIV);
Text_SetLocation(tx2,LPD,LPT,LPV);
Text_SetString(tx2,NumToStr(LPV,2));
i2 = index;
}
Else
{
TL_Delete(TL1);
TL_Delete(TL2);
TL_Delete(TL3);
TL_Delete(TL4);
TL_Delete(TL5);
Text_Delete(tx1);
Text_Delete(tx2);
}
}
}
plot1(R);
plot2(Rsig);
Plot3(0,"0");
if index > i1 and index <= i1+3 Then
{
TL_SetEnd(tl3,sdate,stime,TL_GetValue(tl3,sdate,stime));
TL_SetEnd(tl4,sdate,stime,TL_GetValue(tl4,sdate,stime));
TL_SetEnd(tl5,sdate,stime,TL_GetValue(tl5,sdate,stime));
}
if index > i2 and index <= i2+3 Then
{
TL_SetEnd(tl3,sdate,stime,TL_GetValue(tl3,sdate,stime));
TL_SetEnd(tl4,sdate,stime,TL_GetValue(tl4,sdate,stime));
TL_SetEnd(tl5,sdate,stime,TL_GetValue(tl5,sdate,stime));
}
즐거운 하루되세요
> 레전드 님이 쓴 글입니다.
> 제목 : 문의
> 이식을 RSi식으로 변환 부탁드립니다
Input : short(12), long(26), signal(9),굵기(3);
Var : MACDV(0) , MACDS(0),T(0);
var : HIV(0),HID(0),HIT(0),HIV1(0),HID1(0),HIT1(0),HI(0),HI1(0);
var : HPV(0),HPD(0),HPT(0),HPV1(0),HPD1(0),HPT1(0);
var : LIV(0),LID(0),LIT(0),LIV1(0),LID1(0),LIT1(0),LI(0),LI1(0);
var : LPV(0),LPD(0),LPT(0),LPV1(0),LPD1(0),LPT1(0);
var : TL1(0),TL2(0),TX1(0),TX2(0);
var : TL3(0),TL4(0),TL5(0),i1(0),i2(0);
MACDV = MACD(short, long);
MACDS = ema(MACDV,signal);
if crossup(MACDV,MACDS) Then
{
T = 1;
HIV = MACDV;
HID = sdate;
HIT = stime;
HI = Index;
HIV1 = HIV[1];
HID1 = HID[1];
HIT1 = HIT[1];
HPV = H;
HPD = sdate;
HPT = stime;
HI1 = HI[1];
HPV1 = HPV[1];
HPD1 = HPD[1];
HPT1 = HPT[1];
Condition1 = false;
}
if CrossDown(MACDV,MACDS) Then
{
T = -1;
LIV = MACDV;
LID = sdate;
LIT = stime;
LI = Index;
LIV1 = LIV[1];
LID1 = LID[1];
LIT1 = LIT[1];
LPV = L;
LPD = sdate;
LPT = stime;
LI1 = LI[1];
LPV1 = LPV[1];
LPD1 = LPD[1];
LPT1 = LPT[1];
Condition2 = false;
}
if T == 1 Then
{
if MACDV > HIV Then
{
HIV = MACDV;
HID = sdate;
HIT = stime;
}
if H > HPV Then
{
HPV = H;
HPD = sdate;
HPT = stime;
}
if Condition1 == false and HPV1 > 0 and HPV > HPV1 and HIV < HIV1 and HI <= HI1+30 Then
{
TL1 = TL_New(HPD1,HPT1,HPV1,HPD,HPT,HPV);
TL2 = TL_New_Self(HID1,HIT1,HIV1,HID,HIT,HIV);
TL_SetColor(TL1,cyan);
TL_SetColor(TL2,cyan);
TL_SetSize(TL1,굵기);
TL_SetSize(TL2,굵기);
tx1 = Text_New(HPD1,HPT1,HPV1,NumToStr(HPV1,2));
tx2 = Text_New(HPD,HPT,HPV,NumToStr(HPV,2));
Text_SetStyle(tx1,2,1);
Text_SetStyle(tx2,2,1);
TL3 = TL_New(HPD1,HPT1,HPV1,sdate,stime,HPV1);
TL4 = TL_New(HPD1,HPT1,HPV,HPD,HPT,HPV);
TL5 = TL_New(HPD1,HPT1,(HPV1+HPV)/2,HPD,HPT,(HPV1+HPV)/2);
Condition1 = true;
}
if Condition1 == true then
{
if HPV > HPV1 and HIV < HIV1 then
{
TL_SetEnd(TL1,HPD,HPT,HPV);
TL_SetEnd(TL2,HID,HIT,HIV);
Text_SetLocation(tx2,HPD,HPT,HPV);
Text_SetString(tx2,NumToStr(HPV,2));
i1 = index;
}
Else
{
TL_Delete(TL1);
TL_Delete(TL2);
TL_Delete(TL3);
TL_Delete(TL4);
TL_Delete(TL5);
Text_Delete(tx1);
Text_Delete(tx2);
}
}
}
if T == -1 Then
{
if MACDV < LIV Then
{
LIV = MACDV;
LID = sdate;
LIT = stime;
}
if L < LPV Then
{
LPV = L;
LPD = sdate;
LPT = stime;
}
if Condition2 == false and LPV1 > 0 and LPV < LPV1 and LIV > LIV1 and LI <= LI1+30 Then
{
TL1 = TL_New(LPD1,LPT1,LPV1,LPD,LPT,LPV);
TL2 = TL_New_Self(LID1,LIT1,LIV1,LID,LIT,LIV);
TL_SetColor(TL1,RED);
TL_SetColor(TL2,RED);
TL_SetSize(TL1,굵기);
TL_SetSize(TL2,굵기);
tx1 = Text_New(LPD1,LPT1,LPV1,NumToStr(LPV1,2));
tx2 = Text_New(LPD,LPT,LPV,NumToStr(LPV,2));
Text_SetStyle(tx1,2,1);
Text_SetStyle(tx2,2,1);
TL3 = TL_New(LPD1,LPT1,LPV1,sdate,stime,LPV1);
TL4 = TL_New(LPD1,LPT1,LPV,LPD,LPT,LPV);
TL5 = TL_New(LPD1,LPT1,(LPV1+LPV)/2,LPD,LPT,(LPV1+LPV)/2);
Condition2 = true;
}
if Condition2 == true then
{
if LPV < LPV1 and LIV > LIV1 then
{
TL_SetEnd(TL1,LPD,LPT,LPV);
TL_SetEnd(TL2,LID,LIT,LIV);
Text_SetLocation(tx2,LPD,LPT,LPV);
Text_SetString(tx2,NumToStr(LPV,2));
i2 = index;
}
Else
{
TL_Delete(TL1);
TL_Delete(TL2);
TL_Delete(TL3);
TL_Delete(TL4);
TL_Delete(TL5);
Text_Delete(tx1);
Text_Delete(tx2);
}
}
}
plot1(MACDV);
plot2(MACDS);
if index > i1 and index <= i1+3 Then
{
TL_SetEnd(tl3,sdate,stime,TL_GetValue(tl3,sdate,stime));
TL_SetEnd(tl4,sdate,stime,TL_GetValue(tl4,sdate,stime));
TL_SetEnd(tl5,sdate,stime,TL_GetValue(tl5,sdate,stime));
}
if index > i2 and index <= i2+3 Then
{
TL_SetEnd(tl3,sdate,stime,TL_GetValue(tl3,sdate,stime));
TL_SetEnd(tl4,sdate,stime,TL_GetValue(tl4,sdate,stime));
TL_SetEnd(tl5,sdate,stime,TL_GetValue(tl5,sdate,stime));
}
Plot3(0,"0");