커뮤니티
60분봉 매매 수식 수정부탁드립니다.
2018-09-09 15:18:50
175
글번호 121906
아래의 수식을 적용해 보았습니다.
1) 종료일날 150000 에 전량 청산이 되지 않습니다. 전량 매도되도록 부탁드립니다.
2) Atstop에 의해서 매도된 경우 이후 진입이 되지 않도록 하고 싶은데 부탁드립니다.
- 아 래 -
input : 타주기분(60),시작일(20180816),종료일(20180913),vol(1);
var : S1(0),D1(0),TM(0),TF(0);
var : CC(0),C1(0),Tcond(false);
if Bdate != Bdate[1] Then{
S1 = TimeToMinutes(stime);
D1 = sdate;
if sdate >= 시작일 and sdate[1] < 종료일 Then
Tcond = true;
}
if Tcond == true and sdate >= 시작일 and (stime >= 종료일 and 150000) Then
{
Tcond = false;
ExitLong("청산");
}
if D1 > 0 then{
if sdate == D1 Then
TM = TimeToMinutes(stime)-S1;
Else
TM = TimeToMinutes(stime)+1440-S1;
TF = TM%타주기분;
if Bdate != Bdate[1] or (Bdate == Bdate[1] and TF < TF[1]) Then
{
C1 = CC[1];
Condition1 = false;
}
CC = C;
if Tcond == true and
Condition1 == false and
C1 > 0 and CC < C1 and
MarketPosition >= 0 and CurrentContracts < 1 Then
{
Condition1 = true;
Buy("매수",OnClose,def,vol);
}
if Tcond == true and
Condition1 == false and
C <= AvgEntryPrice and
MarketPosition >= 0 and CurrentContracts < 19 Then
{
Condition1 = true;
Buy("매수.",OnClose,def,vol);
}
if MarketPosition == 1 and
Condition1 == false and
C >= AvgEntryPrice*1.03 Then
ExitLong("매도",OnClose,def,"",vol,2);
if highest(H,BarsSinceEntry) >= EntryPrice*1.10 and highest(H,BarsSinceEntry) < EntryPrice*1.15 Then
Exitlong("매도10",AtStop,EntryPrice*1.10);
if highest(H,BarsSinceEntry) >= EntryPrice*1.15 and highest(H,BarsSinceEntry) < EntryPrice*1.20 Then
Exitlong("매도15",AtStop,EntryPrice*1.15);
if highest(H,BarsSinceEntry) >= EntryPrice*1.20 and highest(H,BarsSinceEntry) < EntryPrice*1.25 Then
Exitlong("매도20",AtStop,EntryPrice*1.20);
if highest(H,BarsSinceEntry) >= EntryPrice*1.25 and highest(H,BarsSinceEntry) < EntryPrice*1.30 Then
Exitlong("매도25",AtStop,EntryPrice*1.25);
if highest(H,BarsSinceEntry) >= EntryPrice*1.30 and highest(H,BarsSinceEntry) < EntryPrice*1.35 Then
Exitlong("매도30",AtStop,EntryPrice*1.30);
}
답변 1
예스스탁 예스스탁 답변
2018-09-10 13:13:21
안녕하세요
예스스탁입니다.
input : 타주기분(60),시작일(20180816),종료일(20180913),vol(1);
var : S1(0),D1(0),TM(0),TF(0);
var : CC(0),C1(0),Tcond(false);
if Bdate != Bdate[1] Then{
S1 = TimeToMinutes(stime);
D1 = sdate;
if sdate >= 시작일 and sdate[1] < 종료일 Then
Tcond = true;
}
if Tcond == true and sdate >= 종료일 and stime >= 150000 Then
{
Tcond = false;
ExitLong("청산");
}
if D1 > 0 then{
if sdate == D1 Then
TM = TimeToMinutes(stime)-S1;
Else
TM = TimeToMinutes(stime)+1440-S1;
TF = TM%타주기분;
if Bdate != Bdate[1] or (Bdate == Bdate[1] and TF < TF[1]) Then
{
C1 = CC[1];
Condition1 = false;
}
CC = C;
if Tcond == true and
Condition1 == false and
C1 > 0 and CC < C1 and
MarketPosition >= 0 and CurrentContracts < 1 Then
{
Condition1 = true;
if TotalTrades == 0 or (TotalTrades >= 1 and IsExitName("매도",1) == true) Then
Buy("매수",OnClose,def,vol);
}
if Tcond == true and
Condition1 == false and
C <= AvgEntryPrice and
MarketPosition >= 0 and CurrentContracts < 19 Then
{
Condition1 = true;
Buy("매수.",OnClose,def,vol);
}
if MarketPosition == 1 and
Condition1 == false and
C >= AvgEntryPrice*1.03 Then
ExitLong("매도",OnClose,def,"",vol,2);
if highest(H,BarsSinceEntry) >= EntryPrice*1.10 and highest(H,BarsSinceEntry) < EntryPrice*1.15 Then
Exitlong("매도10",AtStop,EntryPrice*1.10);
if highest(H,BarsSinceEntry) >= EntryPrice*1.15 and highest(H,BarsSinceEntry) < EntryPrice*1.20 Then
Exitlong("매도15",AtStop,EntryPrice*1.15);
if highest(H,BarsSinceEntry) >= EntryPrice*1.20 and highest(H,BarsSinceEntry) < EntryPrice*1.25 Then
Exitlong("매도20",AtStop,EntryPrice*1.20);
if highest(H,BarsSinceEntry) >= EntryPrice*1.25 and highest(H,BarsSinceEntry) < EntryPrice*1.30 Then
Exitlong("매도25",AtStop,EntryPrice*1.25);
if highest(H,BarsSinceEntry) >= EntryPrice*1.30 and highest(H,BarsSinceEntry) < EntryPrice*1.35 Then
Exitlong("매도30",AtStop,EntryPrice*1.30);
}
즐거운 하루되세요
> 승부사1 님이 쓴 글입니다.
> 제목 : 60분봉 매매 수식 수정부탁드립니다.
> 아래의 수식을 적용해 보았습니다.
1) 종료일날 150000 에 전량 청산이 되지 않습니다. 전량 매도되도록 부탁드립니다.
2) Atstop에 의해서 매도된 경우 이후 진입이 되지 않도록 하고 싶은데 부탁드립니다.
- 아 래 -
input : 타주기분(60),시작일(20180816),종료일(20180913),vol(1);
var : S1(0),D1(0),TM(0),TF(0);
var : CC(0),C1(0),Tcond(false);
if Bdate != Bdate[1] Then{
S1 = TimeToMinutes(stime);
D1 = sdate;
if sdate >= 시작일 and sdate[1] < 종료일 Then
Tcond = true;
}
if Tcond == true and sdate >= 시작일 and (stime >= 종료일 and 150000) Then
{
Tcond = false;
ExitLong("청산");
}
if D1 > 0 then{
if sdate == D1 Then
TM = TimeToMinutes(stime)-S1;
Else
TM = TimeToMinutes(stime)+1440-S1;
TF = TM%타주기분;
if Bdate != Bdate[1] or (Bdate == Bdate[1] and TF < TF[1]) Then
{
C1 = CC[1];
Condition1 = false;
}
CC = C;
if Tcond == true and
Condition1 == false and
C1 > 0 and CC < C1 and
MarketPosition >= 0 and CurrentContracts < 1 Then
{
Condition1 = true;
Buy("매수",OnClose,def,vol);
}
if Tcond == true and
Condition1 == false and
C <= AvgEntryPrice and
MarketPosition >= 0 and CurrentContracts < 19 Then
{
Condition1 = true;
Buy("매수.",OnClose,def,vol);
}
if MarketPosition == 1 and
Condition1 == false and
C >= AvgEntryPrice*1.03 Then
ExitLong("매도",OnClose,def,"",vol,2);
if highest(H,BarsSinceEntry) >= EntryPrice*1.10 and highest(H,BarsSinceEntry) < EntryPrice*1.15 Then
Exitlong("매도10",AtStop,EntryPrice*1.10);
if highest(H,BarsSinceEntry) >= EntryPrice*1.15 and highest(H,BarsSinceEntry) < EntryPrice*1.20 Then
Exitlong("매도15",AtStop,EntryPrice*1.15);
if highest(H,BarsSinceEntry) >= EntryPrice*1.20 and highest(H,BarsSinceEntry) < EntryPrice*1.25 Then
Exitlong("매도20",AtStop,EntryPrice*1.20);
if highest(H,BarsSinceEntry) >= EntryPrice*1.25 and highest(H,BarsSinceEntry) < EntryPrice*1.30 Then
Exitlong("매도25",AtStop,EntryPrice*1.25);
if highest(H,BarsSinceEntry) >= EntryPrice*1.30 and highest(H,BarsSinceEntry) < EntryPrice*1.35 Then
Exitlong("매도30",AtStop,EntryPrice*1.30);
}
다음글
이전글