답변완료
검토부탁드립니다.
안녕하세요?
다음수식에서 중심라인을 체크해주세요
시작이 전일 중심라인에서 시작하지 않고 종가에서 시작합니다.
감사합니다.
input : 색상1(green),색상2(RED),색상3(BLUE),색상4(BLACK),색상5(cyan);
input : 굵기1(0),굵기2(0),굵기3(0),굵기4(0),굵기5(5);
var : TL1(0),TL2(0),TL3(0),TL4(0),TL5(0);
if Index == 0 or (sTime >= 141500 and sTime[1] < 141500) Then
{
var1 = sDate;
Var2 = stime;
}
if Bdate != Bdate[1] Then
{
if var1 > 0 and Var2 > 0 Then
{
TL1 = TL_New(var1,Var2,DayOpen(0),sDate,sTime,Dayopen(0));
TL2 = TL_New(var1,Var2,DayHigh(1),sDate,sTime,DayHigh(1));
TL3 = TL_New(var1,Var2,DayLow(1),sDate,sTime,DayLow(1));
TL4 = TL_New(var1,Var2,DayClose(1),sDate,sTime,DayClose(1));
TL5 = TL_New(var1,Var2,DayClose(1),sDate,sTime,(DayHigh(1)+DayLow(1))/2);
#색상
TL_SetColor(TL1,green);
TL_SetColor(TL2,RED);
TL_SetColor(TL3,BLUE);
TL_SetColor(TL4,BLACK);
TL_SetColor(TL5,cyan);
#굵기
TL_SetSize(TL1,굵기1);
TL_SetSize(TL2,굵기2);
TL_SetSize(TL3,굵기3);
TL_SetSize(TL4,굵기4);
TL_SetSize(TL5,굵기5);
}
}
Else
{
if sTime < 103000 Then
{
TL_SetEnd(TL1,sDate,sTime,DayOpen(0));
TL_SetEnd(TL2,sDate,sTime,DayHigh(1));
TL_SetEnd(TL3,sDate,sTime,DayLow(1));
TL_SetEnd(TL4,sDate,sTime,DayClose(1));
TL_SetEnd(TL5,sDate,sTime,(DayHigh(1)+DayLow(1))/2);
}
}
2021-10-29
560
글번호 153240
지표
답변완료
문의드립니다
수정해주신 수식으로 데모해본 결과 문의 사항이 있어 남김니다.
데모 차트와 거래내역 표시해서 같이 올려 드립니다.
# 먼저 즉시 진입 수식 부분입니다.
1. 22:36 분, 22:51분, 24:00분 은 조건이 맞지 않는데 진입하였습니다.
3번 모두 이전 캔들의 최고가를 돌파하지 않았는데도 매수 진입한 내용입니다.
그리고 현재 거래시간 전에 매수 매도 진입이 되어 익절, 손절이 안된 경우, 거래시간이 종료되면 종료시간에 자동 청산하는데요. 종료시간 이후에 익절 손절 청산 조건대로 청산 가능한 수식이 있으면 부탁드립니다.
아래 수식에서 수정할 부분이 있는지 확인 부탁드립니다.
input : ntime1(6),ntime2(30),n(10);
input : StartTime(222500),EndTime(010000);
input : 익절틱수(50),손절틱수(50);
var : S1(0),D1(0),TM(0),TF1(0),TF2(0),cnt(0),HH(0),LL(0);
var : Tcond(false),BE1(False),BE2(False),SE1(False),SE2(False);
Array : H1[50](0),L1[50](0),H2[50](0),L2[50](0);
if (sdate != sdate[1] and stime >= EndTime) or
(sdate == sdate[1] and stime >= EndTime and stime[1] < EndTime) Then
Tcond = False;
if (sdate != sdate[1] and stime >= StartTime) or
(sdate == sdate[1] and stime >= StartTime and stime[1] < StartTime) Then
Tcond = true;
if Bdate != Bdate[1] Then
{
S1 = TimeToMinutes(stime);
D1 = sdate;
}
if D1 > 0 then
{
if sdate == D1 Then
TM = TimeToMinutes(stime)-S1;
Else
TM = TimeToMinutes(stime)+1440-S1;
TF1 = TM%ntime1;
TF2 = TM%ntime2;
if Bdate != Bdate[1] or
(Bdate == Bdate[1] and ntime1 > 1 and TF1 < TF1[1]) or
(Bdate == Bdate[1] and ntime1 > 1 and TM >= TM[1]+ntime1) or
(Bdate == Bdate[1] and ntime1 == 1 and TM > TM[1]) Then
{
H1[0] = H;
L1[0] = L;
For cnt = 1 to 49
{
H1[cnt] = H1[cnt-1][1];
L1[cnt] = L1[cnt-1][1];
}
}
if H1[0] > 0 and H > H1[0] Then
H1[0] = H;
if L1[0] > 0 and L < L1[0] Then
L1[0] = L;
HH = 0;
LL = 0;
if H1[n] > 0 and L1[n] > 0 Then
{
For cnt = 1 to N
{
if HH == 0 or (HH > 0 and H1[cnt] > HH) Then
HH = H1[cnt];
if LL == 0 or (LL > 0 and L1[cnt] < LL) Then
LL = L1[cnt];
}
}
if Bdate != Bdate[1] or
(Bdate == Bdate[1] and ntime2 > 1 and TF2 < TF2[1]) or
(Bdate == Bdate[1] and ntime2 > 1 and TM >= TM[1]+ntime2) or
(Bdate == Bdate[1] and ntime2 == 1 and TM > TM[1]) Then
{
H2[0] = H;
L2[0] = L;
For cnt = 1 to 49
{
H2[cnt] = H2[cnt-1][1];
L2[cnt] = L2[cnt-1][1];
}
}
if H2[0] > 0 and H > H2[0] Then
H2[0] = H;
if L2[0] > 0 and L < L2[0] Then
L2[0] = L;
if Tcond == true Then
{
if MarketPosition <= 0 and HH > 0 and H2[n] > 0 Then
Buy("b3",AtStop,max(HH,H2[n])+PriceScale*1);
if MarketPosition >= 0 and LL > 0 and L2[n] > 0 Then
Sell("s3",AtStop,min(LL,L2[n])-PriceScale*1);
}
}
SetStopProfittarget(PriceScale*익절틱수,PointStop);
SetStopLoss(PriceScale*손절틱수,PointStop);
IF Endtime > starttime Then
SetStopEndofday(Endtime);
Else
{
if sDate != sDate[1] Then
SetStopEndofday(Endtime);
}
if (sdate != sdate[1] and stime >= StartTime) or
(sdate == sdate[1] and stime >= StartTime and stime[1] < StartTime) Then
{
IF Endtime <= starttime Then
{
SetStopEndofday(0);
}
}
2021-10-29
559
글번호 153233
시스템
답변완료
문의드립니다
수정해주신 수식으로 데모해본 결과 문의 사항이 있어 남김니다.
데모 차트와 거래내역 표시해서 같이 올려 드립니다.
# 먼저 종가 진입 수식 부분입니다.
1. 22:32 분에 조건이 맞는데도 진입하지 않고 22:34분에 진입했습니다.
32분에 진입했으면 익절인데 34분에 진입해서 손절이 되었습니다.
2. 22:46 분에 진입한 것은 1분봉으로 구분해서 봐도 익절인데 익절되지 않고 손절 되었습니다.
아래 수식에서 수정할 부분이 있는지 확인 부탁드립니다.
그리고 종가 진입은 조건이 맞더라도 매수는 양봉에만, 매도는 음봉에만 진입하는 것이 반영되어 있지 않으면 반영해주세요.
input : ntime1(6),ntime2(30),n(10);
input : StartTime(222500),EndTime(010000);
input : 익절틱수(50),손절틱수(50);
var : S1(0),D1(0),TM(0),TF1(0),TF2(0),cnt(0),HH(0),LL(0);
var : Tcond(false),BE1(False),BE2(False),SE1(False),SE2(False);
Array : H1[50](0),L1[50](0),H2[50](0),L2[50](0);
if (sdate != sdate[1] and stime >= EndTime) or
(sdate == sdate[1] and stime >= EndTime and stime[1] < EndTime) Then
Tcond = False;
if (sdate != sdate[1] and stime >= StartTime) or
(sdate == sdate[1] and stime >= StartTime and stime[1] < StartTime) Then
Tcond = true;
if Bdate != Bdate[1] Then
{
S1 = TimeToMinutes(stime);
D1 = sdate;
}
if D1 > 0 then
{
if sdate == D1 Then
TM = TimeToMinutes(stime)-S1;
Else
TM = TimeToMinutes(stime)+1440-S1;
TF1 = TM%ntime1;
TF2 = TM%ntime2;
if Bdate != Bdate[1] or
(Bdate == Bdate[1] and ntime1 > 1 and TF1 < TF1[1]) or
(Bdate == Bdate[1] and ntime1 > 1 and TM >= TM[1]+ntime1) or
(Bdate == Bdate[1] and ntime1 == 1 and TM > TM[1]) Then
{
H1[0] = H;
L1[0] = L;
For cnt = 1 to 49
{
H1[cnt] = H1[cnt-1][1];
L1[cnt] = L1[cnt-1][1];
}
}
if H1[0] > 0 and H > H1[0] Then
H1[0] = H;
if L1[0] > 0 and L < L1[0] Then
L1[0] = L;
HH = 0;
LL = 0;
if H1[n] > 0 and L1[n] > 0 Then
{
For cnt = 1 to N
{
if HH == 0 or (HH > 0 and H1[cnt] > HH) Then
HH = H1[cnt];
if LL == 0 or (LL > 0 and L1[cnt] < LL) Then
LL = L1[cnt];
}
}
if Bdate != Bdate[1] or
(Bdate == Bdate[1] and ntime2 > 1 and TF2 < TF2[1]) or
(Bdate == Bdate[1] and ntime2 > 1 and TM >= TM[1]+ntime2) or
(Bdate == Bdate[1] and ntime2 == 1 and TM > TM[1]) Then
{
H2[0] = H;
L2[0] = L;
For cnt = 1 to 49
{
H2[cnt] = H2[cnt-1][1];
L2[cnt] = L2[cnt-1][1];
}
}
if H2[0] > 0 and H > H2[0] Then
H2[0] = H;
if L2[0] > 0 and L < L2[0] Then
L2[0] = L;
if Tcond == true Then
{
if MarketPosition <= 0 and HH > 0 and H2[n] > 0 and C > max(HH,H2[n])+PriceScale*1 Then
Buy("b3");
if MarketPosition >= 0 and LL > 0 and L2[n] > 0 and C < min(LL,L2[n])-PriceScale*1 Then
Sell("s3");
}
}
SetStopProfittarget(PriceScale*익절틱수,PointStop);
SetStopLoss(PriceScale*손절틱수,PointStop);
IF Endtime > starttime Then
SetStopEndofday(Endtime);
Else
{
if sDate != sDate[1] Then
SetStopEndofday(Endtime);
}
if (sdate != sdate[1] and stime >= StartTime) or
(sdate == sdate[1] and stime >= StartTime and stime[1] < StartTime) Then
{
IF Endtime <= starttime Then
{
SetStopEndofday(0);
}
}
2021-10-28
734
글번호 153232
시스템