예스스탁
예스스탁 답변
2022-06-23 15:58:21
안녕하세요
예스스탁입니다.
매수와 반대조건으로 스위칭되게 작성해 드립니다.
Input:length(10);
Var:j(0),lastHiVal(0),lastLoVal(0),sBar(0),eBar(0),TL1(0),Text1(0),처리구분(""); #전환포인트(0), 저점확인(-1), 고점확인(1);
var:d1(0),t1(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 d1 == sDate[sBar] and
t1 == sTime[sBar] Then
{
TL_Delete(TL1);
Text_Delete(Text1);
}
TL1 = TL_New(sDate[sBar],sTime[sBar],저점[1,1],sDate[eBar],sTime[eBar],고점[1,1]);
d1 = sDate[sBar];
t1 = stime[sBar];
#전환포인트 = 고점확인;
Text1 = Text_New(sDate[eBar],sTime[eBar],고점[1,1],NumToStr(고점[1,1],2));
Text_SetStyle(Text1, 2, 1);
}
}
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 d1 == sDate[sBar] and
t1 == sTime[sBar] Then
{
TL_Delete(TL1);
Text_Delete(Text1);
}
TL1 = TL_New(sDate[sBar],sTime[sBar],고점[1,1],sDate[eBar],sTime[eBar],저점[1,1]);
d1 = sDate[sBar];
t1 = stime[sBar];
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);
if MarketPosition <= 0 and T == 1 and 고점[1,1] < 고점[2,1] and 저점[1,1] > 저점[2,1] Then
Buy("b1",AtStop,고점[2,1]);
if MarketPosition <= 0 and T == -1 and H < 고점[1,1] and 저점[1,1] > 저점[2,1] Then
Buy("b2",AtStop,고점[1,1]);
if MarketPosition >= 0 and T == -1 and 저점[1,1] > 저점[2,1] and 고점[1,1] < 고점[2,1] Then
Sell("s1",AtStop,저점[2,1]);
if MarketPosition >= 0 and T == 1 and L > 저점[1,1] and 고점[1,1] < 고점[2,1] Then
Sell("s2",AtStop,저점[1,1]);
즐거운 하루되세요
> 푸른 님이 쓴 글입니다.
> 제목 : 수식어 부탁드립니다
> Input:length(10);
Var:j(0),lastHiVal(0),lastLoVal(0),sBar(0),eBar(0),TL1(0),Text1(0),처리구분(""); #전환포인트(0), 저점확인(-1), 고점확인(1);
var:d1(0),t1(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 d1 == sDate[sBar] and
t1 == sTime[sBar] Then
{
TL_Delete(TL1);
Text_Delete(Text1);
}
TL1 = TL_New(sDate[sBar],sTime[sBar],저점[1,1],sDate[eBar],sTime[eBar],고점[1,1]);
d1 = sDate[sBar];
t1 = stime[sBar];
#전환포인트 = 고점확인;
Text1 = Text_New(sDate[eBar],sTime[eBar],고점[1,1],NumToStr(고점[1,1],2));
Text_SetStyle(Text1, 2, 1);
}
}
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 d1 == sDate[sBar] and
t1 == sTime[sBar] Then
{
TL_Delete(TL1);
Text_Delete(Text1);
}
TL1 = TL_New(sDate[sBar],sTime[sBar],고점[1,1],sDate[eBar],sTime[eBar],저점[1,1]);
d1 = sDate[sBar];
t1 = stime[sBar];
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);
if MarketPosition <= 0 and T == 1 and 고점[1,1] < 고점[2,1] and 저점[1,1] > 저점[2,1] Then
Buy("b1",AtStop,고점[2,1]);
if MarketPosition <= 0 and T == -1 and H < 고점[1,1] and 저점[1,1] > 저점[2,1] Then
Buy("b2",AtStop,고점[1,1]);
if MarketPosition == 1 Then
ExitLong("bx",AtStop,저점[1,1][BarsSinceEntry]);
------------
모루오님이 파동에 대한 문의를 귀사에서 수정후 올린 자료입니다.
후행성일것 같은 파란색의 분명한 선이 나오는데 변곡일때 바이후 청산이 아닌
바이후 셀로 반복되게 할 수는 없는지 문의 드립니다.