커뮤니티
시스템식 문의
2009-05-26 12:13:37
858
글번호 22432
[시스템 내용]
1. 차트- 10분봉,갭보정차트
2.최초매수- CCI(30)이 -100선을 돌파시매수(crossup(CCI(30), -100)) 1계약
3. 최초매수 후 매수평균가가 수익 20%시 매수청산
최초매수 후 20%수익을 달성못하고 CCI(30)이 -100선을 두번째 돌파시 2계약매수(2차매수)
4. 2차매수평균가가 수익 10%시 매수청산
2차매수후 수익을 달성 못하고 CCI(30)이 -100선을 세번째 돌파시 6계약 매수(3차매수)
5. 3차매수 후 매수평균가가 수익 5% 시 매수청산
6. 3차매수 후 목표수익을 달성 못하고 CCI(30) -100선을 네번째 돌파시 18계약 매수(4차매수)
7. 4차매수후 매수평균가 수익이 2% OR -5%시 매수청산
위 내용으로 제가 시스템식을 만들었으나 제대로 작동이 되지 않습니다.
도움을 주셨으면 합니다.
아래는 제가 만들어본 식입니다. 좋은 하루 되세요~~~
(시스템식)
var : Bcond1(0),Bcond2(0),Bcond3(0);
var : Scond1(0),Scond2(0),Scond3(0);
var : 두번째매수가(0),세번째매수가(0),네번째매수가(0),매수상태(0);
if MarketPosition() == 0 then{
Bcond1 = 0;
Bcond2 = 0;
Bcond3 = 0;
Scond1 = 0;
Scond2 = 0;
Scond3 = 0;
매수상태=0;
}
if MarketPosition() == 0 and crossup(CCI(30), -100) Then
buy("매수1",onclose,def,1);
매수상태=1;
if MarketPosition() == 1 Then{
if crossup(CCI(30), -100) and Bcond1 < 1 Then{
buy("매수2",onclose,def,2);
Bcond1 = 1;
두번째매수가=c;
매수상태=2;
}
if crossup(CCI(30), -100) and Bcond2 < 1 and 두번째매수가>c Then{
buy("매수3",onclose,def,6);
Bcond2 = 1;
세번째매수가=c;
매수상태=3;
}
if crossup(CCI(30), -100) and Bcond3 < 1 and 세번째매수가>c Then{
buy("매수4",onclose,def,18);
Bcond3 = 1;
네번째매수가=c;
매수상태=4;
}
if 매수상태==1 and AvgEntryPrice*1.20<c and Scond1 < 1 Then{
exitlong("매수청산1",onclose,def);
Scond1 = 1;
}
if 매수상태==2 and AvgEntryPrice*1.10<c and Scond2 < 1 Then{
exitlong("매수청산2",onclose,def);
Scond1 = 1;
}
if 매수상태==3 and AvgEntryPrice*1.05<c and Scond3 < 1 Then{
exitlong("매수청산3",onclose,def);
Scond1 = 1;
}
if 매수상태==4 and AvgEntryPrice*1.02<c and Scond3 < 1 Then{
exitlong("매수청산4",onclose,def);
Scond1 = 1;
}
}
- 1. 시험적용(CCI).ysg (0.00 MB)
답변 1
예스스탁 예스스탁 답변
2009-05-26 14:12:08
안녕하세요
예스스탁입니다.
식을 수정했습니다.
input : CCIP(30);
var1 = CCI(CCIP);
if MarketPosition == 0 Then{
if crossup(var1, -100) and CurrentEntries == 0 Then
buy("b1",OnClose,def,1);
}
if MarketPosition == 1 Then{
if crossup(var1, -100) and CurrentEntries == 1 Then
buy("b2",OnClose,def,2);
if crossup(var1, -100) and CurrentEntries == 2 Then
buy("b3",OnClose,def,6);
if crossup(var1, -100) and CurrentEntries == 3 Then
buy("b4",OnClose,def,18);
}
if MarketPosition == 1 Then{
if CurrentEntries == 1 Then
ExitLong("B1x",Atlimit,AvgEntryPrice*1.2);
if CurrentEntries == 2 Then
ExitLong("B2x",Atlimit,AvgEntryPrice*1.1);
if currentEntries == 3 Then
ExitLong("B3x",Atlimit,AvgEntryPrice*1.05);
if currentEntries == 4 Then{
ExitLong("B4xP",Atlimit,AvgEntryPrice*1.02);
ExitLong("B4xL",AtStop,AvgEntryPrice*0.95);
}
}
즐거운 하루되세요
> 미운오리 님이 쓴 글입니다.
> 제목 : 시스템식 문의
> [시스템 내용]
1. 차트- 10분봉,갭보정차트
2.최초매수- CCI(30)이 -100선을 돌파시매수(crossup(CCI(30), -100)) 1계약
3. 최초매수 후 매수평균가가 수익 20%시 매수청산
최초매수 후 20%수익을 달성못하고 CCI(30)이 -100선을 두번째 돌파시 2계약매수(2차매수)
4. 2차매수평균가가 수익 10%시 매수청산
2차매수후 수익을 달성 못하고 CCI(30)이 -100선을 세번째 돌파시 6계약 매수(3차매수)
5. 3차매수 후 매수평균가가 수익 5% 시 매수청산
6. 3차매수 후 목표수익을 달성 못하고 CCI(30) -100선을 네번째 돌파시 18계약 매수(4차매수)
7. 4차매수후 매수평균가 수익이 2% OR -5%시 매수청산
위 내용으로 제가 시스템식을 만들었으나 제대로 작동이 되지 않습니다.
도움을 주셨으면 합니다.
아래는 제가 만들어본 식입니다. 좋은 하루 되세요~~~
(시스템식)
var : Bcond1(0),Bcond2(0),Bcond3(0);
var : Scond1(0),Scond2(0),Scond3(0);
var : 두번째매수가(0),세번째매수가(0),네번째매수가(0),매수상태(0);
if MarketPosition() == 0 then{
Bcond1 = 0;
Bcond2 = 0;
Bcond3 = 0;
Scond1 = 0;
Scond2 = 0;
Scond3 = 0;
매수상태=0;
}
if MarketPosition() == 0 and crossup(CCI(30), -100) Then
buy("매수1",onclose,def,1);
매수상태=1;
if MarketPosition() == 1 Then{
if crossup(CCI(30), -100) and Bcond1 < 1 Then{
buy("매수2",onclose,def,2);
Bcond1 = 1;
두번째매수가=c;
매수상태=2;
}
if crossup(CCI(30), -100) and Bcond2 < 1 and 두번째매수가>c Then{
buy("매수3",onclose,def,6);
Bcond2 = 1;
세번째매수가=c;
매수상태=3;
}
if crossup(CCI(30), -100) and Bcond3 < 1 and 세번째매수가>c Then{
buy("매수4",onclose,def,18);
Bcond3 = 1;
네번째매수가=c;
매수상태=4;
}
if 매수상태==1 and AvgEntryPrice*1.20<c and Scond1 < 1 Then{
exitlong("매수청산1",onclose,def);
Scond1 = 1;
}
if 매수상태==2 and AvgEntryPrice*1.10<c and Scond2 < 1 Then{
exitlong("매수청산2",onclose,def);
Scond1 = 1;
}
if 매수상태==3 and AvgEntryPrice*1.05<c and Scond3 < 1 Then{
exitlong("매수청산3",onclose,def);
Scond1 = 1;
}
if 매수상태==4 and AvgEntryPrice*1.02<c and Scond3 < 1 Then{
exitlong("매수청산4",onclose,def);
Scond1 = 1;
}
}