예스스탁
예스스탁 답변
2021-06-18 11:21:34
안녕하세요
예스스탁입니다.
Input : Period(10), Period1(5), Period2(5),P1(5),P2(20);
var : stok(0),stod(0),mav1(0),mav2(0),T(0);
stok = StochasticsK(Period,Period1);
stod = StochasticsD(Period,Period1,Period2);
mav1 = ma(C,p1);
mav2 = ma(c,p2);
if CrossDown(stok,stod) Then
{
T = -1;
if stok < 80 Then
T = 0;
}
if Crossup(stok,stod) Then
{
T = 1;
if stok > 20 Then
T = 0;
}
if T == -1 and CrossDown(mav1,mav2) Then
{
T = -2;
Sell("s",AtMarket);
}
if T == 1 and CrossUp(mav1,mav2) Then
{
T = 2;
Buy("b",AtMarket);
}
SetStopLoss(0.5,PointStop);
SetStopProfittarget(0.75,PointStop);
var : month(0),nday(0),week(0);
month = int(date/100)-int(date/10000)*100;
nday = date - int(date/100)*100;
Week = DayOfWeek(date);
if (month%3 == 0 and nday >= 8 and nday <= 14 and week == 4) then
{
SetStopEndofday(151500);
}
Else
{
SetStopEndofday(153000);
}
즐거운 하루되세요
> 손추 님이 쓴 글입니다.
> 제목 : 추가 요청
> 아래 코딩해 주신 것에 당일 종가 청산 조건을 추가해 주셨으면 합니다.
오버나잇 되도록 되어 있군요.
부탁드리겠습니다.
---------------
선물 230틱 차트에서
스토캐스틱 슬로우(10,5,5)를 기준으로 80% 이상에서
%K와 %D 데드크로스 발생하고
5-20이평(단순) 데드크로스 발생후 다음봉 시가에 매도 진입하고
반대로 20% 이하에서는
%K와 %D 골든크로스 발생하고
5-20이평(단순) 골든크로스 발생후 다음봉 시가에 매수 진입하는 조건입니다.
청산은 일단 손절은 0.5포, 익절은 손익비 1.5배인 0.75포로 합니다.
Input : Period(10), Period1(5), Period2(5),P1(5),P2(20);
var : stok(0),stod(0),mav1(0),mav2(0),T(0);
stok = StochasticsK(Period,Period1);
stod = StochasticsD(Period,Period1,Period2);
mav1 = ma(C,p1);
mav2 = ma(c,p2);
if CrossDown(stok,stod) Then
{
T = -1;
if stok < 80 Then
T = 0;
}
if Crossup(stok,stod) Then
{
T = 1;
if stok > 20 Then
T = 0;
}
if T == -1 and CrossDown(mav1,mav2) Then
{
T = -2;
Sell("s",AtMarket);
}
if T == 1 and CrossUp(mav1,mav2) Then
{
T = 2;
Buy("b",AtMarket);
}
SetStopLoss(0.5,PointStop);
SetStopProfittarget(0.75,PointStop);