커뮤니티
질문있습니다.
2016-11-03 12:03:41
78
글번호 103665
안녕하세요?
제가 시가매매를 하고있는데요. 아래식으로 진행하면서
sdate를 매번 바꾸면서 하고 있습니다.
완성봉에 매매를 하는 것이 아니라 시가매매를 하려고 하는데요. 아래식이 맞는지 확인부탁드리겠습니다.
그리고 오늘날짜(11/03) 기준으로 시가매매하려면
if sdate >= 20161102 and 으로 해야 됩니다.
그리고 if sdate == currentdate and 로하면 시가 매매가 안되는데요.
어떤걸 바꿔줘야 하나요?
input : 금액1(100000),금액2(500000),금액3(1000000);
var : ,Xcond(false);
var : Vol1(0),vol2(0),vol3(0);
if CodeCategoryEx == 11 and BasePrice < 50000 Then{
vol1 = int(int(금액1/C)/10)*10;
vol2 = int(int(금액2/C)/10)*10;
vol3 = int(int(금액3/C)/10)*10;
}
Else{
vol1 = int(금액1/C);
vol2 = int(금액2/C);
vol3 = int(금액3/C);
}
if bdate != bdate[1] Then
Xcond = false;
if MarketPosition == 1 and CurrentContracts < CurrentContracts[1] Then
Xcond = true;
// if sdate >= 20161102 and
if sdate == currentdate and
Xcond == false and
MarketPosition == 0
and NextBarSdate != sdate
Then
buy("b1",atmarket,def,vol1);
//if Xcond == false and MarketPosition == 1 and MaxEntries == 1 Then
// buy("b2",AtLimit,LatestEntryPrice(0)*0.98,vol2);
//if Xcond == false and MarketPosition == 1 and MaxEntries == 2 Then
// buy("b3",AtLimit,LatestEntryPrice(0)*0.96,vol3);
if MarketPosition == 1 Then{
if CurrentContracts == MaxContracts Then
ExitLong("bx1",Atlimit,AvgEntryPrice*1.03,"",Floor(MaxContracts*1),1);
//if CurrentContracts < MaxContracts Then
//] ExitLong("bx2",Atlimit,AvgEntryPrice*1.04);
}
답변 1
예스스탁 예스스탁 답변
2016-11-03 13:55:36
안녕하세요
예스스탁입니다.
항상 당일에만 시초가에 매수신호가 발생하게 수정했습니다.
input : 금액1(100000),금액2(500000),금액3(1000000);
var : ,Xcond(false);
var : Vol1(0),vol2(0),vol3(0);
if CodeCategoryEx == 11 and BasePrice < 50000 Then{
vol1 = int(int(금액1/C)/10)*10;
vol2 = int(int(금액2/C)/10)*10;
vol3 = int(int(금액3/C)/10)*10;
}
Else{
vol1 = int(금액1/C);
vol2 = int(금액2/C);
vol3 = int(금액3/C);
}
if bdate != bdate[1] Then
Xcond = false;
if MarketPosition == 1 and CurrentContracts < CurrentContracts[1] Then
Xcond = true;
if NextBarSdate >= CurrentDate and
NextBarSdate != sdate and
Xcond == false and
MarketPosition == 0 Then
buy("b1",atmarket,def,vol1);
//if Xcond == false and MarketPosition == 1 and MaxEntries == 1 Then
// buy("b2",AtLimit,LatestEntryPrice(0)*0.98,vol2);
//if Xcond == false and MarketPosition == 1 and MaxEntries == 2 Then
// buy("b3",AtLimit,LatestEntryPrice(0)*0.96,vol3);
if MarketPosition == 1 Then{
if CurrentContracts == MaxContracts Then
ExitLong("bx1",Atlimit,AvgEntryPrice*1.03,"",Floor(MaxContracts*1),1);
//if CurrentContracts < MaxContracts Then
//] ExitLong("bx2",Atlimit,AvgEntryPrice*1.04);
}
즐거운 하루되세요
> 만들레영토 님이 쓴 글입니다.
> 제목 : 질문있습니다.
> 안녕하세요?
제가 시가매매를 하고있는데요. 아래식으로 진행하면서
sdate를 매번 바꾸면서 하고 있습니다.
완성봉에 매매를 하는 것이 아니라 시가매매를 하려고 하는데요. 아래식이 맞는지 확인부탁드리겠습니다.
그리고 오늘날짜(11/03) 기준으로 시가매매하려면
if sdate >= 20161102 and 으로 해야 됩니다.
그리고 if sdate == currentdate and 로하면 시가 매매가 안되는데요.
어떤걸 바꿔줘야 하나요?
input : 금액1(100000),금액2(500000),금액3(1000000);
var : ,Xcond(false);
var : Vol1(0),vol2(0),vol3(0);
if CodeCategoryEx == 11 and BasePrice < 50000 Then{
vol1 = int(int(금액1/C)/10)*10;
vol2 = int(int(금액2/C)/10)*10;
vol3 = int(int(금액3/C)/10)*10;
}
Else{
vol1 = int(금액1/C);
vol2 = int(금액2/C);
vol3 = int(금액3/C);
}
if bdate != bdate[1] Then
Xcond = false;
if MarketPosition == 1 and CurrentContracts < CurrentContracts[1] Then
Xcond = true;
// if sdate >= 20161102 and
if sdate == currentdate and
Xcond == false and
MarketPosition == 0
and NextBarSdate != sdate
Then
buy("b1",atmarket,def,vol1);
//if Xcond == false and MarketPosition == 1 and MaxEntries == 1 Then
// buy("b2",AtLimit,LatestEntryPrice(0)*0.98,vol2);
//if Xcond == false and MarketPosition == 1 and MaxEntries == 2 Then
// buy("b3",AtLimit,LatestEntryPrice(0)*0.96,vol3);
if MarketPosition == 1 Then{
if CurrentContracts == MaxContracts Then
ExitLong("bx1",Atlimit,AvgEntryPrice*1.03,"",Floor(MaxContracts*1),1);
//if CurrentContracts < MaxContracts Then
//] ExitLong("bx2",Atlimit,AvgEntryPrice*1.04);
}