예스스탁
예스스탁 답변
2021-05-24 08:55:42
안녕하세요
예스스탁입니다.
"진입수량이 4계약 보다 같거나 크면 수익이 5만원 이면 전부 청산"
5만원에 해당되는 포인트값을 알수 없습니다.XX틱 수익이면 청산하게 작성해 드립니다.
input : 시스템적용일(20210521), 시스템시작시간(073000),시스템종료시간(210000);
input : ntime(30),P1(20),P2(60),XX(5);
var : cnt(0),Xcnt(0),Ecnt(0),Tcond(False) ;
var : S1(0),D1(0),TM(0),TF(0);
var : sum1(0),mav1(0),sum2(0),mav2(0);
Array : CC[100](0);
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;
TF = TM%ntime;
if Bdate != Bdate[1] or
(Bdate == Bdate[1] and ntime > 1 and TF < TF[1]) or
(Bdate == Bdate[1] and ntime > 1 and TM >= TM[1]+ntime) or
(Bdate == Bdate[1] and ntime == 1 and TM > TM[1]) Then
{
for cnt = 1 to 99
{
CC[cnt] = CC[cnt-1][1];
}
}
CC[0] = C;
if CC[P1-1] > 0 then
{
sum1 = 0;
for cnt = 0 to P1-1
{
sum1 = sum1+CC[cnt];
}
mav1 = sum1/P1;
}
if CC[P2-1] > 0 then
{
sum2 = 0;
for cnt = 0 to P2-1
{
sum2 = sum2+CC[cnt];
}
mav2 = sum2/P2;
}
}
if 시스템종료시간 > 시스템시작시간 then
SetStopEndofday(시스템종료시간);
Else
{
if sDate != sDate[1] Then
SetStopEndofday(시스템종료시간);
}
if (sDate != sDate[1] and sTime >= 시스템종료시간) or (sDate == sDate[1] and sTime >= 시스템종료시간 and sTime[1] < 시스템종료시간) then
{
Tcond = False;
}
if (sDate != sDate[1] and sTime >= 시스템시작시간) or (sDate == sDate[1] and sTime >= 시스템시작시간 and sTime[1] < 시스템시작시간) then
{
Tcond = true;
Ecnt = 0;
Xcnt = 0 ;
if 시스템종료시간 < 시스템시작시간 then SetStopEndofday(0);
}
if (MarketPosition != 0 and MarketPosition != MarketPosition[1]) or (MarketPosition == MarketPosition[1] and TotalTrades > TotalTrades[1]) Then
Ecnt = Ecnt + 1;
if sdate >= 시스템적용일 and Tcond == true Then
{
## 매매식 입력
If stime == 080000 and mav1 > mav2 and mav1 > 0 and mav2 > 0 Then Buy("SS1",OnClose,DEF,2);
If stime == 080000 and mav1 < mav2 and mav1 > 0 and mav2 > 0 Then Sell("DD1",OnClose,DEF,2);
}
## 추가 매수식
if MarketPosition == 1 Then
{
ExitLong("bx",AtLimit,EntryPrice+PriceScale*8);
if MaxContracts < 10 Then
Buy("b",AtLimit,LatestEntryPrice(0)-PriceScale*7,1);
if MaxContracts >= 4 Then
ExitLong("bx1",AtLimit,AvgEntryPrice+PriceScale*XX);
}
if MarketPosition == -1 Then
{
ExitShort("sx",AtLimit,EntryPrice-PriceScale*8);
if MaxContracts < 10 Then
Sell("s",AtLimit,LatestEntryPrice(0)+PriceScale*7,1);
if MaxContracts >= 4 Then
ExitShort("sx1",AtLimit,AvgEntryPrice-PriceScale*XX);
}
## 청산식
SetStopProfittarget(PriceScale*50,PointStop) ;
SetStopLoss(PriceScale*200,PointStop);
즐거운 하루되세요
> 요타 님이 쓴 글입니다.
> 제목 : 시스템 식 하나 요청 드립니다.
> * 항상 많은 도움에 고맙습니다.
* 기초 매매식 하나 요청 드립니다.
<조건>
.3분봉 차트 에서 타주기 30분봉 20이평선을 기준으로
8시 정각에 타주기 30분봉기준 20이평선이 타주기30분 60봉이평선 보다 크면(>=) buy(두계약)
8시 정각에 타주기 30분봉기준 20이평선이 타주기30분 60봉이평선 보다 작으면 sell(두계약)
<추가매수>
.buy진입후 진입가 보다 7틱씩 떨어질때 마다 1계약씩 추가진입
(마지막 진입가격기준 10계약 까지 7틱씩 하락 하면 추가진입 )
.sell 진입후 진입가 보다 7틱씩 올라갈때 마다 1계약씩 추가진입
(마지막 진입가격기준 10계약 7틱씩 상승 하면 추가진입 )
<청산>
. 최초 진입가 대비 8틱 상승 하면 모두 청산 or
. 추가매수되어 계약수가 4계약 보다 같거나 크면 수익이 5만원 이면 전부 청산 or
. 저녁 21시에는 모두 청산
## 아래식 사용
input : 시스템적용일(20210521), 시스템시작시간(073000),시스템종료시간(210000);
var : cnt(0),Xcnt(0),Ecnt(0),Tcond(False) ;
if 시스템종료시간 > 시스템시작시간 then
SetStopEndofday(시스템종료시간);
Else
{
if sDate != sDate[1] Then SetStopEndofday(시스템종료시간);
}
if (sDate != sDate[1] and sTime >= 시스템종료시간) or (sDate == sDate[1] and sTime >= 시스템종료시간 and sTime[1] < 시스템종료시간) then { Tcond = False; }
if (sDate != sDate[1] and sTime >= 시스템시작시간) or (sDate == sDate[1] and sTime >= 시스템시작시간 and sTime[1] < 시스템시작시간) then { Tcond = true; Ecnt = 0; Xcnt = 0 ; if 시스템종료시간 < 시스템시작시간 then SetStopEndofday(0); }
if (MarketPosition != 0 and MarketPosition != MarketPosition[1]) or (MarketPosition == MarketPosition[1] and TotalTrades > TotalTrades[1]) Then Ecnt = Ecnt + 1;
if sdate >= 시스템적용일 and Tcond == true Then {
## 매매식 입력
If stime = 080000 and Then Buy("SS1");
If stime = 080000 and Then Sell("DD1");
}
## 추가 매수식
## 청산식
SetStopProfittarget(PriceScale*50,PointStop) ;
SetStopLoss(PriceScale*200,PointStop);
* 고맙 습니다 좋은 한주 되십시요.
input : 시스템적용일(20210524), 시스템시작시간(080000),시스템종료시간(210000);
input : ntime(30),P1(10),P2(60),XX(10);
var : cnt(0),Xcnt(0),Ecnt(0),Tcond(False) ;
var : S1(0),D1(0),TM(0),TF(0);
var : sum1(0),mav1(0),sum2(0),mav2(0);
Array : CC[100](0);
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;
TF = TM%ntime;
if Bdate != Bdate[1] or
(Bdate == Bdate[1] and ntime > 1 and TF < TF[1]) or
(Bdate == Bdate[1] and ntime > 1 and TM >= TM[1]+ntime) or
(Bdate == Bdate[1] and ntime == 1 and TM > TM[1]) Then
{
for cnt = 1 to 99
{
CC[cnt] = CC[cnt-1][1];
}
}
CC[0] = C;
if CC[P1-1] > 0 then
{
sum1 = 0;
for cnt = 0 to P1-1
{
sum1 = sum1+CC[cnt];
}
mav1 = sum1/P1;
}
if CC[P2-1] > 0 then
{
sum2 = 0;
for cnt = 0 to P2-1
{
sum2 = sum2+CC[cnt];
}
mav2 = sum2/P2;
}
}
if 시스템종료시간 > 시스템시작시간 then
SetStopEndofday(시스템종료시간);
Else
{
if sDate != sDate[1] Then
SetStopEndofday(시스템종료시간);
}
if (sDate != sDate[1] and sTime >= 시스템종료시간) or (sDate == sDate[1] and sTime >= 시스템종료시간 and sTime[1] < 시스템종료시간) then
{
Tcond = False;
}
if (sDate != sDate[1] and sTime >= 시스템시작시간) or (sDate == sDate[1] and sTime >= 시스템시작시간 and sTime[1] < 시스템시작시간) then
{
Tcond = true;
Ecnt = 0;
Xcnt = 0 ;
if 시스템종료시간 < 시스템시작시간 then SetStopEndofday(0);
}
if (MarketPosition != 0 and MarketPosition != MarketPosition[1]) or (MarketPosition == MarketPosition[1] and TotalTrades > TotalTrades[1]) Then
Ecnt = Ecnt + 1;
if sdate >= 시스템적용일 and Tcond == true Then
{
## 매매식 입력
If stime < 080500 and mav1 > mav2 and mav1 > 0 and mav2 > 0 Then Buy("SS1",OnClose,DEF,2);
If stime < 080500 and mav1 < mav2 and mav1 > 0 and mav2 > 0 Then Sell("DD1",OnClose,DEF,2);
}
## 추가 매수식
if MarketPosition == 1 Then
{
ExitLong("bx",AtLimit,EntryPrice+PriceScale*8);
if MaxContracts < 10 Then
Buy("b",AtLimit,LatestEntryPrice(0)-PriceScale*7,1);
if MaxContracts >= 4 Then
ExitLong("bx1",AtLimit,AvgEntryPrice+PriceScale*XX);
}
if MarketPosition == -1 Then
{
ExitShort("sx",AtLimit,EntryPrice-PriceScale*8);
if MaxContracts < 10 Then
Sell("s",AtLimit,LatestEntryPrice(0)+PriceScale*7,1);
if MaxContracts >= 4 Then
ExitShort("sx1",AtLimit,AvgEntryPrice-PriceScale*XX);
}
## 청산식
SetStopProfittarget(PriceScale*50,PointStop) ;
SetStopLoss(PriceScale*200,PointStop);
> 예스스탁 님이 쓴 글입니다.
> 제목 : Re : 시스템 식 하나 요청 드립니다.
> 안녕하세요
예스스탁입니다.
"진입수량이 4계약 보다 같거나 크면 수익이 5만원 이면 전부 청산"
5만원에 해당되는 포인트값을 알수 없습니다.XX틱 수익이면 청산하게 작성해 드립니다.
input : 시스템적용일(20210521), 시스템시작시간(073000),시스템종료시간(210000);
input : ntime(30),P1(20),P2(60),XX(5);
var : cnt(0),Xcnt(0),Ecnt(0),Tcond(False) ;
var : S1(0),D1(0),TM(0),TF(0);
var : sum1(0),mav1(0),sum2(0),mav2(0);
Array : CC[100](0);
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;
TF = TM%ntime;
if Bdate != Bdate[1] or
(Bdate == Bdate[1] and ntime > 1 and TF < TF[1]) or
(Bdate == Bdate[1] and ntime > 1 and TM >= TM[1]+ntime) or
(Bdate == Bdate[1] and ntime == 1 and TM > TM[1]) Then
{
for cnt = 1 to 99
{
CC[cnt] = CC[cnt-1][1];
}
}
CC[0] = C;
if CC[P1-1] > 0 then
{
sum1 = 0;
for cnt = 0 to P1-1
{
sum1 = sum1+CC[cnt];
}
mav1 = sum1/P1;
}
if CC[P2-1] > 0 then
{
sum2 = 0;
for cnt = 0 to P2-1
{
sum2 = sum2+CC[cnt];
}
mav2 = sum2/P2;
}
}
if 시스템종료시간 > 시스템시작시간 then
SetStopEndofday(시스템종료시간);
Else
{
if sDate != sDate[1] Then
SetStopEndofday(시스템종료시간);
}
if (sDate != sDate[1] and sTime >= 시스템종료시간) or (sDate == sDate[1] and sTime >= 시스템종료시간 and sTime[1] < 시스템종료시간) then
{
Tcond = False;
}
if (sDate != sDate[1] and sTime >= 시스템시작시간) or (sDate == sDate[1] and sTime >= 시스템시작시간 and sTime[1] < 시스템시작시간) then
{
Tcond = true;
Ecnt = 0;
Xcnt = 0 ;
if 시스템종료시간 < 시스템시작시간 then SetStopEndofday(0);
}
if (MarketPosition != 0 and MarketPosition != MarketPosition[1]) or (MarketPosition == MarketPosition[1] and TotalTrades > TotalTrades[1]) Then
Ecnt = Ecnt + 1;
if sdate >= 시스템적용일 and Tcond == true Then
{
## 매매식 입력
If stime == 080000 and mav1 > mav2 and mav1 > 0 and mav2 > 0 Then Buy("SS1",OnClose,DEF,2);
If stime == 080000 and mav1 < mav2 and mav1 > 0 and mav2 > 0 Then Sell("DD1",OnClose,DEF,2);
}
## 추가 매수식
if MarketPosition == 1 Then
{
ExitLong("bx",AtLimit,EntryPrice+PriceScale*8);
if MaxContracts < 10 Then
Buy("b",AtLimit,LatestEntryPrice(0)-PriceScale*7,1);
if MaxContracts >= 4 Then
ExitLong("bx1",AtLimit,AvgEntryPrice+PriceScale*XX);
}
if MarketPosition == -1 Then
{
ExitShort("sx",AtLimit,EntryPrice-PriceScale*8);
if MaxContracts < 10 Then
Sell("s",AtLimit,LatestEntryPrice(0)+PriceScale*7,1);
if MaxContracts >= 4 Then
ExitShort("sx1",AtLimit,AvgEntryPrice-PriceScale*XX);
}
## 청산식
SetStopProfittarget(PriceScale*50,PointStop) ;
SetStopLoss(PriceScale*200,PointStop);
즐거운 하루되세요
> 요타 님이 쓴 글입니다.
> 제목 : 시스템 식 하나 요청 드립니다.
> * 항상 많은 도움에 고맙습니다.
* 기초 매매식 하나 요청 드립니다.
<조건>
.3분봉 차트 에서 타주기 30분봉 20이평선을 기준으로
8시 정각에 타주기 30분봉기준 20이평선이 타주기30분 60봉이평선 보다 크면(>=) buy(두계약)
8시 정각에 타주기 30분봉기준 20이평선이 타주기30분 60봉이평선 보다 작으면 sell(두계약)
<추가매수>
.buy진입후 진입가 보다 7틱씩 떨어질때 마다 1계약씩 추가진입
(마지막 진입가격기준 10계약 까지 7틱씩 하락 하면 추가진입 )
.sell 진입후 진입가 보다 7틱씩 올라갈때 마다 1계약씩 추가진입
(마지막 진입가격기준 10계약 7틱씩 상승 하면 추가진입 )
<청산>
. 최초 진입가 대비 8틱 상승 하면 모두 청산 or
. 추가매수되어 계약수가 4계약 보다 같거나 크면 수익이 5만원 이면 전부 청산 or
. 저녁 21시에는 모두 청산
## 아래식 사용
input : 시스템적용일(20210521), 시스템시작시간(073000),시스템종료시간(210000);
var : cnt(0),Xcnt(0),Ecnt(0),Tcond(False) ;
if 시스템종료시간 > 시스템시작시간 then
SetStopEndofday(시스템종료시간);
Else
{
if sDate != sDate[1] Then SetStopEndofday(시스템종료시간);
}
if (sDate != sDate[1] and sTime >= 시스템종료시간) or (sDate == sDate[1] and sTime >= 시스템종료시간 and sTime[1] < 시스템종료시간) then { Tcond = False; }
if (sDate != sDate[1] and sTime >= 시스템시작시간) or (sDate == sDate[1] and sTime >= 시스템시작시간 and sTime[1] < 시스템시작시간) then { Tcond = true; Ecnt = 0; Xcnt = 0 ; if 시스템종료시간 < 시스템시작시간 then SetStopEndofday(0); }
if (MarketPosition != 0 and MarketPosition != MarketPosition[1]) or (MarketPosition == MarketPosition[1] and TotalTrades > TotalTrades[1]) Then Ecnt = Ecnt + 1;
if sdate >= 시스템적용일 and Tcond == true Then {
## 매매식 입력
If stime = 080000 and Then Buy("SS1");
If stime = 080000 and Then Sell("DD1");
}
## 추가 매수식
## 청산식
SetStopProfittarget(PriceScale*50,PointStop) ;
SetStopLoss(PriceScale*200,PointStop);
* 고맙 습니다 좋은 한주 되십시요.
예스스탁
예스스탁 답변
2021-05-24 13:13:40
안녕하세요
예스스탁입니다.
파라미딩설정을 확인하시기 바랍니다.
또한 첫진입은 stime == 80000으로 되어 있어야 합니다.
stime < 80500이면 3분봉으로 8시봉 8시3분봉이 포함되서
첫진입식으로 2번이 들어가게 됩니다.
input : 시스템적용일(20210524), 시스템시작시간(080000),시스템종료시간(210000);
input : ntime(30),P1(10),P2(60),XX(10);
var : cnt(0),Xcnt(0),Ecnt(0),Tcond(False) ;
var : S1(0),D1(0),TM(0),TF(0);
var : sum1(0),mav1(0),sum2(0),mav2(0);
Array : CC[100](0);
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;
TF = TM%ntime;
if Bdate != Bdate[1] or
(Bdate == Bdate[1] and ntime > 1 and TF < TF[1]) or
(Bdate == Bdate[1] and ntime > 1 and TM >= TM[1]+ntime) or
(Bdate == Bdate[1] and ntime == 1 and TM > TM[1]) Then
{
for cnt = 1 to 99
{
CC[cnt] = CC[cnt-1][1];
}
}
CC[0] = C;
if CC[P1-1] > 0 then
{
sum1 = 0;
for cnt = 0 to P1-1
{
sum1 = sum1+CC[cnt];
}
mav1 = sum1/P1;
}
if CC[P2-1] > 0 then
{
sum2 = 0;
for cnt = 0 to P2-1
{
sum2 = sum2+CC[cnt];
}
mav2 = sum2/P2;
}
}
if 시스템종료시간 > 시스템시작시간 then
SetStopEndofday(시스템종료시간);
Else
{
if sDate != sDate[1] Then
SetStopEndofday(시스템종료시간);
}
if (sDate != sDate[1] and sTime >= 시스템종료시간) or (sDate == sDate[1] and sTime >= 시스템종료시간 and sTime[1] < 시스템종료시간) then
{
Tcond = False;
}
if (sDate != sDate[1] and sTime >= 시스템시작시간) or (sDate == sDate[1] and sTime >= 시스템시작시간 and sTime[1] < 시스템시작시간) then
{
Tcond = true;
Ecnt = 0;
Xcnt = 0 ;
if 시스템종료시간 < 시스템시작시간 then SetStopEndofday(0);
}
if (MarketPosition != 0 and MarketPosition != MarketPosition[1]) or (MarketPosition == MarketPosition[1] and TotalTrades > TotalTrades[1]) Then
Ecnt = Ecnt + 1;
if sdate >= 시스템적용일 and Tcond == true Then
{
## 매매식 입력
If stime == 080000 and mav1 > mav2 and mav1 > 0 and mav2 > 0 Then Buy("SS1",OnClose,DEF,2);
If stime == 080000 and mav1 < mav2 and mav1 > 0 and mav2 > 0 Then Sell("DD1",OnClose,DEF,2);
}
## 추가 매수식
if MarketPosition == 1 Then
{
ExitLong("bx",AtLimit,EntryPrice+PriceScale*8);
if MaxContracts < 10 Then
Buy("b",AtLimit,LatestEntryPrice(0)-PriceScale*7,1);
if MaxContracts >= 4 Then
ExitLong("bx1",AtLimit,AvgEntryPrice+PriceScale*XX);
}
if MarketPosition == -1 Then
{
ExitShort("sx",AtLimit,EntryPrice-PriceScale*8);
if MaxContracts < 10 Then
Sell("s",AtLimit,LatestEntryPrice(0)+PriceScale*7,1);
if MaxContracts >= 4 Then
ExitShort("sx1",AtLimit,AvgEntryPrice-PriceScale*XX);
}
## 청산식
SetStopProfittarget(PriceScale*50,PointStop) ;
SetStopLoss(PriceScale*200,PointStop);
즐거운 하루되세요
> 요타 님이 쓴 글입니다.
> 제목 : 추가매수가 안됨니다
>
input : 시스템적용일(20210524), 시스템시작시간(080000),시스템종료시간(210000);
input : ntime(30),P1(10),P2(60),XX(10);
var : cnt(0),Xcnt(0),Ecnt(0),Tcond(False) ;
var : S1(0),D1(0),TM(0),TF(0);
var : sum1(0),mav1(0),sum2(0),mav2(0);
Array : CC[100](0);
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;
TF = TM%ntime;
if Bdate != Bdate[1] or
(Bdate == Bdate[1] and ntime > 1 and TF < TF[1]) or
(Bdate == Bdate[1] and ntime > 1 and TM >= TM[1]+ntime) or
(Bdate == Bdate[1] and ntime == 1 and TM > TM[1]) Then
{
for cnt = 1 to 99
{
CC[cnt] = CC[cnt-1][1];
}
}
CC[0] = C;
if CC[P1-1] > 0 then
{
sum1 = 0;
for cnt = 0 to P1-1
{
sum1 = sum1+CC[cnt];
}
mav1 = sum1/P1;
}
if CC[P2-1] > 0 then
{
sum2 = 0;
for cnt = 0 to P2-1
{
sum2 = sum2+CC[cnt];
}
mav2 = sum2/P2;
}
}
if 시스템종료시간 > 시스템시작시간 then
SetStopEndofday(시스템종료시간);
Else
{
if sDate != sDate[1] Then
SetStopEndofday(시스템종료시간);
}
if (sDate != sDate[1] and sTime >= 시스템종료시간) or (sDate == sDate[1] and sTime >= 시스템종료시간 and sTime[1] < 시스템종료시간) then
{
Tcond = False;
}
if (sDate != sDate[1] and sTime >= 시스템시작시간) or (sDate == sDate[1] and sTime >= 시스템시작시간 and sTime[1] < 시스템시작시간) then
{
Tcond = true;
Ecnt = 0;
Xcnt = 0 ;
if 시스템종료시간 < 시스템시작시간 then SetStopEndofday(0);
}
if (MarketPosition != 0 and MarketPosition != MarketPosition[1]) or (MarketPosition == MarketPosition[1] and TotalTrades > TotalTrades[1]) Then
Ecnt = Ecnt + 1;
if sdate >= 시스템적용일 and Tcond == true Then
{
## 매매식 입력
If stime < 080500 and mav1 > mav2 and mav1 > 0 and mav2 > 0 Then Buy("SS1",OnClose,DEF,2);
If stime < 080500 and mav1 < mav2 and mav1 > 0 and mav2 > 0 Then Sell("DD1",OnClose,DEF,2);
}
## 추가 매수식
if MarketPosition == 1 Then
{
ExitLong("bx",AtLimit,EntryPrice+PriceScale*8);
if MaxContracts < 10 Then
Buy("b",AtLimit,LatestEntryPrice(0)-PriceScale*7,1);
if MaxContracts >= 4 Then
ExitLong("bx1",AtLimit,AvgEntryPrice+PriceScale*XX);
}
if MarketPosition == -1 Then
{
ExitShort("sx",AtLimit,EntryPrice-PriceScale*8);
if MaxContracts < 10 Then
Sell("s",AtLimit,LatestEntryPrice(0)+PriceScale*7,1);
if MaxContracts >= 4 Then
ExitShort("sx1",AtLimit,AvgEntryPrice-PriceScale*XX);
}
## 청산식
SetStopProfittarget(PriceScale*50,PointStop) ;
SetStopLoss(PriceScale*200,PointStop);
> 예스스탁 님이 쓴 글입니다.
> 제목 : Re : 시스템 식 하나 요청 드립니다.
> 안녕하세요
예스스탁입니다.
"진입수량이 4계약 보다 같거나 크면 수익이 5만원 이면 전부 청산"
5만원에 해당되는 포인트값을 알수 없습니다.XX틱 수익이면 청산하게 작성해 드립니다.
input : 시스템적용일(20210521), 시스템시작시간(073000),시스템종료시간(210000);
input : ntime(30),P1(20),P2(60),XX(5);
var : cnt(0),Xcnt(0),Ecnt(0),Tcond(False) ;
var : S1(0),D1(0),TM(0),TF(0);
var : sum1(0),mav1(0),sum2(0),mav2(0);
Array : CC[100](0);
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;
TF = TM%ntime;
if Bdate != Bdate[1] or
(Bdate == Bdate[1] and ntime > 1 and TF < TF[1]) or
(Bdate == Bdate[1] and ntime > 1 and TM >= TM[1]+ntime) or
(Bdate == Bdate[1] and ntime == 1 and TM > TM[1]) Then
{
for cnt = 1 to 99
{
CC[cnt] = CC[cnt-1][1];
}
}
CC[0] = C;
if CC[P1-1] > 0 then
{
sum1 = 0;
for cnt = 0 to P1-1
{
sum1 = sum1+CC[cnt];
}
mav1 = sum1/P1;
}
if CC[P2-1] > 0 then
{
sum2 = 0;
for cnt = 0 to P2-1
{
sum2 = sum2+CC[cnt];
}
mav2 = sum2/P2;
}
}
if 시스템종료시간 > 시스템시작시간 then
SetStopEndofday(시스템종료시간);
Else
{
if sDate != sDate[1] Then
SetStopEndofday(시스템종료시간);
}
if (sDate != sDate[1] and sTime >= 시스템종료시간) or (sDate == sDate[1] and sTime >= 시스템종료시간 and sTime[1] < 시스템종료시간) then
{
Tcond = False;
}
if (sDate != sDate[1] and sTime >= 시스템시작시간) or (sDate == sDate[1] and sTime >= 시스템시작시간 and sTime[1] < 시스템시작시간) then
{
Tcond = true;
Ecnt = 0;
Xcnt = 0 ;
if 시스템종료시간 < 시스템시작시간 then SetStopEndofday(0);
}
if (MarketPosition != 0 and MarketPosition != MarketPosition[1]) or (MarketPosition == MarketPosition[1] and TotalTrades > TotalTrades[1]) Then
Ecnt = Ecnt + 1;
if sdate >= 시스템적용일 and Tcond == true Then
{
## 매매식 입력
If stime == 080000 and mav1 > mav2 and mav1 > 0 and mav2 > 0 Then Buy("SS1",OnClose,DEF,2);
If stime == 080000 and mav1 < mav2 and mav1 > 0 and mav2 > 0 Then Sell("DD1",OnClose,DEF,2);
}
## 추가 매수식
if MarketPosition == 1 Then
{
ExitLong("bx",AtLimit,EntryPrice+PriceScale*8);
if MaxContracts < 10 Then
Buy("b",AtLimit,LatestEntryPrice(0)-PriceScale*7,1);
if MaxContracts >= 4 Then
ExitLong("bx1",AtLimit,AvgEntryPrice+PriceScale*XX);
}
if MarketPosition == -1 Then
{
ExitShort("sx",AtLimit,EntryPrice-PriceScale*8);
if MaxContracts < 10 Then
Sell("s",AtLimit,LatestEntryPrice(0)+PriceScale*7,1);
if MaxContracts >= 4 Then
ExitShort("sx1",AtLimit,AvgEntryPrice-PriceScale*XX);
}
## 청산식
SetStopProfittarget(PriceScale*50,PointStop) ;
SetStopLoss(PriceScale*200,PointStop);
즐거운 하루되세요
> 요타 님이 쓴 글입니다.
> 제목 : 시스템 식 하나 요청 드립니다.
> * 항상 많은 도움에 고맙습니다.
* 기초 매매식 하나 요청 드립니다.
<조건>
.3분봉 차트 에서 타주기 30분봉 20이평선을 기준으로
8시 정각에 타주기 30분봉기준 20이평선이 타주기30분 60봉이평선 보다 크면(>=) buy(두계약)
8시 정각에 타주기 30분봉기준 20이평선이 타주기30분 60봉이평선 보다 작으면 sell(두계약)
<추가매수>
.buy진입후 진입가 보다 7틱씩 떨어질때 마다 1계약씩 추가진입
(마지막 진입가격기준 10계약 까지 7틱씩 하락 하면 추가진입 )
.sell 진입후 진입가 보다 7틱씩 올라갈때 마다 1계약씩 추가진입
(마지막 진입가격기준 10계약 7틱씩 상승 하면 추가진입 )
<청산>
. 최초 진입가 대비 8틱 상승 하면 모두 청산 or
. 추가매수되어 계약수가 4계약 보다 같거나 크면 수익이 5만원 이면 전부 청산 or
. 저녁 21시에는 모두 청산
## 아래식 사용
input : 시스템적용일(20210521), 시스템시작시간(073000),시스템종료시간(210000);
var : cnt(0),Xcnt(0),Ecnt(0),Tcond(False) ;
if 시스템종료시간 > 시스템시작시간 then
SetStopEndofday(시스템종료시간);
Else
{
if sDate != sDate[1] Then SetStopEndofday(시스템종료시간);
}
if (sDate != sDate[1] and sTime >= 시스템종료시간) or (sDate == sDate[1] and sTime >= 시스템종료시간 and sTime[1] < 시스템종료시간) then { Tcond = False; }
if (sDate != sDate[1] and sTime >= 시스템시작시간) or (sDate == sDate[1] and sTime >= 시스템시작시간 and sTime[1] < 시스템시작시간) then { Tcond = true; Ecnt = 0; Xcnt = 0 ; if 시스템종료시간 < 시스템시작시간 then SetStopEndofday(0); }
if (MarketPosition != 0 and MarketPosition != MarketPosition[1]) or (MarketPosition == MarketPosition[1] and TotalTrades > TotalTrades[1]) Then Ecnt = Ecnt + 1;
if sdate >= 시스템적용일 and Tcond == true Then {
## 매매식 입력
If stime = 080000 and Then Buy("SS1");
If stime = 080000 and Then Sell("DD1");
}
## 추가 매수식
## 청산식
SetStopProfittarget(PriceScale*50,PointStop) ;
SetStopLoss(PriceScale*200,PointStop);
* 고맙 습니다 좋은 한주 되십시요.