커뮤니티
죄송합니다 하나만 더 부탁드립니다.
2019-05-03 13:43:47
187
글번호 128372
분할매수 처음매수가 b11이랑 b1둘중 하나로 지정되어있는거 같은데 첫매수는 b11으로만 시작하게 하고 싶구요. +로 시작일때는 그날 매수에 전혀 참여하지 않는걸로 하고 싶은데 제대로 되어있는건지 모르겠습니다 ㅠㅠ 지금 상태는 +시작인데도 b1을 매수하고 있거든요.
그리고 평단가 계산할때 시스템트레이딩 매수매도 수수료도 감안해서 계산 가능한가요?
------------------
Input : 투자금액(10000000),Period(20), MultiD(2), N(1),시작일(20190503),시작시간(090000),청산시간(151500);
Input : loss(5);
var : e(0),x(0),count(0),Tcond(false),BBup(0),BBdn(0);
var : HH(0),Bxcond1(false),Bxcond2(false),Bxcond3(false);
var : LL(0),Sxcond1(false),Sxcond2(false),Sxcond3(false);
Array : VV[5](0),XX[5](0);
BBup = BollBandUp(Period,MultiD);
BBdn = BollBandDown(Period,MultiD);
vv[0] = floor((투자금액*0.1)/NextBarOpen);
vv[1] = floor((투자금액*0.2)/NextBarOpen);
vv[2] = floor((투자금액*0.3)/NextBarOpen);
vv[3] = floor((투자금액*0.4)/NextBarOpen);
if sdate >= 시작일 and stime >= 시작시간 Then
Tcond = true;
if bdate != bdate[1] Then
count = 0;
if MarketPosition != 0 and MarketPosition != MarketPosition[1] Then
count = count+1;
if Tcond == true then
{
if (TotalTrades == 0 or MarketPosition == 0 and BarsSinceExit(1) > 2) then
{
if MarketPosition == 0 and count < N and CrossDown(c,bbdn) and C < DayClose(1) Then
{
buy("b1",atmarket,def,vv[MaxEntries]);
}
if MarketPosition == 0 and NextBarSdate != sdate and NextBarOpen <= C Then
{
buy("b11",atmarket,def,vv[MaxEntries]);
}
}
if MarketPosition == 1 Then
{
if CurrentContracts > CurrentContracts[1] Then
{
e = e +1;
if e == 1 then
XX[e] = CurrentContracts;
Else
XX[e] = CurrentContracts-CurrentContracts[1];
}
#두번째 매수
if MarketPosition == 1 and e == 1 and count < N and CrossDown(c,bbdn) and C < DayClose(1) Then
{
buy("b2",atmarket,def,vv[MaxEntries]);
}
#세번재매수
if MarketPosition == 1 and e == 2 and count < N and CrossDown(c,bbdn) and C < DayClose(1) Then
{
buy("b3",atmarket,def,vv[MaxEntries]);
}
#네번재매수
if MarketPosition == 1 and e == 3 and count < N and CrossDown(c,bbdn) and C < DayClose(1) Then
{
buy("b4",atmarket,def,vv[MaxEntries]);
}
HH = highest(H,BarsSinceEntry);
if CurrentContracts < CurrentContracts[1] and LatestExitName(0) == "Bx1" Then
Bxcond1 = true;
if CurrentContracts < CurrentContracts[1] and LatestExitName(0) == "Bx2" Then
Bxcond2 = true;
if CurrentContracts < CurrentContracts[1] and LatestExitName(0) == "Bx3" Then
Bxcond3 = true;
if Bxcond1 == false and HH >= EntryPrice*1.02 and HH < EntryPrice*1.05 Then
ExitLong("Bx1",AtStop,HH-(HH-EntryPrice)*0.1,"",Floor(MaxContracts*(1/5)),1);
if Bxcond2 == false and HH >= EntryPrice*1.06 and HH < EntryPrice*1.10 Then
ExitLong("Bx2",AtStop,HH-(HH-EntryPrice)*0.1,"",Floor(MaxContracts*(2/5)),1);
if Bxcond3 == false and HH >= EntryPrice*1.12 Then
ExitLong("Bx3",AtStop,HH-(HH-EntryPrice)*0.1);
if (stime >= 청산시간 and stime[1] < 청산시간) and C > AvgEntryPrice then
{
ExitLong("bx");
}
}}
답변 2
예스스탁 예스스탁 답변
2019-05-03 14:58:06
안녕하세요
예스스탁입니다.
b1매수는 당일 두번째 부터 시초가가 전일종가 이하인 날에만 발생하도록 수정했습니다.
필요가 없으시면 해당 진입신 내용은 삭제하시면 됩니다.
평단가에 수수료는 포함되지 않습니다. 설정창의 수수료와 슬리피지는 손익에만 포함됩니다.
즉 진입단가에 수수료과 +-되는 것은 아니고 손익계산에 설정창에 지정한 만큼이 차감되게 됩니다.
Input : 투자금액(10000000),Period(20), MultiD(2), N(1),시작일(20190503),시작시간(090000),청산시간(151500);
Input : loss(5);
var : e(0),x(0),count(0),Tcond(false),BBup(0),BBdn(0);
var : HH(0),Bxcond1(false),Bxcond2(false),Bxcond3(false);
var : LL(0),Sxcond1(false),Sxcond2(false),Sxcond3(false);
Array : VV[5](0),XX[5](0);
BBup = BollBandUp(Period,MultiD);
BBdn = BollBandDown(Period,MultiD);
vv[0] = floor((투자금액*0.1)/NextBarOpen);
vv[1] = floor((투자금액*0.2)/NextBarOpen);
vv[2] = floor((투자금액*0.3)/NextBarOpen);
vv[3] = floor((투자금액*0.4)/NextBarOpen);
if sdate >= 시작일 and stime >= 시작시간 Then
Tcond = true;
if bdate != bdate[1] Then
count = 0;
if MarketPosition != 0 and MarketPosition != MarketPosition[1] Then
count = count+1;
if Tcond == true then
{
if (TotalTrades == 0 or MarketPosition == 0 and BarsSinceExit(1) > 2) then
{
if MarketPosition == 0 and count >= 1 and count < N and CrossDown(c,bbdn) and C <= DayClose(1) Then
{
buy("b1",atmarket,def,vv[MaxEntries]);
}
if MarketPosition == 0 and NextBarSdate != sdate and NextBarOpen <= C Then
{
buy("b11",atmarket,def,vv[MaxEntries]);
}
}
if MarketPosition == 1 Then
{
if CurrentContracts > CurrentContracts[1] Then
{
e = e +1;
if e == 1 then
XX[e] = CurrentContracts;
Else
XX[e] = CurrentContracts-CurrentContracts[1];
}
#두번째 매수
if MarketPosition == 1 and e == 1 and count < N and CrossDown(c,bbdn) and C < DayClose(1) Then
{
buy("b2",atmarket,def,vv[MaxEntries]);
}
#세번재매수
if MarketPosition == 1 and e == 2 and count < N and CrossDown(c,bbdn) and C < DayClose(1) Then
{
buy("b3",atmarket,def,vv[MaxEntries]);
}
#네번재매수
if MarketPosition == 1 and e == 3 and count < N and CrossDown(c,bbdn) and C < DayClose(1) Then
{
buy("b4",atmarket,def,vv[MaxEntries]);
}
HH = highest(H,BarsSinceEntry);
if CurrentContracts < CurrentContracts[1] and LatestExitName(0) == "Bx1" Then
Bxcond1 = true;
if CurrentContracts < CurrentContracts[1] and LatestExitName(0) == "Bx2" Then
Bxcond2 = true;
if CurrentContracts < CurrentContracts[1] and LatestExitName(0) == "Bx3" Then
Bxcond3 = true;
if Bxcond1 == false and HH >= EntryPrice*1.02 and HH < EntryPrice*1.05 Then
ExitLong("Bx1",AtStop,HH-(HH-EntryPrice)*0.1,"",Floor(MaxContracts*(1/5)),1);
if Bxcond2 == false and HH >= EntryPrice*1.06 and HH < EntryPrice*1.10 Then
ExitLong("Bx2",AtStop,HH-(HH-EntryPrice)*0.1,"",Floor(MaxContracts*(2/5)),1);
if Bxcond3 == false and HH >= EntryPrice*1.12 Then
ExitLong("Bx3",AtStop,HH-(HH-EntryPrice)*0.1);
if (stime >= 청산시간 and stime[1] < 청산시간) and C > AvgEntryPrice then
{
ExitLong("bx");
}
}}
즐거운 하루되세요
> 바나 님이 쓴 글입니다.
> 제목 : 죄송합니다 하나만 더 부탁드립니다.
> 분할매수 처음매수가 b11이랑 b1둘중 하나로 지정되어있는거 같은데 첫매수는 b11으로만 시작하게 하고 싶구요. +로 시작일때는 그날 매수에 전혀 참여하지 않는걸로 하고 싶은데 제대로 되어있는건지 모르겠습니다 ㅠㅠ 지금 상태는 +시작인데도 b1을 매수하고 있거든요.
그리고 평단가 계산할때 시스템트레이딩 매수매도 수수료도 감안해서 계산 가능한가요?
------------------
Input : 투자금액(10000000),Period(20), MultiD(2), N(1),시작일(20190503),시작시간(090000),청산시간(151500);
Input : loss(5);
var : e(0),x(0),count(0),Tcond(false),BBup(0),BBdn(0);
var : HH(0),Bxcond1(false),Bxcond2(false),Bxcond3(false);
var : LL(0),Sxcond1(false),Sxcond2(false),Sxcond3(false);
Array : VV[5](0),XX[5](0);
BBup = BollBandUp(Period,MultiD);
BBdn = BollBandDown(Period,MultiD);
vv[0] = floor((투자금액*0.1)/NextBarOpen);
vv[1] = floor((투자금액*0.2)/NextBarOpen);
vv[2] = floor((투자금액*0.3)/NextBarOpen);
vv[3] = floor((투자금액*0.4)/NextBarOpen);
if sdate >= 시작일 and stime >= 시작시간 Then
Tcond = true;
if bdate != bdate[1] Then
count = 0;
if MarketPosition != 0 and MarketPosition != MarketPosition[1] Then
count = count+1;
if Tcond == true then
{
if (TotalTrades == 0 or MarketPosition == 0 and BarsSinceExit(1) > 2) then
{
if MarketPosition == 0 and count < N and CrossDown(c,bbdn) and C < DayClose(1) Then
{
buy("b1",atmarket,def,vv[MaxEntries]);
}
if MarketPosition == 0 and NextBarSdate != sdate and NextBarOpen <= C Then
{
buy("b11",atmarket,def,vv[MaxEntries]);
}
}
if MarketPosition == 1 Then
{
if CurrentContracts > CurrentContracts[1] Then
{
e = e +1;
if e == 1 then
XX[e] = CurrentContracts;
Else
XX[e] = CurrentContracts-CurrentContracts[1];
}
#두번째 매수
if MarketPosition == 1 and e == 1 and count < N and CrossDown(c,bbdn) and C < DayClose(1) Then
{
buy("b2",atmarket,def,vv[MaxEntries]);
}
#세번재매수
if MarketPosition == 1 and e == 2 and count < N and CrossDown(c,bbdn) and C < DayClose(1) Then
{
buy("b3",atmarket,def,vv[MaxEntries]);
}
#네번재매수
if MarketPosition == 1 and e == 3 and count < N and CrossDown(c,bbdn) and C < DayClose(1) Then
{
buy("b4",atmarket,def,vv[MaxEntries]);
}
HH = highest(H,BarsSinceEntry);
if CurrentContracts < CurrentContracts[1] and LatestExitName(0) == "Bx1" Then
Bxcond1 = true;
if CurrentContracts < CurrentContracts[1] and LatestExitName(0) == "Bx2" Then
Bxcond2 = true;
if CurrentContracts < CurrentContracts[1] and LatestExitName(0) == "Bx3" Then
Bxcond3 = true;
if Bxcond1 == false and HH >= EntryPrice*1.02 and HH < EntryPrice*1.05 Then
ExitLong("Bx1",AtStop,HH-(HH-EntryPrice)*0.1,"",Floor(MaxContracts*(1/5)),1);
if Bxcond2 == false and HH >= EntryPrice*1.06 and HH < EntryPrice*1.10 Then
ExitLong("Bx2",AtStop,HH-(HH-EntryPrice)*0.1,"",Floor(MaxContracts*(2/5)),1);
if Bxcond3 == false and HH >= EntryPrice*1.12 Then
ExitLong("Bx3",AtStop,HH-(HH-EntryPrice)*0.1);
if (stime >= 청산시간 and stime[1] < 청산시간) and C > AvgEntryPrice then
{
ExitLong("bx");
}
}}
바나
2019-05-03 15:21:34
바나 님에 의해 삭제된 답변입니다.
이전글