예스스탁
예스스탁 답변
2022-08-17 14:23:23
안녕하세요
예스스탁입니다.
1 매수
input : 손절틱수(30),익절틱수(30),x(4),수량(1);
var : DD(0),Year(0),month(0),V1(0),V2(0),V3(0),V4(0);
VAR : cnt(0),st(0),summer(False),Trade(False);
if NextBarSdate != sDate Then
{
DD = DayOfWeek(NextBarSdate);
Year = Floor(NextBarSdate/10000);
month = int(date/100)-int(date/10000)*100;
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;
Else
ST = 80000;
if month%3 == 0 Then
{
var1 = Floor(sDate/100)*100;
Var2 = 0;
trade = true;
For cnt = 1 to 31
{
if DayOfWeek(var1+cnt) == 5 Then
{
Var2 = Var2+1;
if Var2 == 3 and sDate == var1+cnt Then
Trade = False;
}
}
}
}
if trade == true and
((NextBarSdate != sDate and NextBarStime >= ST) or
(NextBarSdate == sDate and NextBarStime >= ST and sTime < ST)) Then
Buy("b",AtStop,NextBarOpen+PriceScale*x,수량);
SetStopProfittarget(PriceScale*익절틱수,PointStop);
SetStopLoss(PriceScale*손절틱수,PointStop);
2 매도
input : 손절틱수(30),익절틱수(30),x(4),수량(1);
var : DD(0),Year(0),month(0),V1(0),V2(0),V3(0),V4(0);
VAR : cnt(0),st(0),summer(False),Trade(False);
if NextBarSdate != sDate Then
{
DD = DayOfWeek(NextBarSdate);
Year = Floor(NextBarSdate/10000);
month = int(date/100)-int(date/10000)*100;
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;
Else
ST = 80000;
if month%3 == 0 Then
{
var1 = Floor(sDate/100)*100;
Var2 = 0;
trade = true;
For cnt = 1 to 31
{
if DayOfWeek(var1+cnt) == 5 Then
{
Var2 = Var2+1;
if Var2 == 3 and sDate == var1+cnt Then
Trade = False;
}
}
}
}
if trade == true and
((NextBarSdate != sDate and NextBarStime >= ST) or
(NextBarSdate == sDate and NextBarStime >= ST and sTime < ST)) Then
Sell("s",AtStop,NextBarOpen-PriceScale*x,수량);
SetStopProfittarget(PriceScale*익절틱수,PointStop);
SetStopLoss(PriceScale*손절틱수,PointStop);
즐거운 하루되세요
> 퀀트 님이 쓴 글입니다.
> 제목 : 수식 부탁드립니다
> 수고 많으십니다
당일 시가 매수(+-4틱) 매도(+-4틱) 수량 조정
이익 손실 수식 부탁드립니다
만기날 거래 X