커뮤니티
패턴이 완성되면 매수, 매도 신호가 생성되게 만들어 주세요!
2017-11-13 13:59:54
265
글번호 114096
1. 첨부된 그림은 하락을 알리는 W패턴 입니다! 파란 동그라미의 화살표 처럼
상승M 또는 하락W 의 패턴이 완성되면 매수 또는 매도 화살표 신호가 나올 수 있도록
틱, 분챠트 모두 가능하게 부탁드립니다.
Input:length(12),오차범위(0.1);
Var:j(0),lastHiVal(0),lastLoVal(0),sBar(0),eBar(0),
처리구분(""),XA(0),AB(0),BC(0),CD(0),V1(0),V2(0),V3(0),V4(0),Result("");
Array:고점[10,2](0),저점[10,2](0),TL[9](0),TX[6](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
{
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;
XA = sqrt((고점[3,1]-저점[2,1])^2+(저점[2,2]-고점[3,2])^2);
AB = sqrt((고점[2,1]-저점[2,1])^2+(고점[2,2]-저점[2,2])^2);
BC = sqrt((고점[2,1]-저점[1,1])^2+(저점[1,2]-고점[2,2])^2);
CD = sqrt((고점[1,1]-저점[1,1])^2+(고점[1,2]-저점[1,2])^2);
V1 = AB/XA;
V2 = BC/AB;
V3 = CD/BC;
V4 = CD/XA;
Result = "";
If 고점[2,1] < 고점[1,1] and 고점[1,1] < 고점[3,1] and
저점[2,1] < 저점[1,1] Then
{
If V1 >= 0.618 - 오차범위 and V1 <= 0.618 + 오차범위 and
V2 >= 0.382 - 오차범위 and V2 <= 0.886 + 오차범위 and
V3 >= 1.13 - 오차범위 and V3 <= 1.618 + 오차범위 and
V4 >= 0.786 - 오차범위 and V4 <= 0.786 + 오차범위 Then
Result = "Gartley Bearish";
Else If V1 >= 0.382 - 오차범위 and V1 <= 0.5 + 오차범위 and
V2 >= 0.382 - 오차범위 and V2 <= 0.886 + 오차범위 and
V3 >= 1.618 - 오차범위 and v3 <= 2.618 + 오차범위 and
V4 >= 0.886 - 오차범위 and V4 <= 0.886 + 오차범위 Then
Result = "Bat Bearish";
}
Else If 고점[2,1] < 고점[3,1] and 고점[3,1] < 고점[1,1] and
저점[2,1] < 저점[1,1] Then
{
If V1 >= 0.382 - 오차범위 and V1 <= 0.618 + 오차범위 and
V2 >= 0.382 - 오차범위 and V2 <= 0.886 + 오차범위 and
V3 >= 2.240 - 오차범위 and V3 <= 3.618 + 오차범위 and
V4 >= 1.618 - 오차범위 and V4 <= 1.618 + 오차범위 Then
Result = "Crab Bearish";
Else If V1 >= 0.786 - 오차범위 and V1 <= 0.786 + 오차범위 and
V2 >= 0.382 - 오차범위 and V2 <= 0.886 + 오차범위 and
V3 >= 1.618 - 오차범위 and v3 <= 2.618 + 오차범위 and
V4 >= 1.27 - 오차범위 and V4 <= 1.618 + 오차범위 Then
Result = "Butterfly Bearish";
Else If V1 >= 0.886 - 오차범위 and V1 <= 0.886 + 오차범위 and
V2 >= 0.382 - 오차범위 and V2 <= 0.886 + 오차범위 and
V3 >= 2.240 - 오차범위 and V3 <= 3.618 + 오차범위 and
V4 >= 1.618 - 오차범위 and V4 <= 1.618 + 오차범위 Then
Result = "Deep Crab Bearish";
Else If V1 >= 0.382 - 오차범위 and V1 <= 0.382 + 오차범위 and
V2 >= 0.382 - 오차범위 and V2 <= 0.886 + 오차범위 and
V3 >= 2.0 - 오차범위 and V3 <= 3.168 + 오차범위 and
V4 >= 1.13 - 오차범위 and V4 <= 1.13 + 오차범위 Then
Result = "ALT BAT Bearish";
}
Else If 고점[2,1] < 고점[3,1] and 고점[2,1] < 고점[1,1] and
저점[1,1] < 저점[2,1] Then
{
If V2 >= 1.13 - 오차범위 and V2 <= 1.618 + 오차범위 and
V3 >= 1.618 - 오차범위 and V3 <= 2.24 + 오차범위 and
V4 >= 0.886 - 오차범위 and V4 <= 1.13 + 오차범위 Then
Result = "Shark Bearish";
}
If Result != "" Then
{
sBar = Index - 고점[3,2];
eBar = Index - 저점[2,2];
If TL_GetBeginDate(TL[1]) == sDate[sBar] and TL_GetBeginTime(TL[1]) == sTime[sBar] Then
{
For j = 1 To 8
{
TL_Delete(TL[j]);
If j < 6 Then Text_Delete(TX[j]);
}
}
TL[1] = TL_New(sDate[sBar],sTime[sBar],고점[3,1],sDate[eBar],sTime[eBar],저점[2,1]);
sBar = Index - 저점[2,2];
eBar = Index - 고점[2,2];
TL[2] = TL_New(sDate[sBar],sTime[sBar],저점[2,1],sDate[eBar],sTime[eBar],고점[2,1]);
sBar = Index - 고점[2,2];
eBar = Index - 저점[1,2];
TL[3] = TL_New(sDate[sBar],sTime[sBar],고점[2,1],sDate[eBar],sTime[eBar],저점[1,1]);
sBar = Index - 저점[1,2];
eBar = Index - 고점[1,2];
TL[4] = TL_New(sDate[sBar],sTime[sBar],저점[1,1],sDate[eBar],sTime[eBar],고점[1,1]);
sBar = Index - 고점[3,2];
eBar = Index - 고점[2,2];
TL[5] = TL_New(sDate[sBar],sTime[sBar],고점[3,1],sDate[eBar],sTime[eBar],고점[2,1]);
sBar = Index - 고점[2,2];
eBar = Index - 고점[1,2];
TL[6] = TL_New(sDate[sBar],sTime[sBar],고점[2,1],sDate[eBar],sTime[eBar],고점[1,1]);
sBar = Index - 고점[3,2];
eBar = Index - 고점[1,2];
TL[7] = TL_New(sDate[sBar],sTime[sBar],고점[3,1],sDate[eBar],sTime[eBar],고점[1,1]);
sBar = Index - 저점[2,2];
eBar = Index - 저점[1,2];
TL[8] = TL_New(sDate[sBar],sTime[sBar],저점[2,1],sDate[eBar],sTime[eBar],저점[1,1]);
sBar = Index - round((고점[3,2] + 고점[2,2])/2,0);
TX[1] = Text_New(sDate[sBar],sTime[sBar],(고점[3,1]+고점[2,1])/2,NumToStr(V1,4)+" XA");
sBar = Index - round((저점[2,2] + 저점[1,2])/2,0);
TX[2] = Text_New(sDate[sBar],sTime[sBar],(저점[2,1]+저점[1,1])/2,NumToStr(V2,4)+" AB");
sBar = Index - round((고점[2,2] + 고점[1,2])/2,0);
TX[3] = Text_New(sDate[sBar],sTime[sBar],(고점[2,1]+고점[1,1])/2,NumToStr(V3,4)+" BC");
sBar = Index - round((고점[3,2] + 고점[1,2])/2,0);
TX[4] = Text_New(sDate[sBar],sTime[sBar],(고점[3,1]+고점[1,1])/2,NumToStr(V4,4)+" XA");
sBar = Index - round((고점[3,2] + 고점[1,2])/2,0);
TX[5] = Text_New(sDate[sBar],sTime[sBar],(고점[3,1]+고점[2,1])/2,Result);
For j = 1 To 8
{
TL_SetColor(TL[j],BLUE);
}
Text_SetStyle(TX[1],2,0);
Text_SetStyle(TX[2],2,0);
Text_SetStyle(TX[3],2,0);
Text_SetStyle(TX[4],2,0);
Text_SetStyle(TX[5],2,2);
}
}
}
If 처리구분 == "저점처리" Then
{
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;
XA = sqrt((고점[2,1]-저점[3,1])^2+(고점[2,2]-저점[3,2])^2);
AB = sqrt((고점[2,1]-저점[2,1])^2+(저점[2,2]-고점[2,2])^2);
BC = sqrt((고점[1,1]-저점[2,1])^2+(고점[1,2]-저점[2,2])^2);
CD = sqrt((고점[1,1]-저점[1,1])^2+(저점[1,2]-고점[1,2])^2);
V1 = AB/XA;
V2 = BC/AB;
V3 = CD/BC;
V4 = CD/XA;
Result = "";
If 저점[3,1] < 저점[1,1] and 저점[1,1] < 저점[2,1] and
고점[1,1] < 고점[2,1] Then
{
If V1 >= 0.618 - 오차범위 and V1 <= 0.618 + 오차범위 and
V2 >= 0.382 - 오차범위 and V2 <= 0.886 + 오차범위 and
V3 >= 1.13 - 오차범위 and V3 <= 1.618 + 오차범위 and
V4 >= 0.786 - 오차범위 and V4 <= 0.786 + 오차범위 Then
Result = "Gartley Bullish";
Else If V1 >= 0.382 - 오차범위 and V1 <= 0.5 + 오차범위 and
V2 >= 0.382 - 오차범위 and V2 <= 0.886 + 오차범위 and
V3 >= 1.618 - 오차범위 and v3 <= 2.618 + 오차범위 and
V4 >= 0.886 - 오차범위 and V4 <= 0.886 + 오차범위 Then
Result = "Bat Bullish";
}
Else If 저점[1,1] < 저점[3,1] and 저점[3,1] < 저점[2,1] and
고점[1,1] < 고점[2,1] Then
{
If V1 >= 0.382 - 오차범위 and V1 <= 0.618 + 오차범위 and
V2 >= 0.382 - 오차범위 and V2 <= 0.886 + 오차범위 and
V3 >= 2.240 - 오차범위 and V3 <= 3.618 + 오차범위 and
V4 >= 1.618 - 오차범위 and V4 <= 1.618 + 오차범위 Then
Result = "Crab Bullish";
Else If V1 >= 0.786 - 오차범위 and V1 <= 0.786 + 오차범위 and
V2 >= 0.382 - 오차범위 and V2 <= 0.886 + 오차범위 and
V3 >= 1.618 - 오차범위 and v3 <= 2.618 + 오차범위 and
V4 >= 1.27 - 오차범위 and V4 <= 1.618 + 오차범위 Then
Result = "Butterfly Bullish";
Else If V1 >= 0.886 - 오차범위 and V1 <= 0.886 + 오차범위 and
V2 >= 0.382 - 오차범위 and V2 <= 0.886 + 오차범위 and
V3 >= 2.240 - 오차범위 and V3 <= 3.618 + 오차범위 and
V4 >= 1.618 - 오차범위 and V4 <= 1.618 + 오차범위 Then
Result = "Deep Crab Bullish";
Else If V1 >= 0.382 - 오차범위 and V1 <= 0.382 + 오차범위 and
V2 >= 0.382 - 오차범위 and V2 <= 0.886 + 오차범위 and
V3 >= 2.0 - 오차범위 and V3 <= 3.168 + 오차범위 and
V4 >= 1.13 - 오차범위 and V4 <= 1.13 + 오차범위 Then
Result = "ALT BAT Bullish";
}
Else If 저점[1,1] < 저점[2,1] and 저점[3,1] < 저점[2,1] and
고점[2,1] < 고점[1,1] Then
{
If V2 >= 1.13 - 오차범위 and V2 <= 1.618 + 오차범위 and
V3 >= 1.618 - 오차범위 and V3 <= 2.24 + 오차범위 and
V4 >= 0.886 - 오차범위 and V4 <= 1.13 + 오차범위 Then
Result = "Shark Bullish";
}
If Result != "" Then
{
sBar = Index - 저점[3,2];
eBar = Index - 고점[2,2];
If TL_GetBeginDate(TL[1]) == sDate[sBar] and TL_GetBeginTime(TL[1]) == sTime[sBar] Then
{
For j = 1 To 8 {
TL_Delete(TL[j]);
If j < 6 Then Text_Delete(TX[j]);
}
}
TL[1] = TL_New(sDate[sBar],sTime[sBar],저점[3,1],sDate[eBar],sTime[eBar],고점[2,1]);
sBar = Index - 고점[2,2];
eBar = Index - 저점[2,2];
TL[2] = TL_New(sDate[sBar],sTime[sBar],고점[2,1],sDate[eBar],sTime[eBar],저점[2,1]);
sBar = Index - 저점[2,2];
eBar = Index - 고점[1,2];
TL[3] = TL_New(sDate[sBar],sTime[sBar],저점[2,1],sDate[eBar],sTime[eBar],고점[1,1]);
sBar = Index - 고점[1,2];
eBar = Index - 저점[1,2];
TL[4] = TL_New(sDate[sBar],sTime[sBar],고점[1,1],sDate[eBar],sTime[eBar],저점[1,1]);
sBar = Index - 저점[3,2];
eBar = Index - 저점[2,2];
TL[5] = TL_New(sDate[sBar],sTime[sBar],저점[3,1],sDate[eBar],sTime[eBar],저점[2,1]);
sBar = Index - 저점[2,2];
eBar = Index - 저점[1,2];
TL[6] = TL_New(sDate[sBar],sTime[sBar],저점[2,1],sDate[eBar],sTime[eBar],저점[1,1]);
sBar = Index - 저점[3,2];
eBar = Index - 저점[1,2];
TL[7] = TL_New(sDate[sBar],sTime[sBar],저점[3,1],sDate[eBar],sTime[eBar],저점[1,1]);
sBar = Index - 고점[2,2];
eBar = Index - 고점[1,2];
TL[8] = TL_New(sDate[sBar],sTime[sBar],고점[2,1],sDate[eBar],sTime[eBar],고점[1,1]);
sBar = Index - round((저점[3,2] + 저점[2,2])/2,0);
TX[1] = Text_New(sDate[sBar],sTime[sBar],(저점[3,1]+저점[2,1])/2,NumToStr(V1,4)+" XA");
sBar = Index - round((고점[2,2] + 고점[1,2])/2,0);
TX[2] = Text_New(sDate[sBar],sTime[sBar],(고점[2,1]+고점[1,1])/2,NumToStr(V2,4)+" AB");
sBar = Index - round((저점[2,2] + 저점[1,2])/2,0);
TX[3] = Text_New(sDate[sBar],sTime[sBar],(저점[2,1]+저점[1,1])/2,NumToStr(V3,4)+" BC");
sBar = Index - round((저점[3,2] + 저점[1,2])/2,0);
TX[4] = Text_New(sDate[sBar],sTime[sBar],(저점[3,1]+저점[1,1])/2,NumToStr(V4,4)+" XA");
sBar = Index - round((저점[3,2] + 저점[1,2])/2,0);
TX[5] = Text_New(sDate[sBar],sTime[sBar],(저점[3,1]+저점[2,1])/2,Result);
For j = 1 To 8
{
TL_SetColor(TL[j],RED);
}
Text_SetStyle(TX[1],2,1);
Text_SetStyle(TX[2],2,1);
Text_SetStyle(TX[3],2,1);
Text_SetStyle(TX[4],2,1);
Text_SetStyle(TX[5],2,2);
}
}
}
For j = 1 To 4 {
TL_SetSize(TL[j],3);
}
For j = 5 To 8 {
TL_SetSize(TL[j],0);
TL_SetColor(TL[j],BLACK);
}
----------------------------------------------------------------------------------
2. 일명 지그재그 패턴입니다! 첨부 파일 (그림2)올려 드려요!
틱, 분챠트 모두 가능하게 파동 변곡이 나타나면 반대 매수 또는 매도 화살표 신호가 나오게
부탁드립니다!
Input:length(12);
Var:j(0),lastHiVal(0),lastLoVal(0),sBar(0),eBar(0),TL1(0),
Text1(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
{
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);
}
TL1 = TL_New(sDate[sBar],sTime[sBar],저점[1,1],
sDate[eBar],sTime[eBar],고점[1,1]);
Text1 = Text_New(sDate[eBar],sTime[eBar],고점[1,1],
NumToStr(고점[1,1],2));
Text_SetStyle(Text1, 2, 1);
}
}
If 처리구분 == "저점처리" Then
{
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);
}
TL1 = TL_New(sDate[sBar],sTime[sBar],고점[1,1],
sDate[eBar],sTime[eBar],저점[1,1]);
Text1 = Text_New(sDate[eBar],sTime[eBar],저점[1,1],
NumToStr(저점[1,1],2));
Text_SetStyle(Text1, 2, 0);
}
}
TL_SetSize(TL1,3);
TL_SetColor(TL1,CYAN);
--------------------------------------------------------------------------------------
답변 1
예스스탁 예스스탁 답변
2017-11-13 13:43:28
안녕하세요
예스스탁입니다.
1.
Input:length(12),오차범위(0.1);
Var:j(0),lastHiVal(0),lastLoVal(0),sBar(0),eBar(0),
처리구분(""),XA(0),AB(0),BC(0),CD(0),V1(0),V2(0),V3(0),V4(0),Result(""),T(0);
Array:고점[10,2](0),저점[10,2](0),TL[9](0),TX[6](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 처리구분 = "저점처리";
T = 0;
If 처리구분 == "고점처리" Then
{
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;
XA = sqrt((고점[3,1]-저점[2,1])^2+(저점[2,2]-고점[3,2])^2);
AB = sqrt((고점[2,1]-저점[2,1])^2+(고점[2,2]-저점[2,2])^2);
BC = sqrt((고점[2,1]-저점[1,1])^2+(저점[1,2]-고점[2,2])^2);
CD = sqrt((고점[1,1]-저점[1,1])^2+(고점[1,2]-저점[1,2])^2);
V1 = AB/XA;
V2 = BC/AB;
V3 = CD/BC;
V4 = CD/XA;
Result = "";
If 고점[2,1] < 고점[1,1] and 고점[1,1] < 고점[3,1] and
저점[2,1] < 저점[1,1] Then
{
If V1 >= 0.618 - 오차범위 and V1 <= 0.618 + 오차범위 and
V2 >= 0.382 - 오차범위 and V2 <= 0.886 + 오차범위 and
V3 >= 1.13 - 오차범위 and V3 <= 1.618 + 오차범위 and
V4 >= 0.786 - 오차범위 and V4 <= 0.786 + 오차범위 Then
Result = "Gartley Bearish";
Else If V1 >= 0.382 - 오차범위 and V1 <= 0.5 + 오차범위 and
V2 >= 0.382 - 오차범위 and V2 <= 0.886 + 오차범위 and
V3 >= 1.618 - 오차범위 and v3 <= 2.618 + 오차범위 and
V4 >= 0.886 - 오차범위 and V4 <= 0.886 + 오차범위 Then
Result = "Bat Bearish";
}
Else If 고점[2,1] < 고점[3,1] and 고점[3,1] < 고점[1,1] and
저점[2,1] < 저점[1,1] Then
{
If V1 >= 0.382 - 오차범위 and V1 <= 0.618 + 오차범위 and
V2 >= 0.382 - 오차범위 and V2 <= 0.886 + 오차범위 and
V3 >= 2.240 - 오차범위 and V3 <= 3.618 + 오차범위 and
V4 >= 1.618 - 오차범위 and V4 <= 1.618 + 오차범위 Then
Result = "Crab Bearish";
Else If V1 >= 0.786 - 오차범위 and V1 <= 0.786 + 오차범위 and
V2 >= 0.382 - 오차범위 and V2 <= 0.886 + 오차범위 and
V3 >= 1.618 - 오차범위 and v3 <= 2.618 + 오차범위 and
V4 >= 1.27 - 오차범위 and V4 <= 1.618 + 오차범위 Then
Result = "Butterfly Bearish";
Else If V1 >= 0.886 - 오차범위 and V1 <= 0.886 + 오차범위 and
V2 >= 0.382 - 오차범위 and V2 <= 0.886 + 오차범위 and
V3 >= 2.240 - 오차범위 and V3 <= 3.618 + 오차범위 and
V4 >= 1.618 - 오차범위 and V4 <= 1.618 + 오차범위 Then
Result = "Deep Crab Bearish";
Else If V1 >= 0.382 - 오차범위 and V1 <= 0.382 + 오차범위 and
V2 >= 0.382 - 오차범위 and V2 <= 0.886 + 오차범위 and
V3 >= 2.0 - 오차범위 and V3 <= 3.168 + 오차범위 and
V4 >= 1.13 - 오차범위 and V4 <= 1.13 + 오차범위 Then
Result = "ALT BAT Bearish";
}
Else If 고점[2,1] < 고점[3,1] and 고점[2,1] < 고점[1,1] and
저점[1,1] < 저점[2,1] Then
{
If V2 >= 1.13 - 오차범위 and V2 <= 1.618 + 오차범위 and
V3 >= 1.618 - 오차범위 and V3 <= 2.24 + 오차범위 and
V4 >= 0.886 - 오차범위 and V4 <= 1.13 + 오차범위 Then
Result = "Shark Bearish";
}
If Result != "" Then
{
T =1;
sBar = Index - 고점[3,2];
eBar = Index - 저점[2,2];
If TL_GetBeginDate(TL[1]) == sDate[sBar] and TL_GetBeginTime(TL[1]) == sTime[sBar] Then
{
For j = 1 To 8
{
TL_Delete(TL[j]);
If j < 6 Then Text_Delete(TX[j]);
}
}
TL[1] = TL_New(sDate[sBar],sTime[sBar],고점[3,1],sDate[eBar],sTime[eBar],저점[2,1]);
sBar = Index - 저점[2,2];
eBar = Index - 고점[2,2];
TL[2] = TL_New(sDate[sBar],sTime[sBar],저점[2,1],sDate[eBar],sTime[eBar],고점[2,1]);
sBar = Index - 고점[2,2];
eBar = Index - 저점[1,2];
TL[3] = TL_New(sDate[sBar],sTime[sBar],고점[2,1],sDate[eBar],sTime[eBar],저점[1,1]);
sBar = Index - 저점[1,2];
eBar = Index - 고점[1,2];
TL[4] = TL_New(sDate[sBar],sTime[sBar],저점[1,1],sDate[eBar],sTime[eBar],고점[1,1]);
sBar = Index - 고점[3,2];
eBar = Index - 고점[2,2];
TL[5] = TL_New(sDate[sBar],sTime[sBar],고점[3,1],sDate[eBar],sTime[eBar],고점[2,1]);
sBar = Index - 고점[2,2];
eBar = Index - 고점[1,2];
TL[6] = TL_New(sDate[sBar],sTime[sBar],고점[2,1],sDate[eBar],sTime[eBar],고점[1,1]);
sBar = Index - 고점[3,2];
eBar = Index - 고점[1,2];
TL[7] = TL_New(sDate[sBar],sTime[sBar],고점[3,1],sDate[eBar],sTime[eBar],고점[1,1]);
sBar = Index - 저점[2,2];
eBar = Index - 저점[1,2];
TL[8] = TL_New(sDate[sBar],sTime[sBar],저점[2,1],sDate[eBar],sTime[eBar],저점[1,1]);
sBar = Index - round((고점[3,2] + 고점[2,2])/2,0);
TX[1] = Text_New(sDate[sBar],sTime[sBar],(고점[3,1]+고점[2,1])/2,NumToStr(V1,4)+" XA");
sBar = Index - round((저점[2,2] + 저점[1,2])/2,0);
TX[2] = Text_New(sDate[sBar],sTime[sBar],(저점[2,1]+저점[1,1])/2,NumToStr(V2,4)+" AB");
sBar = Index - round((고점[2,2] + 고점[1,2])/2,0);
TX[3] = Text_New(sDate[sBar],sTime[sBar],(고점[2,1]+고점[1,1])/2,NumToStr(V3,4)+" BC");
sBar = Index - round((고점[3,2] + 고점[1,2])/2,0);
TX[4] = Text_New(sDate[sBar],sTime[sBar],(고점[3,1]+고점[1,1])/2,NumToStr(V4,4)+" XA");
sBar = Index - round((고점[3,2] + 고점[1,2])/2,0);
TX[5] = Text_New(sDate[sBar],sTime[sBar],(고점[3,1]+고점[2,1])/2,Result);
For j = 1 To 8
{
TL_SetColor(TL[j],BLUE);
}
Text_SetStyle(TX[1],2,0);
Text_SetStyle(TX[2],2,0);
Text_SetStyle(TX[3],2,0);
Text_SetStyle(TX[4],2,0);
Text_SetStyle(TX[5],2,2);
}
}
}
If 처리구분 == "저점처리" Then
{
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;
XA = sqrt((고점[2,1]-저점[3,1])^2+(고점[2,2]-저점[3,2])^2);
AB = sqrt((고점[2,1]-저점[2,1])^2+(저점[2,2]-고점[2,2])^2);
BC = sqrt((고점[1,1]-저점[2,1])^2+(고점[1,2]-저점[2,2])^2);
CD = sqrt((고점[1,1]-저점[1,1])^2+(저점[1,2]-고점[1,2])^2);
V1 = AB/XA;
V2 = BC/AB;
V3 = CD/BC;
V4 = CD/XA;
Result = "";
If 저점[3,1] < 저점[1,1] and 저점[1,1] < 저점[2,1] and
고점[1,1] < 고점[2,1] Then
{
If V1 >= 0.618 - 오차범위 and V1 <= 0.618 + 오차범위 and
V2 >= 0.382 - 오차범위 and V2 <= 0.886 + 오차범위 and
V3 >= 1.13 - 오차범위 and V3 <= 1.618 + 오차범위 and
V4 >= 0.786 - 오차범위 and V4 <= 0.786 + 오차범위 Then
Result = "Gartley Bullish";
Else If V1 >= 0.382 - 오차범위 and V1 <= 0.5 + 오차범위 and
V2 >= 0.382 - 오차범위 and V2 <= 0.886 + 오차범위 and
V3 >= 1.618 - 오차범위 and v3 <= 2.618 + 오차범위 and
V4 >= 0.886 - 오차범위 and V4 <= 0.886 + 오차범위 Then
Result = "Bat Bullish";
}
Else If 저점[1,1] < 저점[3,1] and 저점[3,1] < 저점[2,1] and
고점[1,1] < 고점[2,1] Then
{
If V1 >= 0.382 - 오차범위 and V1 <= 0.618 + 오차범위 and
V2 >= 0.382 - 오차범위 and V2 <= 0.886 + 오차범위 and
V3 >= 2.240 - 오차범위 and V3 <= 3.618 + 오차범위 and
V4 >= 1.618 - 오차범위 and V4 <= 1.618 + 오차범위 Then
Result = "Crab Bullish";
Else If V1 >= 0.786 - 오차범위 and V1 <= 0.786 + 오차범위 and
V2 >= 0.382 - 오차범위 and V2 <= 0.886 + 오차범위 and
V3 >= 1.618 - 오차범위 and v3 <= 2.618 + 오차범위 and
V4 >= 1.27 - 오차범위 and V4 <= 1.618 + 오차범위 Then
Result = "Butterfly Bullish";
Else If V1 >= 0.886 - 오차범위 and V1 <= 0.886 + 오차범위 and
V2 >= 0.382 - 오차범위 and V2 <= 0.886 + 오차범위 and
V3 >= 2.240 - 오차범위 and V3 <= 3.618 + 오차범위 and
V4 >= 1.618 - 오차범위 and V4 <= 1.618 + 오차범위 Then
Result = "Deep Crab Bullish";
Else If V1 >= 0.382 - 오차범위 and V1 <= 0.382 + 오차범위 and
V2 >= 0.382 - 오차범위 and V2 <= 0.886 + 오차범위 and
V3 >= 2.0 - 오차범위 and V3 <= 3.168 + 오차범위 and
V4 >= 1.13 - 오차범위 and V4 <= 1.13 + 오차범위 Then
Result = "ALT BAT Bullish";
}
Else If 저점[1,1] < 저점[2,1] and 저점[3,1] < 저점[2,1] and
고점[2,1] < 고점[1,1] Then
{
If V2 >= 1.13 - 오차범위 and V2 <= 1.618 + 오차범위 and
V3 >= 1.618 - 오차범위 and V3 <= 2.24 + 오차범위 and
V4 >= 0.886 - 오차범위 and V4 <= 1.13 + 오차범위 Then
Result = "Shark Bullish";
}
If Result != "" Then
{
T = -1;
sBar = Index - 저점[3,2];
eBar = Index - 고점[2,2];
If TL_GetBeginDate(TL[1]) == sDate[sBar] and TL_GetBeginTime(TL[1]) == sTime[sBar] Then
{
For j = 1 To 8 {
TL_Delete(TL[j]);
If j < 6 Then Text_Delete(TX[j]);
}
}
TL[1] = TL_New(sDate[sBar],sTime[sBar],저점[3,1],sDate[eBar],sTime[eBar],고점[2,1]);
sBar = Index - 고점[2,2];
eBar = Index - 저점[2,2];
TL[2] = TL_New(sDate[sBar],sTime[sBar],고점[2,1],sDate[eBar],sTime[eBar],저점[2,1]);
sBar = Index - 저점[2,2];
eBar = Index - 고점[1,2];
TL[3] = TL_New(sDate[sBar],sTime[sBar],저점[2,1],sDate[eBar],sTime[eBar],고점[1,1]);
sBar = Index - 고점[1,2];
eBar = Index - 저점[1,2];
TL[4] = TL_New(sDate[sBar],sTime[sBar],고점[1,1],sDate[eBar],sTime[eBar],저점[1,1]);
sBar = Index - 저점[3,2];
eBar = Index - 저점[2,2];
TL[5] = TL_New(sDate[sBar],sTime[sBar],저점[3,1],sDate[eBar],sTime[eBar],저점[2,1]);
sBar = Index - 저점[2,2];
eBar = Index - 저점[1,2];
TL[6] = TL_New(sDate[sBar],sTime[sBar],저점[2,1],sDate[eBar],sTime[eBar],저점[1,1]);
sBar = Index - 저점[3,2];
eBar = Index - 저점[1,2];
TL[7] = TL_New(sDate[sBar],sTime[sBar],저점[3,1],sDate[eBar],sTime[eBar],저점[1,1]);
sBar = Index - 고점[2,2];
eBar = Index - 고점[1,2];
TL[8] = TL_New(sDate[sBar],sTime[sBar],고점[2,1],sDate[eBar],sTime[eBar],고점[1,1]);
sBar = Index - round((저점[3,2] + 저점[2,2])/2,0);
TX[1] = Text_New(sDate[sBar],sTime[sBar],(저점[3,1]+저점[2,1])/2,NumToStr(V1,4)+" XA");
sBar = Index - round((고점[2,2] + 고점[1,2])/2,0);
TX[2] = Text_New(sDate[sBar],sTime[sBar],(고점[2,1]+고점[1,1])/2,NumToStr(V2,4)+" AB");
sBar = Index - round((저점[2,2] + 저점[1,2])/2,0);
TX[3] = Text_New(sDate[sBar],sTime[sBar],(저점[2,1]+저점[1,1])/2,NumToStr(V3,4)+" BC");
sBar = Index - round((저점[3,2] + 저점[1,2])/2,0);
TX[4] = Text_New(sDate[sBar],sTime[sBar],(저점[3,1]+저점[1,1])/2,NumToStr(V4,4)+" XA");
sBar = Index - round((저점[3,2] + 저점[1,2])/2,0);
TX[5] = Text_New(sDate[sBar],sTime[sBar],(저점[3,1]+저점[2,1])/2,Result);
For j = 1 To 8
{
TL_SetColor(TL[j],RED);
}
Text_SetStyle(TX[1],2,1);
Text_SetStyle(TX[2],2,1);
Text_SetStyle(TX[3],2,1);
Text_SetStyle(TX[4],2,1);
Text_SetStyle(TX[5],2,2);
}
}
}
For j = 1 To 4 {
TL_SetSize(TL[j],3);
}
For j = 5 To 8 {
TL_SetSize(TL[j],0);
TL_SetColor(TL[j],BLACK);
}
if T == 0 and T[1] == -1 then
buy();
if T == 0 and T[1] == 1 then
sell();
2
Input:length(12);
Var:j(0),lastHiVal(0),lastLoVal(0),sBar(0),eBar(0),TL1(0),
Text1(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
{
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);
}
TL1 = TL_New(sDate[sBar],sTime[sBar],저점[1,1],
sDate[eBar],sTime[eBar],고점[1,1]);
Text1 = Text_New(sDate[eBar],sTime[eBar],고점[1,1],
NumToStr(고점[1,1],2));
Text_SetStyle(Text1, 2, 1);
if MarketPosition <= 0 then
buy("b");
}
}
If 처리구분 == "저점처리" Then
{
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);
}
TL1 = TL_New(sDate[sBar],sTime[sBar],고점[1,1],
sDate[eBar],sTime[eBar],저점[1,1]);
Text1 = Text_New(sDate[eBar],sTime[eBar],저점[1,1],
NumToStr(저점[1,1],2));
Text_SetStyle(Text1, 2, 0);
if MarketPosition >= 0 then
sell("s");
}
}
TL_SetSize(TL1,3);
TL_SetColor(TL1,CYAN);
즐거운 하루되세요
> qha71 님이 쓴 글입니다.
> 제목 : 패턴이 완성되면 매수, 매도 신호가 생성되게 만들어 주세요!
> 1. 첨부된 그림은 하락을 알리는 W패턴 입니다! 파란 동그라미의 화살표 처럼
상승M 또는 하락W 의 패턴이 완성되면 매수 또는 매도 화살표 신호가 나올 수 있도록
틱, 분챠트 모두 가능하게 부탁드립니다.
Input:length(12),오차범위(0.1);
Var:j(0),lastHiVal(0),lastLoVal(0),sBar(0),eBar(0),
처리구분(""),XA(0),AB(0),BC(0),CD(0),V1(0),V2(0),V3(0),V4(0),Result("");
Array:고점[10,2](0),저점[10,2](0),TL[9](0),TX[6](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
{
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;
XA = sqrt((고점[3,1]-저점[2,1])^2+(저점[2,2]-고점[3,2])^2);
AB = sqrt((고점[2,1]-저점[2,1])^2+(고점[2,2]-저점[2,2])^2);
BC = sqrt((고점[2,1]-저점[1,1])^2+(저점[1,2]-고점[2,2])^2);
CD = sqrt((고점[1,1]-저점[1,1])^2+(고점[1,2]-저점[1,2])^2);
V1 = AB/XA;
V2 = BC/AB;
V3 = CD/BC;
V4 = CD/XA;
Result = "";
If 고점[2,1] < 고점[1,1] and 고점[1,1] < 고점[3,1] and
저점[2,1] < 저점[1,1] Then
{
If V1 >= 0.618 - 오차범위 and V1 <= 0.618 + 오차범위 and
V2 >= 0.382 - 오차범위 and V2 <= 0.886 + 오차범위 and
V3 >= 1.13 - 오차범위 and V3 <= 1.618 + 오차범위 and
V4 >= 0.786 - 오차범위 and V4 <= 0.786 + 오차범위 Then
Result = "Gartley Bearish";
Else If V1 >= 0.382 - 오차범위 and V1 <= 0.5 + 오차범위 and
V2 >= 0.382 - 오차범위 and V2 <= 0.886 + 오차범위 and
V3 >= 1.618 - 오차범위 and v3 <= 2.618 + 오차범위 and
V4 >= 0.886 - 오차범위 and V4 <= 0.886 + 오차범위 Then
Result = "Bat Bearish";
}
Else If 고점[2,1] < 고점[3,1] and 고점[3,1] < 고점[1,1] and
저점[2,1] < 저점[1,1] Then
{
If V1 >= 0.382 - 오차범위 and V1 <= 0.618 + 오차범위 and
V2 >= 0.382 - 오차범위 and V2 <= 0.886 + 오차범위 and
V3 >= 2.240 - 오차범위 and V3 <= 3.618 + 오차범위 and
V4 >= 1.618 - 오차범위 and V4 <= 1.618 + 오차범위 Then
Result = "Crab Bearish";
Else If V1 >= 0.786 - 오차범위 and V1 <= 0.786 + 오차범위 and
V2 >= 0.382 - 오차범위 and V2 <= 0.886 + 오차범위 and
V3 >= 1.618 - 오차범위 and v3 <= 2.618 + 오차범위 and
V4 >= 1.27 - 오차범위 and V4 <= 1.618 + 오차범위 Then
Result = "Butterfly Bearish";
Else If V1 >= 0.886 - 오차범위 and V1 <= 0.886 + 오차범위 and
V2 >= 0.382 - 오차범위 and V2 <= 0.886 + 오차범위 and
V3 >= 2.240 - 오차범위 and V3 <= 3.618 + 오차범위 and
V4 >= 1.618 - 오차범위 and V4 <= 1.618 + 오차범위 Then
Result = "Deep Crab Bearish";
Else If V1 >= 0.382 - 오차범위 and V1 <= 0.382 + 오차범위 and
V2 >= 0.382 - 오차범위 and V2 <= 0.886 + 오차범위 and
V3 >= 2.0 - 오차범위 and V3 <= 3.168 + 오차범위 and
V4 >= 1.13 - 오차범위 and V4 <= 1.13 + 오차범위 Then
Result = "ALT BAT Bearish";
}
Else If 고점[2,1] < 고점[3,1] and 고점[2,1] < 고점[1,1] and
저점[1,1] < 저점[2,1] Then
{
If V2 >= 1.13 - 오차범위 and V2 <= 1.618 + 오차범위 and
V3 >= 1.618 - 오차범위 and V3 <= 2.24 + 오차범위 and
V4 >= 0.886 - 오차범위 and V4 <= 1.13 + 오차범위 Then
Result = "Shark Bearish";
}
If Result != "" Then
{
sBar = Index - 고점[3,2];
eBar = Index - 저점[2,2];
If TL_GetBeginDate(TL[1]) == sDate[sBar] and TL_GetBeginTime(TL[1]) == sTime[sBar] Then
{
For j = 1 To 8
{
TL_Delete(TL[j]);
If j < 6 Then Text_Delete(TX[j]);
}
}
TL[1] = TL_New(sDate[sBar],sTime[sBar],고점[3,1],sDate[eBar],sTime[eBar],저점[2,1]);
sBar = Index - 저점[2,2];
eBar = Index - 고점[2,2];
TL[2] = TL_New(sDate[sBar],sTime[sBar],저점[2,1],sDate[eBar],sTime[eBar],고점[2,1]);
sBar = Index - 고점[2,2];
eBar = Index - 저점[1,2];
TL[3] = TL_New(sDate[sBar],sTime[sBar],고점[2,1],sDate[eBar],sTime[eBar],저점[1,1]);
sBar = Index - 저점[1,2];
eBar = Index - 고점[1,2];
TL[4] = TL_New(sDate[sBar],sTime[sBar],저점[1,1],sDate[eBar],sTime[eBar],고점[1,1]);
sBar = Index - 고점[3,2];
eBar = Index - 고점[2,2];
TL[5] = TL_New(sDate[sBar],sTime[sBar],고점[3,1],sDate[eBar],sTime[eBar],고점[2,1]);
sBar = Index - 고점[2,2];
eBar = Index - 고점[1,2];
TL[6] = TL_New(sDate[sBar],sTime[sBar],고점[2,1],sDate[eBar],sTime[eBar],고점[1,1]);
sBar = Index - 고점[3,2];
eBar = Index - 고점[1,2];
TL[7] = TL_New(sDate[sBar],sTime[sBar],고점[3,1],sDate[eBar],sTime[eBar],고점[1,1]);
sBar = Index - 저점[2,2];
eBar = Index - 저점[1,2];
TL[8] = TL_New(sDate[sBar],sTime[sBar],저점[2,1],sDate[eBar],sTime[eBar],저점[1,1]);
sBar = Index - round((고점[3,2] + 고점[2,2])/2,0);
TX[1] = Text_New(sDate[sBar],sTime[sBar],(고점[3,1]+고점[2,1])/2,NumToStr(V1,4)+" XA");
sBar = Index - round((저점[2,2] + 저점[1,2])/2,0);
TX[2] = Text_New(sDate[sBar],sTime[sBar],(저점[2,1]+저점[1,1])/2,NumToStr(V2,4)+" AB");
sBar = Index - round((고점[2,2] + 고점[1,2])/2,0);
TX[3] = Text_New(sDate[sBar],sTime[sBar],(고점[2,1]+고점[1,1])/2,NumToStr(V3,4)+" BC");
sBar = Index - round((고점[3,2] + 고점[1,2])/2,0);
TX[4] = Text_New(sDate[sBar],sTime[sBar],(고점[3,1]+고점[1,1])/2,NumToStr(V4,4)+" XA");
sBar = Index - round((고점[3,2] + 고점[1,2])/2,0);
TX[5] = Text_New(sDate[sBar],sTime[sBar],(고점[3,1]+고점[2,1])/2,Result);
For j = 1 To 8
{
TL_SetColor(TL[j],BLUE);
}
Text_SetStyle(TX[1],2,0);
Text_SetStyle(TX[2],2,0);
Text_SetStyle(TX[3],2,0);
Text_SetStyle(TX[4],2,0);
Text_SetStyle(TX[5],2,2);
}
}
}
If 처리구분 == "저점처리" Then
{
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;
XA = sqrt((고점[2,1]-저점[3,1])^2+(고점[2,2]-저점[3,2])^2);
AB = sqrt((고점[2,1]-저점[2,1])^2+(저점[2,2]-고점[2,2])^2);
BC = sqrt((고점[1,1]-저점[2,1])^2+(고점[1,2]-저점[2,2])^2);
CD = sqrt((고점[1,1]-저점[1,1])^2+(저점[1,2]-고점[1,2])^2);
V1 = AB/XA;
V2 = BC/AB;
V3 = CD/BC;
V4 = CD/XA;
Result = "";
If 저점[3,1] < 저점[1,1] and 저점[1,1] < 저점[2,1] and
고점[1,1] < 고점[2,1] Then
{
If V1 >= 0.618 - 오차범위 and V1 <= 0.618 + 오차범위 and
V2 >= 0.382 - 오차범위 and V2 <= 0.886 + 오차범위 and
V3 >= 1.13 - 오차범위 and V3 <= 1.618 + 오차범위 and
V4 >= 0.786 - 오차범위 and V4 <= 0.786 + 오차범위 Then
Result = "Gartley Bullish";
Else If V1 >= 0.382 - 오차범위 and V1 <= 0.5 + 오차범위 and
V2 >= 0.382 - 오차범위 and V2 <= 0.886 + 오차범위 and
V3 >= 1.618 - 오차범위 and v3 <= 2.618 + 오차범위 and
V4 >= 0.886 - 오차범위 and V4 <= 0.886 + 오차범위 Then
Result = "Bat Bullish";
}
Else If 저점[1,1] < 저점[3,1] and 저점[3,1] < 저점[2,1] and
고점[1,1] < 고점[2,1] Then
{
If V1 >= 0.382 - 오차범위 and V1 <= 0.618 + 오차범위 and
V2 >= 0.382 - 오차범위 and V2 <= 0.886 + 오차범위 and
V3 >= 2.240 - 오차범위 and V3 <= 3.618 + 오차범위 and
V4 >= 1.618 - 오차범위 and V4 <= 1.618 + 오차범위 Then
Result = "Crab Bullish";
Else If V1 >= 0.786 - 오차범위 and V1 <= 0.786 + 오차범위 and
V2 >= 0.382 - 오차범위 and V2 <= 0.886 + 오차범위 and
V3 >= 1.618 - 오차범위 and v3 <= 2.618 + 오차범위 and
V4 >= 1.27 - 오차범위 and V4 <= 1.618 + 오차범위 Then
Result = "Butterfly Bullish";
Else If V1 >= 0.886 - 오차범위 and V1 <= 0.886 + 오차범위 and
V2 >= 0.382 - 오차범위 and V2 <= 0.886 + 오차범위 and
V3 >= 2.240 - 오차범위 and V3 <= 3.618 + 오차범위 and
V4 >= 1.618 - 오차범위 and V4 <= 1.618 + 오차범위 Then
Result = "Deep Crab Bullish";
Else If V1 >= 0.382 - 오차범위 and V1 <= 0.382 + 오차범위 and
V2 >= 0.382 - 오차범위 and V2 <= 0.886 + 오차범위 and
V3 >= 2.0 - 오차범위 and V3 <= 3.168 + 오차범위 and
V4 >= 1.13 - 오차범위 and V4 <= 1.13 + 오차범위 Then
Result = "ALT BAT Bullish";
}
Else If 저점[1,1] < 저점[2,1] and 저점[3,1] < 저점[2,1] and
고점[2,1] < 고점[1,1] Then
{
If V2 >= 1.13 - 오차범위 and V2 <= 1.618 + 오차범위 and
V3 >= 1.618 - 오차범위 and V3 <= 2.24 + 오차범위 and
V4 >= 0.886 - 오차범위 and V4 <= 1.13 + 오차범위 Then
Result = "Shark Bullish";
}
If Result != "" Then
{
sBar = Index - 저점[3,2];
eBar = Index - 고점[2,2];
If TL_GetBeginDate(TL[1]) == sDate[sBar] and TL_GetBeginTime(TL[1]) == sTime[sBar] Then
{
For j = 1 To 8 {
TL_Delete(TL[j]);
If j < 6 Then Text_Delete(TX[j]);
}
}
TL[1] = TL_New(sDate[sBar],sTime[sBar],저점[3,1],sDate[eBar],sTime[eBar],고점[2,1]);
sBar = Index - 고점[2,2];
eBar = Index - 저점[2,2];
TL[2] = TL_New(sDate[sBar],sTime[sBar],고점[2,1],sDate[eBar],sTime[eBar],저점[2,1]);
sBar = Index - 저점[2,2];
eBar = Index - 고점[1,2];
TL[3] = TL_New(sDate[sBar],sTime[sBar],저점[2,1],sDate[eBar],sTime[eBar],고점[1,1]);
sBar = Index - 고점[1,2];
eBar = Index - 저점[1,2];
TL[4] = TL_New(sDate[sBar],sTime[sBar],고점[1,1],sDate[eBar],sTime[eBar],저점[1,1]);
sBar = Index - 저점[3,2];
eBar = Index - 저점[2,2];
TL[5] = TL_New(sDate[sBar],sTime[sBar],저점[3,1],sDate[eBar],sTime[eBar],저점[2,1]);
sBar = Index - 저점[2,2];
eBar = Index - 저점[1,2];
TL[6] = TL_New(sDate[sBar],sTime[sBar],저점[2,1],sDate[eBar],sTime[eBar],저점[1,1]);
sBar = Index - 저점[3,2];
eBar = Index - 저점[1,2];
TL[7] = TL_New(sDate[sBar],sTime[sBar],저점[3,1],sDate[eBar],sTime[eBar],저점[1,1]);
sBar = Index - 고점[2,2];
eBar = Index - 고점[1,2];
TL[8] = TL_New(sDate[sBar],sTime[sBar],고점[2,1],sDate[eBar],sTime[eBar],고점[1,1]);
sBar = Index - round((저점[3,2] + 저점[2,2])/2,0);
TX[1] = Text_New(sDate[sBar],sTime[sBar],(저점[3,1]+저점[2,1])/2,NumToStr(V1,4)+" XA");
sBar = Index - round((고점[2,2] + 고점[1,2])/2,0);
TX[2] = Text_New(sDate[sBar],sTime[sBar],(고점[2,1]+고점[1,1])/2,NumToStr(V2,4)+" AB");
sBar = Index - round((저점[2,2] + 저점[1,2])/2,0);
TX[3] = Text_New(sDate[sBar],sTime[sBar],(저점[2,1]+저점[1,1])/2,NumToStr(V3,4)+" BC");
sBar = Index - round((저점[3,2] + 저점[1,2])/2,0);
TX[4] = Text_New(sDate[sBar],sTime[sBar],(저점[3,1]+저점[1,1])/2,NumToStr(V4,4)+" XA");
sBar = Index - round((저점[3,2] + 저점[1,2])/2,0);
TX[5] = Text_New(sDate[sBar],sTime[sBar],(저점[3,1]+저점[2,1])/2,Result);
For j = 1 To 8
{
TL_SetColor(TL[j],RED);
}
Text_SetStyle(TX[1],2,1);
Text_SetStyle(TX[2],2,1);
Text_SetStyle(TX[3],2,1);
Text_SetStyle(TX[4],2,1);
Text_SetStyle(TX[5],2,2);
}
}
}
For j = 1 To 4 {
TL_SetSize(TL[j],3);
}
For j = 5 To 8 {
TL_SetSize(TL[j],0);
TL_SetColor(TL[j],BLACK);
}
----------------------------------------------------------------------------------
2. 일명 지그재그 패턴입니다! 첨부 파일 (그림2)올려 드려요!
틱, 분챠트 모두 가능하게 파동 변곡이 나타나면 반대 매수 또는 매도 화살표 신호가 나오게
부탁드립니다!
Input:length(12);
Var:j(0),lastHiVal(0),lastLoVal(0),sBar(0),eBar(0),TL1(0),
Text1(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
{
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);
}
TL1 = TL_New(sDate[sBar],sTime[sBar],저점[1,1],
sDate[eBar],sTime[eBar],고점[1,1]);
Text1 = Text_New(sDate[eBar],sTime[eBar],고점[1,1],
NumToStr(고점[1,1],2));
Text_SetStyle(Text1, 2, 1);
}
}
If 처리구분 == "저점처리" Then
{
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);
}
TL1 = TL_New(sDate[sBar],sTime[sBar],고점[1,1],
sDate[eBar],sTime[eBar],저점[1,1]);
Text1 = Text_New(sDate[eBar],sTime[eBar],저점[1,1],
NumToStr(저점[1,1],2));
Text_SetStyle(Text1, 2, 0);
}
}
TL_SetSize(TL1,3);
TL_SetColor(TL1,CYAN);
--------------------------------------------------------------------------------------
이전글