커뮤니티
이번엔 추가매수가 안되네요.
2019-05-09 09:59:24
189
글번호 128528
하락시작일때 b11매수는 잘되는데 분명히 추가매수가 나와야할 시점인데 나오질 않네요...ㅠ
추가매수는 장초 하락시작할때 b11매수이후 볼밴하단을 터치할때 추가 매수인데..
분명 매수 시점인거 같은데 매수가 안됩니다.
Input : 투자금액(10000000),Period(20), MultiD(2), N(1),시작일(20190509),시작시간(090000),청산시간(150000);
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 NextBarSdate >= 시작일 and NextBarStime >= 시작시간 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) and dayopen < DayClose(1) and NextBarSdate == sdate 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)
and dayopen < DayClose(1) and NextBarSdate == sdate Then
{
buy("b2",atmarket,def,vv[MaxEntries]);
}
#세번재매수
if MarketPosition == 1 and e == 2 and count < N and CrossDown(c,bbdn) and C < DayClose(1)
and dayopen < DayClose(1) and NextBarSdate == sdate Then
{
buy("b3",atmarket,def,vv[MaxEntries]);
}
#네번재매수
if MarketPosition == 1 and e == 3 and count < N and CrossDown(c,bbdn) and C < DayClose(1)
and dayopen < DayClose(1) and NextBarSdate == sdate 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.03 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");
}
if C >= AvgEntryPrice*1.02 Then
ExitLong("x");
}}
답변 1
예스스탁 예스스탁 답변
2019-05-09 14:02:18
안녕하세요
예스스탁입니다.
추가진입에 모두 count < N이라는 조건이 있습니다.
해당 수식에서 count는 진입횟수입니다.
첫진입이 발생하면 1로 변경이 되지만
N이 1로 지정되어 있어 추가진입의 count < N조건이 성립되지 않습니다.
또한 해당 수식에서 진입횟수는 무포지션이었다가 최초 매수가 발생한것을 카운트 합니다.
추가진입은 e로 횟수가 지정되어 있으므로 추가진입에서 count < N은 모두 삭제하시면 됩니다.
즐거운 하루되세요
> 바나 님이 쓴 글입니다.
> 제목 : 이번엔 추가매수가 안되네요.
> 하락시작일때 b11매수는 잘되는데 분명히 추가매수가 나와야할 시점인데 나오질 않네요...ㅠ
추가매수는 장초 하락시작할때 b11매수이후 볼밴하단을 터치할때 추가 매수인데..
분명 매수 시점인거 같은데 매수가 안됩니다.
Input : 투자금액(10000000),Period(20), MultiD(2), N(1),시작일(20190509),시작시간(090000),청산시간(150000);
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 NextBarSdate >= 시작일 and NextBarStime >= 시작시간 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) and dayopen < DayClose(1) and NextBarSdate == sdate 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)
and dayopen < DayClose(1) and NextBarSdate == sdate Then
{
buy("b2",atmarket,def,vv[MaxEntries]);
}
#세번재매수
if MarketPosition == 1 and e == 2 and count < N and CrossDown(c,bbdn) and C < DayClose(1)
and dayopen < DayClose(1) and NextBarSdate == sdate Then
{
buy("b3",atmarket,def,vv[MaxEntries]);
}
#네번재매수
if MarketPosition == 1 and e == 3 and count < N and CrossDown(c,bbdn) and C < DayClose(1)
and dayopen < DayClose(1) and NextBarSdate == sdate 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.03 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");
}
if C >= AvgEntryPrice*1.02 Then
ExitLong("x");
}}
다음글
이전글