커뮤니티
안녕하세요. 문의드립니다.
2019-03-29 09:46:02
314
글번호 127470
안녕하세요. 문의 드립니다.
아래 식에 추가하고 싶은 사항이 있어서 부탁드립니다.
파동의 고가와 저가가 표현되는 식입니다.
1. 직전 파동이 완성되면 해당 파동의 고가와 저가의 피보나치 비율을 추가하여 38.2% 자리와 50% 61.8% 자리를 직전파동의 고저가 확정되면 우측에 표현하고 싶습니다. 안되는 기능이면 패스해도 됩니다.
2.
가격이 120 이평 아래에 위치할 경우 올라올때 38.2% 자리를 터치하면 매도신호가 발생.
매도 보유중에 50% 까지 올라오면 손절(주석으로 부탁드립니다.)
매도 보유중에 20틱 이상 수익 발생시 20틱 수익시에는 진입가로 다시 올라오면 청산/ 20틱 이상 수익 발생시에는 수익 틱만큼 익절가격이 올라가야 합니다.
ex) 20틱 수익 TS익절=0 / 최고수익틱 30틱 TS익절=10틱
가격이 120 이평 위에 위치할 경우 내려올때 38.2% 자리를 터치하면 매수신호가 발생.
매수 이후 50% 까지 내려오면 손절.
포지션이 있을경우는 신규진입하지 않아야 합니다. 포지션이 청산되고 없을때 다음 조건만족시 진입식 부탁드립니다.
늘 수고많으시고 감사드립니다.
Input:length(12);
Var:j(0),lastHiVal(0),lastLoVal(0),sBar(0),eBar(0),TL1(0),TL2(0),TL3(0),Text1(0),처리구분(""),TL_Val1(0),TL_Val2(0),color(0),T(0);
Array:고점[10,2](0),저점[10,2](0);
처리구분 = "";
If Highest(H,length) == H and lastHiVal <> H and Lowest(L,length) == L and lastLoVal <> L Then
{
If 저점[1,1] > L Then 처리구분 = "저점처리";
If 고점[1,1] < H Then 처리구분 = "고점처리";
}
Else If Highest(H,length) == H and lastHiVal <> H Then 처리구분 = "고점처리";
Else If Lowest(L,length) == L and lastLoVal <> L Then 처리구분 = "저점처리";
If 처리구분 == "고점처리" Then
{
T = 1;
lastHiVal = H;
If 고점[1,2] < 저점[1,2] Then
{
For j = 10 DownTo 2
{
고점[j,1] = 고점[j-1,1];
고점[j,2] = 고점[j-1,2];
}
}
If 고점[1,2] < 저점[1,2] or 고점[1,1] < H Then
{
고점[1,1] = H;
고점[1,2] = Index;
sBar = Index - 저점[1,2];
eBar = 0;
If TL_GetBeginDate(TL1) == sDate[sBar] and TL_GetBeginTime(TL1) == sTime[sBar] Then
{
TL_Delete(TL1);
Text_Delete(Text1);
If 고점[3,1][1] < 고점[2,1][1] and 고점[2,1][1] > 고점[1,1][1] and 저점[2,1][1] < 저점[1,1][1] Then
TL_Delete(TL2);
}
if 고점[1,1] > 고점[2,1] or 고점[2,1] == 0 Then
{
color = MAGENTA;
#buy("b");
}
TL1 = TL_New(sDate[sBar],sTime[sBar],저점[1,1],sDate[eBar],sTime[eBar],고점[1,1]);
TL_SetColor(TL1,color);
Text1 = Text_New(sDate[eBar],sTime[eBar],고점[1,1],NumToStr(abs(고점[1,1]-저점[1,1])/PriceScale,0)+NewLine+NumToStr(고점[1,1],2));
Text_SetStyle(Text1, 2, 1);
If 고점[3,1] < 고점[2,1] and 고점[2,1] > 고점[1,1] and 저점[2,1] < 저점[1,1] Then
{
sBar = Index - 저점[2,2];
eBar = Index - 저점[1,2];
}
}
}
If 처리구분 == "저점처리" Then
{
T = -1;
lastLoVal = L;
If 저점[1,2] < 고점[1,2] Then
{
For j = 10 DownTo 2
{
저점[j,1] = 저점[j-1,1];
저점[j,2] = 저점[j-1,2];
}
}
If 저점[1,2] < 고점[1,2] or 저점[1,1] > L Then
{
저점[1,1] = L;
저점[1,2] = Index;
sBar = Index - 고점[1,2];
eBar = 0;
If TL_GetBeginDate(TL1) == sDate[sBar] and TL_GetBeginTime(TL1) == sTime[sBar] Then
{
TL_Delete(TL1);
Text_Delete(Text1);
If 저점[2,1][1] < 저점[1,1][1] and 저점[2,1][1] < 저점[3,1][1] and 고점[2,1][1] > 고점[1,1][1] Then
TL_Delete(TL3);
}
if 저점[1,1] < 저점[2,1] or 저점[2,1] == 0 Then
{
color = CYAN;
#sell("s");
}
TL1 = TL_New(sDate[sBar],sTime[sBar],고점[1,1],sDate[eBar],sTime[eBar],저점[1,1]);
TL_SetColor(TL1,color);
Text1 = Text_New(sDate[eBar],sTime[eBar],저점[1,1],NumToStr(abs(고점[1,1]-저점[1,1])/PriceScale,0)+NewLine+NumToStr(저점[1,1],2));
Text_SetStyle(Text1, 2, 0);
If 저점[2,1] < 저점[1,1] and 저점[2,1] < 저점[3,1] and 고점[2,1] > 고점[1,1] Then
{
sBar = Index - 고점[2,2];
eBar = Index - 고점[1,2];
}
}
}
TL_SetSize(TL1,3);
if color != color[1] Then
{
var1 = 0;
var2 = var1[1];
var3 = var2[1];
if T == -1 and var2 == 1 and var3 >= 3 Then
sell("s1");
if T == 1 and var2 == 1 and var3 >= 3 Then
buy("b1");
}
if T != T[1] Then
{
var1 = var1+1;
}
if MarketPosition == 1 and t == -1 Then
{
ExitLong("bx",AtStop,저점[2,1]-PriceScale*1);
}
if MarketPosition == -1 and t == 1 Then
ExitShort("sx",AtStop,고점[2,1]+PriceScale*1);
답변 1
예스스탁 예스스탁 답변
2019-03-29 15:11:31
안녕하세요
예스스탁입니다.
1
Input:length(12);
Var:j(0),lastHiVal(0),lastLoVal(0),sBar(0),eBar(0),TL1(0),TL2(0),TL3(0),Text1(0),처리구분(""),TL_Val1(0),TL_Val2(0),color(0),T(0);
Array:고점[10,2](0),저점[10,2](0);
var : TL11(0),TL12(0),TL13(0);
처리구분 = "";
If Highest(H,length) == H and lastHiVal <> H and Lowest(L,length) == L and lastLoVal <> L Then
{
If 저점[1,1] > L Then 처리구분 = "저점처리";
If 고점[1,1] < H Then 처리구분 = "고점처리";
}
Else If Highest(H,length) == H and lastHiVal <> H Then 처리구분 = "고점처리";
Else If Lowest(L,length) == L and lastLoVal <> L Then 처리구분 = "저점처리";
If 처리구분 == "고점처리" Then
{
T = 1;
lastHiVal = H;
If 고점[1,2] < 저점[1,2] Then
{
For j = 10 DownTo 2
{
고점[j,1] = 고점[j-1,1];
고점[j,2] = 고점[j-1,2];
}
}
If 고점[1,2] < 저점[1,2] or 고점[1,1] < H Then
{
고점[1,1] = H;
고점[1,2] = Index;
sBar = Index - 저점[1,2];
eBar = 0;
If TL_GetBeginDate(TL1) == sDate[sBar] and TL_GetBeginTime(TL1) == sTime[sBar] Then
{
TL_Delete(TL1);
Text_Delete(Text1);
If 고점[3,1][1] < 고점[2,1][1] and 고점[2,1][1] > 고점[1,1][1] and 저점[2,1][1] < 저점[1,1][1] Then
TL_Delete(TL2);
}
if 고점[1,1] > 고점[2,1] or 고점[2,1] == 0 Then
{
color = MAGENTA;
#buy("b");
}
TL1 = TL_New(sDate[sBar],sTime[sBar],저점[1,1],sDate[eBar],sTime[eBar],고점[1,1]);
TL_SetColor(TL1,color);
Text1 = Text_New(sDate[eBar],sTime[eBar],고점[1,1],NumToStr(abs(고점[1,1]-저점[1,1])/PriceScale,0)+NewLine+NumToStr(고점[1,1],2));
Text_SetStyle(Text1, 2, 1);
If 고점[3,1] < 고점[2,1] and 고점[2,1] > 고점[1,1] and 저점[2,1] < 저점[1,1] Then
{
sBar = Index - 저점[2,2];
eBar = Index - 저점[1,2];
}
}
}
If 처리구분 == "저점처리" Then
{
T = -1;
lastLoVal = L;
If 저점[1,2] < 고점[1,2] Then
{
For j = 10 DownTo 2
{
저점[j,1] = 저점[j-1,1];
저점[j,2] = 저점[j-1,2];
}
}
If 저점[1,2] < 고점[1,2] or 저점[1,1] > L Then
{
저점[1,1] = L;
저점[1,2] = Index;
sBar = Index - 고점[1,2];
eBar = 0;
If TL_GetBeginDate(TL1) == sDate[sBar] and TL_GetBeginTime(TL1) == sTime[sBar] Then
{
TL_Delete(TL1);
Text_Delete(Text1);
If 저점[2,1][1] < 저점[1,1][1] and 저점[2,1][1] < 저점[3,1][1] and 고점[2,1][1] > 고점[1,1][1] Then
TL_Delete(TL3);
}
if 저점[1,1] < 저점[2,1] or 저점[2,1] == 0 Then
{
color = CYAN;
#sell("s");
}
TL1 = TL_New(sDate[sBar],sTime[sBar],고점[1,1],sDate[eBar],sTime[eBar],저점[1,1]);
TL_SetColor(TL1,color);
Text1 = Text_New(sDate[eBar],sTime[eBar],저점[1,1],NumToStr(abs(고점[1,1]-저점[1,1])/PriceScale,0)+NewLine+NumToStr(저점[1,1],2));
Text_SetStyle(Text1, 2, 0);
If 저점[2,1] < 저점[1,1] and 저점[2,1] < 저점[3,1] and 고점[2,1] > 고점[1,1] Then
{
sBar = Index - 고점[2,2];
eBar = Index - 고점[1,2];
}
}
}
TL_SetSize(TL1,3);
if color != color[1] Then
{
var1 = 0;
var2 = var1[1];
var3 = var2[1];
if T == -1 and var2 == 1 and var3 >= 3 Then
sell("s1");
if T == 1 and var2 == 1 and var3 >= 3 Then
buy("b1");
}
if T != T[1] Then
{
var1 = var1+1;
if T == 1 then
{
TL11 = TL_New(sDate[1],sTime[1],저점[1,1]+(고점[2,1]-저점[1,1])*0.382,sDate,sTime,저점[1,1]+(고점[2,1]-저점[1,1])*0.382);
TL12 = TL_New(sDate[1],sTime[1],저점[1,1]+(고점[2,1]-저점[1,1])*0.500,sDate,sTime,저점[1,1]+(고점[2,1]-저점[1,1])*0.500);
TL13 = TL_New(sDate[1],sTime[1],저점[1,1]+(고점[2,1]-저점[1,1])*0.618,sDate,sTime,저점[1,1]+(고점[2,1]-저점[1,1])*0.618);
TL_SetColor(TL11,RED);
TL_SetColor(TL12,RED);
TL_SetColor(TL13,RED);
}
Else
{
TL11 = TL_New(sDate[1],sTime[1],고점[1,1]-(고점[1,1]-저점[2,1])*0.382,sDate,sTime,고점[1,1]-(고점[1,1]-저점[2,1])*0.382);
TL12 = TL_New(sDate[1],sTime[1],고점[1,1]-(고점[1,1]-저점[2,1])*0.500,sDate,sTime,고점[1,1]-(고점[1,1]-저점[2,1])*0.500);
TL13 = TL_New(sDate[1],sTime[1],고점[1,1]-(고점[1,1]-저점[2,1])*0.618,sDate,sTime,고점[1,1]-(고점[1,1]-저점[2,1])*0.618);
TL_SetColor(TL11,BLUE);
TL_SetColor(TL12,BLUE);
TL_SetColor(TL13,BLUE);
}
}
Else
{
TL_SetEnd(TL11,sdate,stime,TL_GetValue(TL11,sdate,stime));
TL_SetEnd(TL12,sdate,stime,TL_GetValue(TL12,sdate,stime));
TL_SetEnd(TL13,sdate,stime,TL_GetValue(TL13,sdate,stime));
}
if MarketPosition == 1 and t == -1 Then
{
ExitLong("bx",AtStop,저점[2,1]-PriceScale*1);
}
if MarketPosition == -1 and t == 1 Then
ExitShort("sx",AtStop,고점[2,1]+PriceScale*1);
2
Input:length(12);
Var:j(0),lastHiVal(0),lastLoVal(0),sBar(0),eBar(0),TL1(0),TL2(0),TL3(0),Text1(0),처리구분(""),TL_Val1(0),TL_Val2(0),color(0),T(0);
Array:고점[10,2](0),저점[10,2](0);
var : TL11(0),TL12(0),TL13(0);
처리구분 = "";
If Highest(H,length) == H and lastHiVal <> H and Lowest(L,length) == L and lastLoVal <> L Then
{
If 저점[1,1] > L Then 처리구분 = "저점처리";
If 고점[1,1] < H Then 처리구분 = "고점처리";
}
Else If Highest(H,length) == H and lastHiVal <> H Then 처리구분 = "고점처리";
Else If Lowest(L,length) == L and lastLoVal <> L Then 처리구분 = "저점처리";
If 처리구분 == "고점처리" Then
{
T = 1;
lastHiVal = H;
If 고점[1,2] < 저점[1,2] Then
{
For j = 10 DownTo 2
{
고점[j,1] = 고점[j-1,1];
고점[j,2] = 고점[j-1,2];
}
}
If 고점[1,2] < 저점[1,2] or 고점[1,1] < H Then
{
고점[1,1] = H;
고점[1,2] = Index;
sBar = Index - 저점[1,2];
eBar = 0;
If TL_GetBeginDate(TL1) == sDate[sBar] and TL_GetBeginTime(TL1) == sTime[sBar] Then
{
TL_Delete(TL1);
Text_Delete(Text1);
If 고점[3,1][1] < 고점[2,1][1] and 고점[2,1][1] > 고점[1,1][1] and 저점[2,1][1] < 저점[1,1][1] Then
TL_Delete(TL2);
}
if 고점[1,1] > 고점[2,1] or 고점[2,1] == 0 Then
{
color = MAGENTA;
#buy("b");
}
TL1 = TL_New(sDate[sBar],sTime[sBar],저점[1,1],sDate[eBar],sTime[eBar],고점[1,1]);
TL_SetColor(TL1,color);
Text1 = Text_New(sDate[eBar],sTime[eBar],고점[1,1],NumToStr(abs(고점[1,1]-저점[1,1])/PriceScale,0)+NewLine+NumToStr(고점[1,1],2));
Text_SetStyle(Text1, 2, 1);
If 고점[3,1] < 고점[2,1] and 고점[2,1] > 고점[1,1] and 저점[2,1] < 저점[1,1] Then
{
sBar = Index - 저점[2,2];
eBar = Index - 저점[1,2];
}
}
}
If 처리구분 == "저점처리" Then
{
T = -1;
lastLoVal = L;
If 저점[1,2] < 고점[1,2] Then
{
For j = 10 DownTo 2
{
저점[j,1] = 저점[j-1,1];
저점[j,2] = 저점[j-1,2];
}
}
If 저점[1,2] < 고점[1,2] or 저점[1,1] > L Then
{
저점[1,1] = L;
저점[1,2] = Index;
sBar = Index - 고점[1,2];
eBar = 0;
If TL_GetBeginDate(TL1) == sDate[sBar] and TL_GetBeginTime(TL1) == sTime[sBar] Then
{
TL_Delete(TL1);
Text_Delete(Text1);
If 저점[2,1][1] < 저점[1,1][1] and 저점[2,1][1] < 저점[3,1][1] and 고점[2,1][1] > 고점[1,1][1] Then
TL_Delete(TL3);
}
if 저점[1,1] < 저점[2,1] or 저점[2,1] == 0 Then
{
color = CYAN;
#sell("s");
}
TL1 = TL_New(sDate[sBar],sTime[sBar],고점[1,1],sDate[eBar],sTime[eBar],저점[1,1]);
TL_SetColor(TL1,color);
Text1 = Text_New(sDate[eBar],sTime[eBar],저점[1,1],NumToStr(abs(고점[1,1]-저점[1,1])/PriceScale,0)+NewLine+NumToStr(저점[1,1],2));
Text_SetStyle(Text1, 2, 0);
If 저점[2,1] < 저점[1,1] and 저점[2,1] < 저점[3,1] and 고점[2,1] > 고점[1,1] Then
{
sBar = Index - 고점[2,2];
eBar = Index - 고점[1,2];
}
}
}
TL_SetSize(TL1,3);
if T != T[1] Then
{
var1 = var1+1;
if T == 1 then
{
TL11 = TL_New(sDate[1],sTime[1],저점[1,1]+(고점[2,1]-저점[1,1])*0.382,sDate,sTime,저점[1,1]+(고점[2,1]-저점[1,1])*0.382);
TL12 = TL_New(sDate[1],sTime[1],저점[1,1]+(고점[2,1]-저점[1,1])*0.500,sDate,sTime,저점[1,1]+(고점[2,1]-저점[1,1])*0.500);
TL13 = TL_New(sDate[1],sTime[1],저점[1,1]+(고점[2,1]-저점[1,1])*0.618,sDate,sTime,저점[1,1]+(고점[2,1]-저점[1,1])*0.618);
TL_SetColor(TL11,RED);
TL_SetColor(TL12,RED);
TL_SetColor(TL13,RED);
}
Else
{
TL11 = TL_New(sDate[1],sTime[1],고점[1,1]-(고점[1,1]-저점[2,1])*0.382,sDate,sTime,고점[1,1]-(고점[1,1]-저점[2,1])*0.382);
TL12 = TL_New(sDate[1],sTime[1],고점[1,1]-(고점[1,1]-저점[2,1])*0.500,sDate,sTime,고점[1,1]-(고점[1,1]-저점[2,1])*0.500);
TL13 = TL_New(sDate[1],sTime[1],고점[1,1]-(고점[1,1]-저점[2,1])*0.618,sDate,sTime,고점[1,1]-(고점[1,1]-저점[2,1])*0.618);
TL_SetColor(TL11,BLUE);
TL_SetColor(TL12,BLUE);
TL_SetColor(TL13,BLUE);
}
}
Else
{
TL_SetEnd(TL11,sdate,stime,TL_GetValue(TL11,sdate,stime));
TL_SetEnd(TL12,sdate,stime,TL_GetValue(TL12,sdate,stime));
TL_SetEnd(TL13,sdate,stime,TL_GetValue(TL13,sdate,stime));
}
var : mav(0);
mav = ma(C,120);
if MarketPosition == 0 and C < mav and T == 1 and H < 저점[1,1]+(고점[2,1]-저점[1,1])*0.382 Then
sell("s",atlimit,저점[1,1]+(고점[2,1]-저점[1,1])*0.382);
if MarketPosition == 0 and C > mav and T == -1 and L > 고점[1,1]-(고점[1,1]-저점[2,1])*0.382 Then
buy("b",atlimit,고점[1,1]-(고점[1,1]-저점[2,1])*0.382);
if MarketPosition == -1 then
{
ExitShort("sx1",AtStop,저점[1,1]+(고점[2,1]-저점[1,1])*0.500);
if lowest(L,BarsSinceEntry) <= EntryPrice-PriceScale*20 Then
ExitShort("sx2",AtStop,lowest(L,BarsSinceEntry)+PriceScale*20);
}
if MarketPosition == 1 then
{
ExitLong("bx1",AtStop,고점[1,1]-(고점[1,1]-저점[2,1])*0.500);
if highest(H,BarsSinceEntry) >= EntryPrice+PriceScale*20 Then
ExitLong("bx2",AtStop,Highest(H,BarsSinceEntry)-PriceScale*20);
}
즐거운 하루되세요
> 생생파생 님이 쓴 글입니다.
> 제목 : 안녕하세요. 문의드립니다.
> 안녕하세요. 문의 드립니다.
아래 식에 추가하고 싶은 사항이 있어서 부탁드립니다.
파동의 고가와 저가가 표현되는 식입니다.
1. 직전 파동이 완성되면 해당 파동의 고가와 저가의 피보나치 비율을 추가하여 38.2% 자리와 50% 61.8% 자리를 직전파동의 고저가 확정되면 우측에 표현하고 싶습니다. 안되는 기능이면 패스해도 됩니다.
2.
가격이 120 이평 아래에 위치할 경우 올라올때 38.2% 자리를 터치하면 매도신호가 발생.
매도 보유중에 50% 까지 올라오면 손절(주석으로 부탁드립니다.)
매도 보유중에 20틱 이상 수익 발생시 20틱 수익시에는 진입가로 다시 올라오면 청산/ 20틱 이상 수익 발생시에는 수익 틱만큼 익절가격이 올라가야 합니다.
ex) 20틱 수익 TS익절=0 / 최고수익틱 30틱 TS익절=10틱
가격이 120 이평 위에 위치할 경우 내려올때 38.2% 자리를 터치하면 매수신호가 발생.
매수 이후 50% 까지 내려오면 손절.
포지션이 있을경우는 신규진입하지 않아야 합니다. 포지션이 청산되고 없을때 다음 조건만족시 진입식 부탁드립니다.
늘 수고많으시고 감사드립니다.
Input:length(12);
Var:j(0),lastHiVal(0),lastLoVal(0),sBar(0),eBar(0),TL1(0),TL2(0),TL3(0),Text1(0),처리구분(""),TL_Val1(0),TL_Val2(0),color(0),T(0);
Array:고점[10,2](0),저점[10,2](0);
처리구분 = "";
If Highest(H,length) == H and lastHiVal <> H and Lowest(L,length) == L and lastLoVal <> L Then
{
If 저점[1,1] > L Then 처리구분 = "저점처리";
If 고점[1,1] < H Then 처리구분 = "고점처리";
}
Else If Highest(H,length) == H and lastHiVal <> H Then 처리구분 = "고점처리";
Else If Lowest(L,length) == L and lastLoVal <> L Then 처리구분 = "저점처리";
If 처리구분 == "고점처리" Then
{
T = 1;
lastHiVal = H;
If 고점[1,2] < 저점[1,2] Then
{
For j = 10 DownTo 2
{
고점[j,1] = 고점[j-1,1];
고점[j,2] = 고점[j-1,2];
}
}
If 고점[1,2] < 저점[1,2] or 고점[1,1] < H Then
{
고점[1,1] = H;
고점[1,2] = Index;
sBar = Index - 저점[1,2];
eBar = 0;
If TL_GetBeginDate(TL1) == sDate[sBar] and TL_GetBeginTime(TL1) == sTime[sBar] Then
{
TL_Delete(TL1);
Text_Delete(Text1);
If 고점[3,1][1] < 고점[2,1][1] and 고점[2,1][1] > 고점[1,1][1] and 저점[2,1][1] < 저점[1,1][1] Then
TL_Delete(TL2);
}
if 고점[1,1] > 고점[2,1] or 고점[2,1] == 0 Then
{
color = MAGENTA;
#buy("b");
}
TL1 = TL_New(sDate[sBar],sTime[sBar],저점[1,1],sDate[eBar],sTime[eBar],고점[1,1]);
TL_SetColor(TL1,color);
Text1 = Text_New(sDate[eBar],sTime[eBar],고점[1,1],NumToStr(abs(고점[1,1]-저점[1,1])/PriceScale,0)+NewLine+NumToStr(고점[1,1],2));
Text_SetStyle(Text1, 2, 1);
If 고점[3,1] < 고점[2,1] and 고점[2,1] > 고점[1,1] and 저점[2,1] < 저점[1,1] Then
{
sBar = Index - 저점[2,2];
eBar = Index - 저점[1,2];
}
}
}
If 처리구분 == "저점처리" Then
{
T = -1;
lastLoVal = L;
If 저점[1,2] < 고점[1,2] Then
{
For j = 10 DownTo 2
{
저점[j,1] = 저점[j-1,1];
저점[j,2] = 저점[j-1,2];
}
}
If 저점[1,2] < 고점[1,2] or 저점[1,1] > L Then
{
저점[1,1] = L;
저점[1,2] = Index;
sBar = Index - 고점[1,2];
eBar = 0;
If TL_GetBeginDate(TL1) == sDate[sBar] and TL_GetBeginTime(TL1) == sTime[sBar] Then
{
TL_Delete(TL1);
Text_Delete(Text1);
If 저점[2,1][1] < 저점[1,1][1] and 저점[2,1][1] < 저점[3,1][1] and 고점[2,1][1] > 고점[1,1][1] Then
TL_Delete(TL3);
}
if 저점[1,1] < 저점[2,1] or 저점[2,1] == 0 Then
{
color = CYAN;
#sell("s");
}
TL1 = TL_New(sDate[sBar],sTime[sBar],고점[1,1],sDate[eBar],sTime[eBar],저점[1,1]);
TL_SetColor(TL1,color);
Text1 = Text_New(sDate[eBar],sTime[eBar],저점[1,1],NumToStr(abs(고점[1,1]-저점[1,1])/PriceScale,0)+NewLine+NumToStr(저점[1,1],2));
Text_SetStyle(Text1, 2, 0);
If 저점[2,1] < 저점[1,1] and 저점[2,1] < 저점[3,1] and 고점[2,1] > 고점[1,1] Then
{
sBar = Index - 고점[2,2];
eBar = Index - 고점[1,2];
}
}
}
TL_SetSize(TL1,3);
if color != color[1] Then
{
var1 = 0;
var2 = var1[1];
var3 = var2[1];
if T == -1 and var2 == 1 and var3 >= 3 Then
sell("s1");
if T == 1 and var2 == 1 and var3 >= 3 Then
buy("b1");
}
if T != T[1] Then
{
var1 = var1+1;
}
if MarketPosition == 1 and t == -1 Then
{
ExitLong("bx",AtStop,저점[2,1]-PriceScale*1);
}
if MarketPosition == -1 and t == 1 Then
ExitShort("sx",AtStop,고점[2,1]+PriceScale*1);