예스스탁
예스스탁 답변
2021-10-25 13:18:51
안녕하세요
예스스탁입니다.
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);
Array : H1[50](0),L1[50](0),H2[50](0),L2[50](0);
var : Tcond(false);
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;
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 H1[n] > 0 and H2[n] > 0 and H < min(H1[n],H2[n])+PriceScale*1 Then
Buy("b",AtStop,max(H1[n],H2[n]+PriceScale*1));
if MarketPosition >= 0 and L1[n] > 0 and L2[n] > 0 and L > max(L1[n],L2[n])-PriceScale*1 Then
Sell("s",AtStop,min(L1[n],L2[n])-PriceScale*1);
if MarketPosition == 1 Then
ExitLong("bx",AtStop,L-PriceScale*1);
if MarketPosition == -1 Then
ExitShort("sx",AtStop,H+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);
}
}
즐거운 하루되세요
> jesten77 님이 쓴 글입니다.
> 제목 : 문의드립니다
>
항상 감사드립니다~~
6분봉과 30분봉, 매수 매도 신호가 나오도록 해주세요.
1. 10번째 이전 캔들의 고가를 돌파할때 매수 신호, 저가를 깰때 매도 신호가 나오도록 해주세요. 종가가 아닌 돌파나 깰때 바로 나오도록 해주세요.
2. 현재 캔들에서 10번째 이전 캔들의 고가를 돌파하거나 저가를 깨는 일이 같이 일어날 때는 일어나는 그 시각에 해당되는 매수, 매도 신호가 나오도록 해주세요.
3. 10번째 이전 캔들의 고가 위에서 현재 캔들이 앞 캔들의 고가를 높이는 경우, 매수 신호가 나오도록 해주세요.
4. 10번째 이전 캔들의 저가 아래에서 현재 캔들이 앞 캔들의 저가를 깨는 경우 매도 신호가 나오도록 해주세요.
5. 6분봉과 30분봉이 같은 방향으로 신호가 있을 때만 그 방향으로 매수, 매도 진입하도록 해주세요.
4. 같은 방향의 신호가 있을 시 6분봉의 종가에 매수, 매도 진입합니다.
5. 같은 방향으로 진입신호가 나왔어도 아래의 경우 진입하지 않게 해주세요.
- 앞캔들의 고가를 높이거나 저가를 깨거나 하지 않고 끝난 캔들.
- 매수는 양봉 종가에만, 매도는 음봉 종가에만 진입하도록 해주세요.
6.진입한 후 익절, 손절 청산 후에 6분과 30분봉에 같은 방향 신호가 있으면 같은 조건으로 계속 거래되도록 해주세요.
아래 수식에서 수정 부탁드립니다
감사합니다~~^^
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);
Array : H1[50](0),L1[50](0),H2[50](0),L2[50](0);
var : Tcond(false);
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;
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 H1[n] > 0 and H2[n] > 0 and C > H1[n] and C > H2[n] and C > O Then
Buy();
if L1[n] > 0 and L2[n] > 0 and C < L1[n] and C < L2[n] and C < O Then
Sell();
if MarketPosition == 1 Then
ExitLong("bx",AtStop,L-PriceScale*1);
if MarketPosition == -1 Then
ExitShort("sx",AtStop,H+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);
}
}