커뮤니티
54324에대한 재질문입니다
2017-08-07 14:21:28
145
글번호 111849
안녕하세요^^ 제 요구사항에 대해 오해가 있었나봐요...
매도기준으로 설명하면...
기준선을 봉이 종가로 관통하고 난뒤,,, <진입않함>>
반등해서 가격이 기준선과 다시 만나면 <<매도1>>
하방하다 다시 올라와서 기준선과 만나면 <<매도2>>
기줜선을 상방으로 돌파하면 매수상황이나
손절되기 전까지는 매도유지
매수진입한 것이 손절되었다면 이미 상방돌파했으므로
매수상황 전환 가격이 하락해서 기준선과 만나면 <<매수1>>
<<매수2>>
<<첨부파일 참고 부탁드립니다>>
안녕하세요
예스스탁입니다,
input : E1(1),E2(1),E3(1),x(10),p1(15),p2(30),p3(90);
var : T(0),count(0);
var1 = ma(C,20);
if crossup(C,var1) Then{
T = 1;
count = 0;
}
if CrossDown(C,var1) Then{
T = -1;
count = 0;
}
if T == 1 and L <= var1 Then{
count = count+1;
if E1 == 1 and count == 1 Then
buy("b1",OnClose,def,1);
if E2 == 1 and count == 1 Then
buy("b2",OnClose,def,1);
if E3 == 1 and count == 1 Then
buy("b3",OnClose,def,1);
}
if T == -1 and H >= var1 Then{
count = count+1;
if E1 == 1 and count == 1 Then
sell("s1",OnClose,def,1);
if E2 == 1 and count == 2 Then
sell("s2",OnClose,def,1);
if E3 == 1 and count == 3 Then
sell("s3",OnClose,def,1);
}
if MarketPosition == 1 Then{
exitlong("bl",AtStop,EntryPrice-PriceScale*x);
if CurrentContracts < CurrentContracts[1] and LatestExitName(0) == "bp1" Then
Condition11 = true;
if CurrentContracts < CurrentContracts[1] and LatestExitName(0) == "bp2" Then
Condition12 = true;
if CurrentContracts < CurrentContracts[1] and LatestExitName(0) == "bp3" Then
Condition13 = true;
if Condition11 == false Then
ExitLong("bp1",Atlimit,EntryPrice+PriceScale*p1,"",1,1);
if Condition12 == false Then
ExitLong("bp2",Atlimit,EntryPrice+PriceScale*p2,"",1,1);
if Condition13 == false Then
ExitLong("bp3",Atlimit,EntryPrice+PriceScale*p3,"",1,1);
}
Else{
Condition11 = false;
Condition12 = false;
Condition13 = false;
}
if MarketPosition == -1 Then{
ExitShort("sl",AtStop,EntryPrice+PriceScale*x);
if CurrentContracts < CurrentContracts[1] and LatestExitName(0) == "sp1" Then
Condition21 = true;
if CurrentContracts < CurrentContracts[1] and LatestExitName(0) == "sp2" Then
Condition22 = true;
if CurrentContracts < CurrentContracts[1] and LatestExitName(0) == "sp3" Then
Condition23 = true;
if Condition21 == false Then
ExitShort("sp1",Atlimit,EntryPrice-PriceScale*p1,"",1,1);
if Condition22 == false Then
ExitShort("sp2",Atlimit,EntryPrice-PriceScale*p2,"",1,1);
if Condition23 == false Then
ExitShort("sp3",Atlimit,EntryPrice-PriceScale*p3,"",1,1);
}
Else{
Condition11 = false;
Condition12 = false;
Condition13 = false;
}
즐거운 하루되세요
> 스로우 님이 쓴 글입니다.
> 제목 : 시스템 문의 드립니다.
> 안녕하세요 ^^
<<매수기준>>
기준선 = 20 이평선 가정
기준선을 아래에서 위로 돌파(종가기준)한뒤 가격이 내려오면서
1) 가격이 기준선과 처음 만나면 매수1
2) 두번째 만나면 매수2
3) 두번째 만나면 매수3
그 이후 무시
< 유효한 만남 횟수를 임의로 정할 수 있으면 좋겠읍니다
예) 매수1만 인정, 매수1/매수2 만 인정, 매수1/매수2/매수3 만 인정>
<<매도는 반대 적용>>
* 손절 10틱 1청 15틱 2청 30틱 3청 90틱 등으로 청산될수있도록 설정하되 각각의 틱수또한 임의로 설정하게 셑팅
감사합니다.
- 1. 시스템_설명.PNG (0.02 MB)
답변 1
예스스탁 예스스탁 답변
2017-08-07 15:32:21
안녕하세요
예스스탁입니다.
터치조건을 수정했습니다.
하향이탈 후 이평 아래에서 위로 상승해 터치할때만 카운트 증가
상향돌파 후 이평 위에서 아래로 내려와 터치할때만 카운트 증가로
변경했습니다.
수식에 주석을 남겨드립니다
이후 내용은 수식참고하셔서 수정보완하시기 바랍니다.
input : E1(1),E2(1),E3(1),x(10),p1(15),p2(30),p3(90);
var : T(0),count(0);
var1 = ma(C,20);
#상향돌파
if crossup(C,var1) Then{
T = 1; #돌파방향 변수는 1
count = 0; #터치카운트 변수는 0
}
#하향이탈
if CrossDown(C,var1) Then{
T = -1; #돌파방향 변수는 -1
count = 0; #터치카운트 변수는 0
}
#상향돌파 후 전봉은 저가가 이평위이고 현재봉에서 하락해 이평선과 같거나 낮음
if T == 1 and T[1] == 1 and L <= var1 and L[1] > var1[1] Then{
#카운트 1씩 증가
count = count+1;
#첫번째일때 매수(E1이 1이 아니면 매수안함)
if E1 == 1 and count == 1 Then
buy("b1",OnClose,def,1);
#두번째일때 매수(E2이 1이 아니면 매수안함)
if E2 == 1 and count == 1 Then
buy("b2",OnClose,def,1);
#세번째일때 매수(E3이 1이 아니면 매수안함)
if E3 == 1 and count == 1 Then
buy("b3",OnClose,def,1);
}
#하향이탈 후 전봉은 고가가 이평 아래이고 현재봉에서 상승해 이평선과 같거나 높음
if T == -1 and H >= var1 and H[1] < var1[1] Then{
#카운트 1씩 증가
count = count+1;
#첫번째일때 매도(E1이 1이 아니면 매도안함)
if E1 == 1 and count == 1 Then
sell("s1",OnClose,def,1);
#두번째일때 매도(E1이 1이 아니면 매도안함)
if E2 == 1 and count == 2 Then
sell("s2",OnClose,def,1);
#세번째일때 매도(E1이 1이 아니면 매도안함)
if E3 == 1 and count == 3 Then
sell("s3",OnClose,def,1);
}
if MarketPosition == 1 Then{
#첫진입가격 대비 x틱 손실이면 청산
exitlong("bl",AtStop,EntryPrice-PriceScale*x);
#목표수익 - 각 청산이름별로 한번씩만 발동
if CurrentContracts < CurrentContracts[1] and LatestExitName(0) == "bp1" Then
Condition11 = true;
if CurrentContracts < CurrentContracts[1] and LatestExitName(0) == "bp2" Then
Condition12 = true;
if CurrentContracts < CurrentContracts[1] and LatestExitName(0) == "bp3" Then
Condition13 = true;
if Condition11 == false Then
ExitLong("bp1",Atlimit,EntryPrice+PriceScale*p1,"",1,1);
if Condition12 == false Then
ExitLong("bp2",Atlimit,EntryPrice+PriceScale*p2,"",1,1);
if Condition13 == false Then
ExitLong("bp3",Atlimit,EntryPrice+PriceScale*p3,"",1,1);
}
Else{
Condition11 = false;
Condition12 = false;
Condition13 = false;
}
if MarketPosition == -1 Then{
#첫진입가격 대비 x틱 손실이면 청산
ExitShort("sl",AtStop,EntryPrice+PriceScale*x);
#목표수익 - 각 청산이름별로 한번씩만 발동
if CurrentContracts < CurrentContracts[1] and LatestExitName(0) == "sp1" Then
Condition21 = true;
if CurrentContracts < CurrentContracts[1] and LatestExitName(0) == "sp2" Then
Condition22 = true;
if CurrentContracts < CurrentContracts[1] and LatestExitName(0) == "sp3" Then
Condition23 = true;
if Condition21 == false Then
ExitShort("sp1",Atlimit,EntryPrice-PriceScale*p1,"",1,1);
if Condition22 == false Then
ExitShort("sp2",Atlimit,EntryPrice-PriceScale*p2,"",1,1);
if Condition23 == false Then
ExitShort("sp3",Atlimit,EntryPrice-PriceScale*p3,"",1,1);
}
Else{
Condition11 = false;
Condition12 = false;
Condition13 = false;
}
즐거운 하루되세요
> 스로우 님이 쓴 글입니다.
> 제목 : 54324에대한 재질문입니다
> 안녕하세요^^ 제 요구사항에 대해 오해가 있었나봐요...
매도기준으로 설명하면...
기준선을 봉이 종가로 관통하고 난뒤,,, <진입않함>>
반등해서 가격이 기준선과 다시 만나면 <<매도1>>
하방하다 다시 올라와서 기준선과 만나면 <<매도2>>
기줜선을 상방으로 돌파하면 매수상황이나
손절되기 전까지는 매도유지
매수진입한 것이 손절되었다면 이미 상방돌파했으므로
매수상황 전환 가격이 하락해서 기준선과 만나면 <<매수1>>
<<매수2>>
<<첨부파일 참고 부탁드립니다>>
안녕하세요
예스스탁입니다,
input : E1(1),E2(1),E3(1),x(10),p1(15),p2(30),p3(90);
var : T(0),count(0);
var1 = ma(C,20);
if crossup(C,var1) Then{
T = 1;
count = 0;
}
if CrossDown(C,var1) Then{
T = -1;
count = 0;
}
if T == 1 and L <= var1 Then{
count = count+1;
if E1 == 1 and count == 1 Then
buy("b1",OnClose,def,1);
if E2 == 1 and count == 1 Then
buy("b2",OnClose,def,1);
if E3 == 1 and count == 1 Then
buy("b3",OnClose,def,1);
}
if T == -1 and H >= var1 Then{
count = count+1;
if E1 == 1 and count == 1 Then
sell("s1",OnClose,def,1);
if E2 == 1 and count == 2 Then
sell("s2",OnClose,def,1);
if E3 == 1 and count == 3 Then
sell("s3",OnClose,def,1);
}
if MarketPosition == 1 Then{
exitlong("bl",AtStop,EntryPrice-PriceScale*x);
if CurrentContracts < CurrentContracts[1] and LatestExitName(0) == "bp1" Then
Condition11 = true;
if CurrentContracts < CurrentContracts[1] and LatestExitName(0) == "bp2" Then
Condition12 = true;
if CurrentContracts < CurrentContracts[1] and LatestExitName(0) == "bp3" Then
Condition13 = true;
if Condition11 == false Then
ExitLong("bp1",Atlimit,EntryPrice+PriceScale*p1,"",1,1);
if Condition12 == false Then
ExitLong("bp2",Atlimit,EntryPrice+PriceScale*p2,"",1,1);
if Condition13 == false Then
ExitLong("bp3",Atlimit,EntryPrice+PriceScale*p3,"",1,1);
}
Else{
Condition11 = false;
Condition12 = false;
Condition13 = false;
}
if MarketPosition == -1 Then{
ExitShort("sl",AtStop,EntryPrice+PriceScale*x);
if CurrentContracts < CurrentContracts[1] and LatestExitName(0) == "sp1" Then
Condition21 = true;
if CurrentContracts < CurrentContracts[1] and LatestExitName(0) == "sp2" Then
Condition22 = true;
if CurrentContracts < CurrentContracts[1] and LatestExitName(0) == "sp3" Then
Condition23 = true;
if Condition21 == false Then
ExitShort("sp1",Atlimit,EntryPrice-PriceScale*p1,"",1,1);
if Condition22 == false Then
ExitShort("sp2",Atlimit,EntryPrice-PriceScale*p2,"",1,1);
if Condition23 == false Then
ExitShort("sp3",Atlimit,EntryPrice-PriceScale*p3,"",1,1);
}
Else{
Condition11 = false;
Condition12 = false;
Condition13 = false;
}
즐거운 하루되세요
> 스로우 님이 쓴 글입니다.
> 제목 : 시스템 문의 드립니다.
> 안녕하세요 ^^
<<매수기준>>
기준선 = 20 이평선 가정
기준선을 아래에서 위로 돌파(종가기준)한뒤 가격이 내려오면서
1) 가격이 기준선과 처음 만나면 매수1
2) 두번째 만나면 매수2
3) 두번째 만나면 매수3
그 이후 무시
< 유효한 만남 횟수를 임의로 정할 수 있으면 좋겠읍니다
예) 매수1만 인정, 매수1/매수2 만 인정, 매수1/매수2/매수3 만 인정>
<<매도는 반대 적용>>
* 손절 10틱 1청 15틱 2청 30틱 3청 90틱 등으로 청산될수있도록 설정하되 각각의 틱수또한 임의로 설정하게 셑팅
감사합니다.
다음글
이전글