답변완료
수식어 부탁드립니다
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]);
------------
모루오님이 파동에 대한 문의를 귀사에서 수정후 올린 자료입니다.
후행성일것 같은 파란색의 분명한 선이 나오는데 변곡일때 바이후 청산이 아닌
바이후 셀로 반복되게 할 수는 없는지 문의 드립니다.
2022-06-23
1337
글번호 160142
시스템
답변완료
문의 드립니다.
input : 익절틱수(110),손절틱수(20);
var : DD(0),Year(0),V1(0),V2(0),V3(0),V4(0),summer(False);
var : ST(0),ET(0),entry(0);
if NextBarSdate != sDate Then
{
DD = DayOfWeek(NextBarSdate);
Year = Floor(NextBarSdate/10000);
V1 = (10000 * Year) + (100 * 3) + 1;
V2 = 15 - dayofweek(v1);
v3 = (10000 * Year) + (100 * 11) + 1;
v4 = 8 - dayofweek(v3);
Summer = NextBarSdate > (10000 * Year) + (100 * 3) + v2
And NextBarSdate < (10000 * Year) + (100 * 11) + v4;
if summer == true Then
{
ST = 70000;
ET = 55000;
}
Else
{
ST = 80000;
ET = 65000;
}
}
if Year > 0 Then
{
IF ET > ST Then
SetStopEndofday(ET);
Else
{
if sDate != sDate[1] Then
SetStopEndofday(ET);
}
if Bdate != Bdate[1] Then
{
entry = 0;
}
if (MarketPosition != 0 and MarketPosition != MarketPosition[1]) or
(MarketPosition == MarketPosition[1] and TotalTrades > TotalTrades[1]) Then
entry = entry+1;
if ((NextBarSdate != sDate and NextBarStime >= ST) or
(NextBarSdate == sDate and NextBarStime >= ST and sTime < ST)) Then
{
IF ET <= ST Then
{
SetStopEndofday(0);
}
if NextBarOpen < C Then
Buy("b1",AtStop,NextBarOpen+PriceScale*1);
if NextBarOpen > C Then
Sell("s1",AtStop,NextBarOpen-PriceScale*1);
}
}
SetStopProfittarget(PriceScale*익절틱수,PointStop);
SetStopLoss(PriceScale*손절틱수,PointStop);
------------------
진입 청산 2회로 부탁드립니다.
2022-06-23
951
글번호 160116
시스템