커뮤니티
수고가 많으십니다 시스템식 수정 부탁드립니다
2013-08-09 11:51:49
167
글번호 66270
1..위 식에서 당일 시가 부터 움직여서 기준가를 인식하여 매매가 되도록 해주십시요
전일 종가나 야간장이나 모두 움직임에 대해서는 인식이 안되도록 부탁드립니다
2. 그리고 기준가에서 눌림목 0.4P마다 계속 매매신호가 발생하는데 이것을 그냥 조건만
되면 첫 신호가 나오게 좀 해주십시오,,,,수정한것은 기준가에서 한번만 하도록
수정이 되었는데 제가 생각하는 것과는 조금 틀린것 같아 그러니 양해 바랍니다
만약 그것이 힘들다면 매수 신호가 한번 나오면 그 다음은 매도 신호가 나올때 까지는
추가 매수신호는 나오지 않도록 해 주십시요 즉 매수 한번 하고 나면 그 다음은 매도
신호가 나올때 까지는 매매신호가 나오지 않도록 부탁드립니다
3. 하루 매매횟수를 제한을 할수 있도록 해 주시면 감사하겠습니다
즉 매수 2번 ,,,,매도 2번 등 기준가 처럼 외부에서 제한 할수 있도록 부탁드립니다
더운데 고생시켜서 죄송합니다 ,,,초보라서 아는게 없어 그러니 많은 양해 바랍니다
input : 기준가(250);
var : direction(0),HH(0),LL(0);
var1 = 기준가-5.0;
var2 = 기준가-2.5;
var3 = 기준가;
var4 = 기준가+2.5;
var5 = 기준가+5.0;
if crossup(C,var1) Then {
direction = 1;
HH = H;
}
if crossup(C,var2) Then {
direction = 2;
HH = H;
}
if crossup(C,var3) Then {
direction = 3;
HH = H;
}
if crossup(C,var4) Then {
direction = 4;
HH = H;
}
if crossup(C,var5) Then {
direction = 5;
HH = H;
}
if CrossDown(C,var1) Then {
direction = -1;
LL = L;
}
if CrossDown(C,var2) Then {
direction = -2;
LL = L;
}
if CrossDown(C,var3) Then{
direction = -3;
LL = L;
}
if CrossDown(C,var4) Then {
direction = -4;
LL = L;
}
if CrossDown(C,var5) Then {
direction = -5;
LL = L;
}
if H > HH Then
HH = H;
if L < LL Then
LL = L;
if stime >= 090000 and stime < 150000 then{
if direction == 1 and HH >= var1+0.8 Then buy("b1",AtLimit,HH-0.4);
if direction == 2 and HH >= var2+0.8 Then buy("b2",AtLimit,HH-0.4);
if direction == 3 and HH >= var3+0.8 Then buy("b3",AtLimit,HH-0.4);
if direction == 4 and HH >= var4+0.8 Then buy("b4",AtLimit,HH-0.4);
if direction == 5 and HH >= var5+0.8 Then buy("b5",AtLimit,HH-0.4);
if direction == -1 and LL <= var1-0.8 Then Sell("s1",AtLimit,LL+0.4);
if direction == -2 and LL <= var2-0.8 Then Sell("s2",AtLimit,LL+0.4);
if direction == -3 and LL <= var3-0.8 Then Sell("s3",AtLimit,LL+0.4);
if direction == -4 and LL <= var4-0.8 Then Sell("s4",AtLimit,LL+0.4);
if direction == -5 and LL <= var5-0.8 Then Sell("s5",AtLimit,LL+0.4);
}
답변 1
예스스탁 예스스탁 답변
2013-08-09 15:40:44
안녕하세요
예스스탁입니다.
식을 수정했습니다.
각 기준선별 진입은 매수와 매도 따로 횟수를 지정하도록 작성했습니다.
input : 기준가(243.60),매수진입별횟수(2),매도진입별횟수(2);
var : direction(0),HH(0),LL(0),cnt(0),count(0);
var : Bcond1(false),Bcond2(false),Bcond3(false),Bcond4(false),Bcond5(false);
var : Scond1(false),Scond2(false),Scond3(false),Scond4(false),Scond5(false);
var : Bcnt1(0),Bcnt2(0),Bcnt3(0),Bcnt4(0),Bcnt5(0);
var : Scnt1(0),Scnt2(0),Scnt3(0),Scnt4(0),Scnt5(0);
var1 = 기준가-5.0;
var2 = 기준가-2.5;
var3 = 기준가;
var4 = 기준가+2.5;
var5 = 기준가+5.0;
if date != date[1] Then
direction = 0;
count = 0;
Bcnt1 = 0;Bcnt2 = 0;Bcnt3 = 0;Bcnt4 = 0;Bcnt5 = 0;
Scnt1 = 0;Scnt2 = 0;Scnt3 = 0;Scnt4 = 0;Scnt5 = 0;
for cnt = 0 to 20{
if sdate == EntryDate(cnt) Then{
count = count+1;
if IsEntryName("b1",cnt) == true Then Bcnt1 = Bcnt1+1;
if IsEntryName("b2",cnt) == true Then Bcnt2 = Bcnt2+1;
if IsEntryName("b3",cnt) == true Then Bcnt3 = Bcnt3+1;
if IsEntryName("b4",cnt) == true Then Bcnt4 = Bcnt4+1;
if IsEntryName("b5",cnt) == true Then Bcnt5 = Bcnt5+1;
if IsEntryName("s1",cnt) == true Then Scnt1 = Scnt1+1;
if IsEntryName("s2",cnt) == true Then Scnt2 = Scnt2+1;
if IsEntryName("s3",cnt) == true Then Scnt3 = Scnt3+1;
if IsEntryName("s4",cnt) == true Then Scnt4 = Scnt4+1;
if IsEntryName("s5",cnt) == true Then Scnt5 = Scnt5+1;
}
}
if dayindex > 0 Then{
if crossup(C,var1) Then {
direction = 1;
HH = H;
}
if crossup(C,var2) Then {
direction = 2;
HH = H;
}
if crossup(C,var3) Then {
direction = 3;
HH = H;
}
if crossup(C,var4) Then {
direction = 4;
HH = H;
}
if crossup(C,var5) Then {
direction = 5;
HH = H;
}
if CrossDown(C,var1) Then {
direction = -1;
LL = L;
}
if CrossDown(C,var2) Then {
direction = -2;
LL = L;
}
if CrossDown(C,var3) Then{
direction = -3;
LL = L;
}
if CrossDown(C,var4) Then {
direction = -4;
LL = L;
}
if CrossDown(C,var5) Then {
direction = -5;
LL = L;
}
}
if H > HH Then HH = H;
if L < LL Then LL = L;
Bcond1 = (count == 0 and countif(direction == 1 and direction[1] != 1,dayindex) >= 1) or
(count >= 1 and MarketPosition != 0 and countif(direction == 1 and direction[1] != 1,BarsSinceEntry) >= 1) or
(count >= 1 and MarketPosition == 0 and countif(direction == 1 and direction[1] != 1,BarsSinceExit(1)) >= 1);
Bcond2 = (count == 0 and countif(direction == 2 and direction[1] != 2,dayindex) >= 1) or
(count >= 1 and MarketPosition != 0 and countif(direction == 2 and direction[1] != 2,BarsSinceEntry) >= 1) or
(count >= 1 and MarketPosition == 0 and countif(direction == 2 and direction[1] != 2,BarsSinceExit(1)) >= 1);
Bcond3 = (count == 0 and countif(direction == 3 and direction[1] != 3,dayindex) >= 1) or
(count >= 1 and MarketPosition != 0 and countif(direction == 3 and direction[1] != 3,BarsSinceEntry) >= 1) or
(count >= 1 and MarketPosition == 0 and countif(direction == 3 and direction[1] != 3,BarsSinceExit(1)) >= 1);
Bcond4 = (count == 0 and countif(direction == 4 and direction[1] != 4,dayindex) >= 1) or
(count >= 1 and MarketPosition != 0 and countif(direction == 4 and direction[1] != 4,BarsSinceEntry) >= 1) or
(count >= 1 and MarketPosition == 0 and countif(direction == 4 and direction[1] != 4,BarsSinceExit(1)) >= 1);
Bcond5 = (count == 0 and countif(direction == 5 and direction[1] != 5,dayindex) >= 1) or
(count >= 1 and MarketPosition != 0 and countif(direction == 5 and direction[1] != 5,BarsSinceEntry) >= 1) or
(count >= 1 and MarketPosition == 0 and countif(direction == 5 and direction[1] != 5,BarsSinceExit(1)) >= 1);
Scond1 = (count == 0 and countif(direction == -1 and direction[1] != -1,dayindex) >= 1) or
(count >= 1 and MarketPosition != 0 and countif(direction == -1 and direction[1] != -1,BarsSinceEntry) >= 1) or
(count >= 1 and MarketPosition == 0 and countif(direction == -1 and direction[1] != -1,BarsSinceExit(1)) >= 1);
Scond2 = (count == 0 and countif(direction == -2 and direction[1] != -2,dayindex) >= 1) or
(count >= 1 and MarketPosition != 0 and countif(direction == -2 and direction[1] != -2,BarsSinceEntry) >= 1) or
(count >= 1 and MarketPosition == 0 and countif(direction == -2 and direction[1] != -2,BarsSinceExit(1)) >= 1);
Scond3 = (count == 0 and countif(direction == -3 and direction[1] != -3,dayindex) >= 1) or
(count >= 1 and MarketPosition != 0 and countif(direction == -3 and direction[1] != -3,BarsSinceEntry) >= 1) or
(count >= 1 and MarketPosition == 0 and countif(direction == -3 and direction[1] != -3,BarsSinceExit(1)) >= 1);
Scond4 = (count == 0 and countif(direction == -4 and direction[1] != -4,dayindex) >= 1) or
(count >= 1 and MarketPosition != 0 and countif(direction == -4 and direction[1] != -4,BarsSinceEntry) >= 1) or
(count >= 1 and MarketPosition == 0 and countif(direction == -4 and direction[1] != -4,BarsSinceExit(1)) >= 1);
Scond5 = (count == 0 and countif(direction == -5 and direction[1] != -5,dayindex) >= 1) or
(count >= 1 and MarketPosition != 0 and countif(direction == -5 and direction[1] != -5,BarsSinceEntry) >= 1) or
(count >= 1 and MarketPosition == 0 and countif(direction == -5 and direction[1] != -5,BarsSinceExit(1)) >= 1);
if stime > 090000 and stime < 150000 then{
if direction == 1 and HH >= var1+0.8 and Bcond1 == true and Bcnt1 < 매수진입별횟수 Then buy("b1",AtLimit,HH-0.4);
if direction == 2 and HH >= var2+0.8 and Bcond2 == true and Bcnt2 < 매수진입별횟수 Then buy("b2",AtLimit,HH-0.4);
if direction == 3 and HH >= var3+0.8 and Bcond3 == true and Bcnt3 < 매수진입별횟수 Then buy("b3",AtLimit,HH-0.4);
if direction == 4 and HH >= var4+0.8 and Bcond4 == true and Bcnt4 < 매수진입별횟수 Then buy("b4",AtLimit,HH-0.4);
if direction == 5 and HH >= var5+0.8 and Bcond5 == true and Bcnt5 < 매수진입별횟수 Then buy("b5",AtLimit,HH-0.4);
if direction == -1 and LL <= var1-0.8 and Scond1 == true and Scnt1 < 매도진입별횟수 Then Sell("s1",AtLimit,LL+0.4);
if direction == -2 and LL <= var2-0.8 and Scond2 == true and Scnt2 < 매도진입별횟수 Then Sell("s2",AtLimit,LL+0.4);
if direction == -3 and LL <= var3-0.8 and Scond3 == true and Scnt3 < 매도진입별횟수 Then Sell("s3",AtLimit,LL+0.4);
if direction == -4 and LL <= var4-0.8 and Scond4 == true and Scnt4 < 매도진입별횟수 Then Sell("s4",AtLimit,LL+0.4);
if direction == -5 and LL <= var5-0.8 and Scond5 == true and Scnt5 < 매도진입별횟수 Then Sell("s5",AtLimit,LL+0.4);
}
즐거운 하루되세요
> 리치존 님이 쓴 글입니다.
> 제목 : 수고가 많으십니다 시스템식 수정 부탁드립니다
> 1..위 식에서 당일 시가 부터 움직여서 기준가를 인식하여 매매가 되도록 해주십시요
전일 종가나 야간장이나 모두 움직임에 대해서는 인식이 안되도록 부탁드립니다
2. 그리고 기준가에서 눌림목 0.4P마다 계속 매매신호가 발생하는데 이것을 그냥 조건만
되면 첫 신호가 나오게 좀 해주십시오,,,,수정한것은 기준가에서 한번만 하도록
수정이 되었는데 제가 생각하는 것과는 조금 틀린것 같아 그러니 양해 바랍니다
만약 그것이 힘들다면 매수 신호가 한번 나오면 그 다음은 매도 신호가 나올때 까지는
추가 매수신호는 나오지 않도록 해 주십시요 즉 매수 한번 하고 나면 그 다음은 매도
신호가 나올때 까지는 매매신호가 나오지 않도록 부탁드립니다
3. 하루 매매횟수를 제한을 할수 있도록 해 주시면 감사하겠습니다
즉 매수 2번 ,,,,매도 2번 등 기준가 처럼 외부에서 제한 할수 있도록 부탁드립니다
더운데 고생시켜서 죄송합니다 ,,,초보라서 아는게 없어 그러니 많은 양해 바랍니다
input : 기준가(250);
var : direction(0),HH(0),LL(0);
var1 = 기준가-5.0;
var2 = 기준가-2.5;
var3 = 기준가;
var4 = 기준가+2.5;
var5 = 기준가+5.0;
if crossup(C,var1) Then {
direction = 1;
HH = H;
}
if crossup(C,var2) Then {
direction = 2;
HH = H;
}
if crossup(C,var3) Then {
direction = 3;
HH = H;
}
if crossup(C,var4) Then {
direction = 4;
HH = H;
}
if crossup(C,var5) Then {
direction = 5;
HH = H;
}
if CrossDown(C,var1) Then {
direction = -1;
LL = L;
}
if CrossDown(C,var2) Then {
direction = -2;
LL = L;
}
if CrossDown(C,var3) Then{
direction = -3;
LL = L;
}
if CrossDown(C,var4) Then {
direction = -4;
LL = L;
}
if CrossDown(C,var5) Then {
direction = -5;
LL = L;
}
if H > HH Then
HH = H;
if L < LL Then
LL = L;
if stime >= 090000 and stime < 150000 then{
if direction == 1 and HH >= var1+0.8 Then buy("b1",AtLimit,HH-0.4);
if direction == 2 and HH >= var2+0.8 Then buy("b2",AtLimit,HH-0.4);
if direction == 3 and HH >= var3+0.8 Then buy("b3",AtLimit,HH-0.4);
if direction == 4 and HH >= var4+0.8 Then buy("b4",AtLimit,HH-0.4);
if direction == 5 and HH >= var5+0.8 Then buy("b5",AtLimit,HH-0.4);
if direction == -1 and LL <= var1-0.8 Then Sell("s1",AtLimit,LL+0.4);
if direction == -2 and LL <= var2-0.8 Then Sell("s2",AtLimit,LL+0.4);
if direction == -3 and LL <= var3-0.8 Then Sell("s3",AtLimit,LL+0.4);
if direction == -4 and LL <= var4-0.8 Then Sell("s4",AtLimit,LL+0.4);
if direction == -5 and LL <= var5-0.8 Then Sell("s5",AtLimit,LL+0.4);
}
다음글
이전글