커뮤니티
질문드립니다
2015-10-27 06:59:45
148
글번호 91729
44677에서 답변 받은 시스템이 검증은 정상적으로 되나 전략실행차트로 돌렸더니
신호가 발생하지 않고 종목변경시 오류가 나면서 트레이더가 종료되는 현상이 발생합니다
1. 수정된 시스템 검토 부탁드리며
2. 전에 답변주신 시스템에서 당일 매매횟수제한을 Input N(1)로 제한하고
var4 = ma(V,100);
var5 = Disparity(20);
로 거래량 및 거래대금, 이격도
DayOpen >= DayClose(1)
을 추가하여 사용중이었는데
혹시나 새롭게 답변받은 시스템에 충돌이 일어날까 재문의 드립니다
요약하면
1)최초 답변받은 시스템에서 특정캔들을 제외하고 매매가 되도록 수정요청
2)수정된 시스템으로 전략실행차트실행시 트레이더 오류 및 다운현상
3)수정된 시스템에서 당일매매 회ㅅ수제한, 100캔들 평균 거래량과 거래대금, 이격도, 당일 시가가 전일 종가 이상의 조건을 추가(전일 종가 조건 불가시 마지막 캔들의 종가<당일 시가)
번거로우실거 같아서 최초 답변과 수정답변을 아래에 첨부합니다
최초답변받은 시스템
----------------------
input : aa(100),bb(2),CC(100),dd(2),금액(1000000);
var : Ov(0),TT(0),Xvol(0),Xcnt(0);
Ov = OBV;
var1 = ma(V,aa);
var2 = abs(Ov-Ov[1]);
var3 = ma(var2,CC);
if MarketPosition == 0 and
!(CurrentContracts < CurrentContracts[1]) and
V >= var1[1]*bb and
var2 >= var3[1]*dd and
Ov-Ov[1] > 0 Then
buy("b1",OnClose,def,floor(금액*0.3/C));
if MarketPosition == 1 Then{
if BarsSinceEntry == 1 then
buy("b2",OnClose,def,floor(금액*0.4/C));
if BarsSinceEntry == 2 then
buy("b3",OnClose,def,floor(금액*0.3/C));
if CurrentContracts > CurrentContracts[1] and MaxEntries == 3 Then
TT = TimeToMinutes(stime);
if CurrentContracts < CurrentContracts Then
Xcnt = Xcnt+1;
if MaxEntries == 3 and TimeToMinutes(stime) >= TT+30 then{
if countif(LatestExitName(0) == "BP1",BarsSinceEntry) < 1 then{
if Xcnt < 2 Then
Xvol = floor(MaxContracts*0.3);
Else
Xvol = CurrentContracts;
ExitLong("BP1",atlimit,LatestEntryPrice(0)*1.01,"",Xvol,1);
}
if countif(LatestExitName(0) == "BP2",BarsSinceEntry) < 1 then{
if Xcnt < 2 Then
Xvol = floor(MaxContracts*0.4);
Else
Xvol = CurrentContracts;
ExitLong("BP2",atlimit,LatestEntryPrice(0)*1.02,"",Xvol,1);
}
if countif(LatestExitName(0) == "BL1",BarsSinceEntry) < 1 then{
if Xcnt < 2 Then
Xvol = floor(MaxContracts*0.3);
Else
Xvol = CurrentContracts;
ExitLong("BL1",AtStop,LatestEntryPrice(0)*0.99,"",Xvol,1);
}
if countif(LatestExitName(0) == "BL2",BarsSinceEntry) < 1 then{
if Xcnt < 2 Then
Xvol = floor(MaxContracts*0.4);
Else
Xvol = CurrentContracts;
ExitLong("BL2",AtStop,LatestEntryPrice(0)*0.98,"",Xvol,1);
}
exitlong("bp3",atlimit,LatestEntryPrice(0)*1.03);
exitlong("bl3",AtStop,LatestEntryPrice(0)*0.97);
}
}
if MarketPosition != 1 Then
Xcnt = 0;
수정된 시스템
--------------------
input : aa(100),bb(2),CC(100),dd(2),금액(1000000);
var : TT(0),Xvol(0),Xcnt(0),sum1(0),cnt(0);
var : Prc(0),Prc1(0),OBVv(0),sum2(0),idx(0);
Array : VV[101](0),Ov[101](0);
if stime < 145000 Then{
idx = idx+1;
If Prc > Prc1 Then
OBVv = OBVv + Volume;
Else If Prc < Prc1 Then
OBVv = OBVv - Volume;
Else
OBVv = OBVv;
VV[0] = V;
Ov[0] = OBVv;
for cnt = 0 to 100{
VV[cnt] = VV[cnt-1][1];
OV[cnt] = OV[cnt-1][1];
}
Prc = C;
Prc1 = CC[1];
}
sum1 = 0;
for cnt = 0 to aa-1{
sum1 = VV[cnt];
}
var1 = sum1/aa;
var2 = abs(OV[0]-OV[1]);
sum2 = 0;
for cnt = 0 to cc-1{
sum2 = sum2+abs(OV[cnt]-OV[cnt+1]);
}
var3 = sum2/cc;
if MarketPosition == 0 and idx >= aa and idx >= cc and
!(CurrentContracts < CurrentContracts[1]) and
V >= var1[1]*bb and
var2 >= var3[1]*dd and
Ov-Ov[1] > 0 and idx >= aa and idx >= cc Then
buy("b1",OnClose,def,floor(금액*0.3/C));
if MarketPosition == 1 Then{
if BarsSinceEntry == 1 then
buy("b2",OnClose,def,floor(금액*0.4/C));
if BarsSinceEntry == 2 then
buy("b3",OnClose,def,floor(금액*0.3/C));
if CurrentContracts > CurrentContracts[1] and MaxEntries == 3 Then
TT = TimeToMinutes(stime);
if CurrentContracts < CurrentContracts Then
Xcnt = Xcnt+1;
if MaxEntries == 3 and TimeToMinutes(stime) >= TT+30 then{
if countif(LatestExitName(0) == "BP1",BarsSinceEntry) < 1 then{
if Xcnt < 2 Then
Xvol = floor(MaxContracts*0.3);
Else
Xvol = CurrentContracts;
ExitLong("BP1",atlimit,LatestEntryPrice(0)*1.01,"",Xvol,1);
}
if countif(LatestExitName(0) == "BP2",BarsSinceEntry) < 1 then{
if Xcnt < 2 Then
Xvol = floor(MaxContracts*0.4);
Else
Xvol = CurrentContracts;
ExitLong("BP2",atlimit,LatestEntryPrice(0)*1.02,"",Xvol,1);
}
if countif(LatestExitName(0) == "BL1",BarsSinceEntry) < 1 then{
if Xcnt < 2 Then
Xvol = floor(MaxContracts*0.3);
Else
Xvol = CurrentContracts;
ExitLong("BL1",AtStop,LatestEntryPrice(0)*0.99,"",Xvol,1);
}
if countif(LatestExitName(0) == "BL2",BarsSinceEntry) < 1 then{
if Xcnt < 2 Then
Xvol = floor(MaxContracts*0.4);
Else
Xvol = CurrentContracts;
ExitLong("BL2",AtStop,LatestEntryPrice(0)*0.98,"",Xvol,1);
}
exitlong("bp3",atlimit,LatestEntryPrice(0)*1.03);
exitlong("bl3",AtStop,LatestEntryPrice(0)*0.97);
}
}
if MarketPosition != 1 Then
Xcnt = 0;
답변 1
예스스탁 예스스탁 답변
2015-10-27 13:07:55
안녕하세요
예스스탁입니다.
식을 수정했습니다.
배열변수가 방지정이 되지 않고 if문에 사용되었습니다.
추가하신 내용은 전일 마지막봉 기준으로 추가했습니다.
input : aa(100),bb(2),CC(100),dd(2),금액(1000000),N(0);
var : TT(0),Xvol(0),Xcnt(0),sum1(0),cnt(0),sum4(0);
var : Prc(0),Prc1(0),OBVv(0),sum2(0),idx(0),entry(0),dis(0),dis1(0);
Array : VV[101](0),Ov[101](0),MM[101](0);
if stime < 145000 Then{
idx = idx+1;
if CurrentBar > 0 then{
If Prc > Prc1 Then
OBVv = OBVv + Volume;
Else If Prc < Prc1 Then
OBVv = OBVv - Volume;
Else
OBVv = OBVv;
}
VV[0] = V;
MM[0] = M;
Ov[0] = OBVv;
for cnt = 1 to 100{
VV[cnt] = VV[cnt-1][1];
OV[cnt] = OV[cnt-1][1];
}
Prc = C;
Prc1 = Prc[1];
}
sum1 = 0;
sum4 = 0;
for cnt = 0 to aa-1{
sum1 = sum1 + VV[cnt];
sum4 = sum4 + MM[cnt];
}
var1 = sum1/aa;
var4 = sum4/aa;
var2 = abs(OV[0]-OV[1]);
sum2 = 0;
for cnt = 0 to cc-1{
sum2 = sum2+abs(OV[cnt]-OV[cnt+1]);
}
var3 = sum2/cc;
dis = Disparity(aa);
if date != date[1] Then{
entry = 0;
var11 = var1[1];
var41 = var4[1];
dis1 = dis;
}
if MarketPosition != 0 and MarketPosition != MarketPosition[1] Then
Entry = Entry+1;
if MarketPosition == 0 and
Entry < N and
var1 > var11 and
var4 > var41 and
dis > dis1 and
Dayopen > DayClose(1) and
idx >= aa and idx >= cc and
!(CurrentContracts < CurrentContracts[1]) and
V >= var1[1]*bb and
var2 >= var3[1]*dd and
Ov[0]-Ov[1] > 0 Then
buy("b1",OnClose,def,floor(금액*0.3/C));
if MarketPosition == 1 Then{
if BarsSinceEntry == 1 then
buy("b2",OnClose,def,floor(금액*0.4/C));
if BarsSinceEntry == 2 then
buy("b3",OnClose,def,floor(금액*0.3/C));
if CurrentContracts > CurrentContracts[1] and MaxEntries == 3 Then
TT = TimeToMinutes(stime);
if CurrentContracts < CurrentContracts Then
Xcnt = Xcnt+1;
if MaxEntries == 3 and TimeToMinutes(stime) >= TT+30 then{
if countif(LatestExitName(0) == "BP1",BarsSinceEntry) < 1 then{
if Xcnt < 2 Then
Xvol = floor(MaxContracts*0.3);
Else
Xvol = CurrentContracts;
ExitLong("BP1",atlimit,LatestEntryPrice(0)*1.01,"",Xvol,1);
}
if countif(LatestExitName(0) == "BP2",BarsSinceEntry) < 1 then{
if Xcnt < 2 Then
Xvol = floor(MaxContracts*0.4);
Else
Xvol = CurrentContracts;
ExitLong("BP2",atlimit,LatestEntryPrice(0)*1.02,"",Xvol,1);
}
if countif(LatestExitName(0) == "BL1",BarsSinceEntry) < 1 then{
if Xcnt < 2 Then
Xvol = floor(MaxContracts*0.3);
Else
Xvol = CurrentContracts;
ExitLong("BL1",AtStop,LatestEntryPrice(0)*0.99,"",Xvol,1);
}
if countif(LatestExitName(0) == "BL2",BarsSinceEntry) < 1 then{
if Xcnt < 2 Then
Xvol = floor(MaxContracts*0.4);
Else
Xvol = CurrentContracts;
ExitLong("BL2",AtStop,LatestEntryPrice(0)*0.98,"",Xvol,1);
}
exitlong("bp3",atlimit,LatestEntryPrice(0)*1.03);
exitlong("bl3",AtStop,LatestEntryPrice(0)*0.97);
}
}
if MarketPosition != 1 Then
Xcnt = 0;
즐거운 하루되세요
> 가이츠 님이 쓴 글입니다.
> 제목 : 질문드립니다
> 44677에서 답변 받은 시스템이 검증은 정상적으로 되나 전략실행차트로 돌렸더니
신호가 발생하지 않고 종목변경시 오류가 나면서 트레이더가 종료되는 현상이 발생합니다
1. 수정된 시스템 검토 부탁드리며
2. 전에 답변주신 시스템에서 당일 매매횟수제한을 Input N(1)로 제한하고
var4 = ma(V,100);
var5 = Disparity(20);
로 거래량 및 거래대금, 이격도
DayOpen >= DayClose(1)
을 추가하여 사용중이었는데
혹시나 새롭게 답변받은 시스템에 충돌이 일어날까 재문의 드립니다
요약하면
1)최초 답변받은 시스템에서 특정캔들을 제외하고 매매가 되도록 수정요청
2)수정된 시스템으로 전략실행차트실행시 트레이더 오류 및 다운현상
3)수정된 시스템에서 당일매매 회ㅅ수제한, 100캔들 평균 거래량과 거래대금, 이격도, 당일 시가가 전일 종가 이상의 조건을 추가(전일 종가 조건 불가시 마지막 캔들의 종가<당일 시가)
번거로우실거 같아서 최초 답변과 수정답변을 아래에 첨부합니다
최초답변받은 시스템
----------------------
input : aa(100),bb(2),CC(100),dd(2),금액(1000000);
var : Ov(0),TT(0),Xvol(0),Xcnt(0);
Ov = OBV;
var1 = ma(V,aa);
var2 = abs(Ov-Ov[1]);
var3 = ma(var2,CC);
if MarketPosition == 0 and
!(CurrentContracts < CurrentContracts[1]) and
V >= var1[1]*bb and
var2 >= var3[1]*dd and
Ov-Ov[1] > 0 Then
buy("b1",OnClose,def,floor(금액*0.3/C));
if MarketPosition == 1 Then{
if BarsSinceEntry == 1 then
buy("b2",OnClose,def,floor(금액*0.4/C));
if BarsSinceEntry == 2 then
buy("b3",OnClose,def,floor(금액*0.3/C));
if CurrentContracts > CurrentContracts[1] and MaxEntries == 3 Then
TT = TimeToMinutes(stime);
if CurrentContracts < CurrentContracts Then
Xcnt = Xcnt+1;
if MaxEntries == 3 and TimeToMinutes(stime) >= TT+30 then{
if countif(LatestExitName(0) == "BP1",BarsSinceEntry) < 1 then{
if Xcnt < 2 Then
Xvol = floor(MaxContracts*0.3);
Else
Xvol = CurrentContracts;
ExitLong("BP1",atlimit,LatestEntryPrice(0)*1.01,"",Xvol,1);
}
if countif(LatestExitName(0) == "BP2",BarsSinceEntry) < 1 then{
if Xcnt < 2 Then
Xvol = floor(MaxContracts*0.4);
Else
Xvol = CurrentContracts;
ExitLong("BP2",atlimit,LatestEntryPrice(0)*1.02,"",Xvol,1);
}
if countif(LatestExitName(0) == "BL1",BarsSinceEntry) < 1 then{
if Xcnt < 2 Then
Xvol = floor(MaxContracts*0.3);
Else
Xvol = CurrentContracts;
ExitLong("BL1",AtStop,LatestEntryPrice(0)*0.99,"",Xvol,1);
}
if countif(LatestExitName(0) == "BL2",BarsSinceEntry) < 1 then{
if Xcnt < 2 Then
Xvol = floor(MaxContracts*0.4);
Else
Xvol = CurrentContracts;
ExitLong("BL2",AtStop,LatestEntryPrice(0)*0.98,"",Xvol,1);
}
exitlong("bp3",atlimit,LatestEntryPrice(0)*1.03);
exitlong("bl3",AtStop,LatestEntryPrice(0)*0.97);
}
}
if MarketPosition != 1 Then
Xcnt = 0;
수정된 시스템
--------------------
input : aa(100),bb(2),CC(100),dd(2),금액(1000000);
var : TT(0),Xvol(0),Xcnt(0),sum1(0),cnt(0);
var : Prc(0),Prc1(0),OBVv(0),sum2(0),idx(0);
Array : VV[101](0),Ov[101](0);
if stime < 145000 Then{
idx = idx+1;
If Prc > Prc1 Then
OBVv = OBVv + Volume;
Else If Prc < Prc1 Then
OBVv = OBVv - Volume;
Else
OBVv = OBVv;
VV[0] = V;
Ov[0] = OBVv;
for cnt = 0 to 100{
VV[cnt] = VV[cnt-1][1];
OV[cnt] = OV[cnt-1][1];
}
Prc = C;
Prc1 = CC[1];
}
sum1 = 0;
for cnt = 0 to aa-1{
sum1 = VV[cnt];
}
var1 = sum1/aa;
var2 = abs(OV[0]-OV[1]);
sum2 = 0;
for cnt = 0 to cc-1{
sum2 = sum2+abs(OV[cnt]-OV[cnt+1]);
}
var3 = sum2/cc;
if MarketPosition == 0 and idx >= aa and idx >= cc and
!(CurrentContracts < CurrentContracts[1]) and
V >= var1[1]*bb and
var2 >= var3[1]*dd and
Ov-Ov[1] > 0 and idx >= aa and idx >= cc Then
buy("b1",OnClose,def,floor(금액*0.3/C));
if MarketPosition == 1 Then{
if BarsSinceEntry == 1 then
buy("b2",OnClose,def,floor(금액*0.4/C));
if BarsSinceEntry == 2 then
buy("b3",OnClose,def,floor(금액*0.3/C));
if CurrentContracts > CurrentContracts[1] and MaxEntries == 3 Then
TT = TimeToMinutes(stime);
if CurrentContracts < CurrentContracts Then
Xcnt = Xcnt+1;
if MaxEntries == 3 and TimeToMinutes(stime) >= TT+30 then{
if countif(LatestExitName(0) == "BP1",BarsSinceEntry) < 1 then{
if Xcnt < 2 Then
Xvol = floor(MaxContracts*0.3);
Else
Xvol = CurrentContracts;
ExitLong("BP1",atlimit,LatestEntryPrice(0)*1.01,"",Xvol,1);
}
if countif(LatestExitName(0) == "BP2",BarsSinceEntry) < 1 then{
if Xcnt < 2 Then
Xvol = floor(MaxContracts*0.4);
Else
Xvol = CurrentContracts;
ExitLong("BP2",atlimit,LatestEntryPrice(0)*1.02,"",Xvol,1);
}
if countif(LatestExitName(0) == "BL1",BarsSinceEntry) < 1 then{
if Xcnt < 2 Then
Xvol = floor(MaxContracts*0.3);
Else
Xvol = CurrentContracts;
ExitLong("BL1",AtStop,LatestEntryPrice(0)*0.99,"",Xvol,1);
}
if countif(LatestExitName(0) == "BL2",BarsSinceEntry) < 1 then{
if Xcnt < 2 Then
Xvol = floor(MaxContracts*0.4);
Else
Xvol = CurrentContracts;
ExitLong("BL2",AtStop,LatestEntryPrice(0)*0.98,"",Xvol,1);
}
exitlong("bp3",atlimit,LatestEntryPrice(0)*1.03);
exitlong("bl3",AtStop,LatestEntryPrice(0)*0.97);
}
}
if MarketPosition != 1 Then
Xcnt = 0;
이전글