input : X(1.5);
input : 만기청산시간(151500), 만기외청산시간(153000);
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 MarketPosition == 0 and NextBarOpen == sdate then
{
buy("b",AtStop,dayopen+x);
sell("s",AtStop,dayopen-x);
}
if MarketPosition == 1 Then
ExitLong("bx",AtStop,dayopen);
if MarketPosition == -1 Then
ExitShort("sx",AtStop,dayopen);
if (nday >= 8 and nday <= 14 and week == 4) then
SetStopEndofday(만기청산시간);
Else
SetStopEndofday(만기외청산시간);
1. 이 전략의 진입 조건을
전일의 (고가-저가)*0.5 돌파 시 매수 매도 진입으로 바꿔보고 싶습니다.
2. 그리고 당일 청산이 아니라 다음날 시가 청산으로 바꾼다면 어떻게 바꿀 수 있을까요?
답변 1
예스스탁
예스스탁 답변
2020-02-25 14:15:21
안녕하세요
예스스탁입니다.
input : per(50);
if MarketPosition == 0 and NextBarOpen == sdate then
{
buy("b",AtStop,dayopen+(DayHigh(1)-DayLow(1))*(Per/100));
sell("s",AtStop,dayopen-(DayHigh(1)-DayLow(1))*(Per/100));
}
if MarketPosition == 1 Then
{
ExitLong("bx1",AtStop,dayopen);
if NextBarSdate > sdate Then
ExitLong("bx2",AtMarket);
}
if MarketPosition == -1 Then
{
ExitShort("sx1",AtStop,dayopen);
if NextBarSdate > sdate Then
ExitShort("sx2",AtMarket);
}
즐거운 하루되세요
> 파랭 님이 쓴 글입니다.
> 제목 : 수식 도와주세요
> input : X(1.5);
input : 만기청산시간(151500), 만기외청산시간(153000);
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 MarketPosition == 0 and NextBarOpen == sdate then
{
buy("b",AtStop,dayopen+x);
sell("s",AtStop,dayopen-x);
}
if MarketPosition == 1 Then
ExitLong("bx",AtStop,dayopen);
if MarketPosition == -1 Then
ExitShort("sx",AtStop,dayopen);
if (nday >= 8 and nday <= 14 and week == 4) then
SetStopEndofday(만기청산시간);
Else
SetStopEndofday(만기외청산시간);
1. 이 전략의 진입 조건을
전일의 (고가-저가)*0.5 돌파 시 매수 매도 진입으로 바꿔보고 싶습니다.
2. 그리고 당일 청산이 아니라 다음날 시가 청산으로 바꾼다면 어떻게 바꿀 수 있을까요?