커뮤니티
추가매수 수정?
2019-05-16 01:54:40
155
글번호 128698
Input : 투자금액(1000000),Period(20), MultiD(2), N(1),시작일(20190515),시작시간(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.2)/NextBarOpen);
vv[1] = floor((투자금액*0.3)/NextBarOpen);
vv[2] = floor((투자금액*0.5)/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 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 CrossDown(c,bbdn) and C < DayClose(1)
and dayopen < DayClose(1) and NextBarSdate == sdate Then
{
buy("b3",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");
}}
이렇게 설정해서 쓰고 있는데 5분봉기준으로 했을때 그림1처럼 오늘 비상교육 같은경우
b11만 매수하고 그 이후에 강하게 볼밴하단을 뚫는지점(동그라미 지점)이 나왔는데도
추가매수가 이루어 지지 않았는데 어떤부분이 잘못된 건지 알수 있을까요?
- 1. 129307_3.jpg (0.56 MB)
답변 1
예스스탁 예스스탁 답변
2019-05-16 14:04:13
안녕하세요
예스스탁입니다.
전일 종가보다 시가가 작아야 하는데 시가가 전일종가와 가격이 같습니다.
첫봉 시가진입은 시초가가 전일종가와 같을 때도 진입하게 되어 있습니다.
같은 경우에도 모두 진입하게 수정해 드립니다.
Input : 투자금액(1000000),Period(20), MultiD(2), N(1),시작일(20190515),시작시간(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.2)/NextBarOpen);
vv[1] = floor((투자금액*0.3)/NextBarOpen);
vv[2] = floor((투자금액*0.5)/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 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 CrossDown(c,bbdn) and C < DayClose(1)
and dayopen <= DayClose(1) and NextBarSdate == sdate Then
{
buy("b3",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");
}}
즐거운 하루되세요
> 바나 님이 쓴 글입니다.
> 제목 : 추가매수 수정?
> Input : 투자금액(1000000),Period(20), MultiD(2), N(1),시작일(20190515),시작시간(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.2)/NextBarOpen);
vv[1] = floor((투자금액*0.3)/NextBarOpen);
vv[2] = floor((투자금액*0.5)/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 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 CrossDown(c,bbdn) and C < DayClose(1)
and dayopen < DayClose(1) and NextBarSdate == sdate Then
{
buy("b3",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");
}}
이렇게 설정해서 쓰고 있는데 5분봉기준으로 했을때 그림1처럼 오늘 비상교육 같은경우
b11만 매수하고 그 이후에 강하게 볼밴하단을 뚫는지점(동그라미 지점)이 나왔는데도
추가매수가 이루어 지지 않았는데 어떤부분이 잘못된 건지 알수 있을까요?