커뮤니티
시스템 문의 드립니다.
2017-08-02 14:34:15
100
글번호 111749
안녕하세요 ^^
<<매수기준>>
기준선 = 20 이평선 가정
기준선을 아래에서 위로 돌파(종가기준)한뒤 가격이 내려오면서
1) 가격이 기준선과 처음 만나면 매수1
2) 두번째 만나면 매수2
3) 두번째 만나면 매수3
그 이후 무시
< 유효한 만남 횟수를 임의로 정할 수 있으면 좋겠읍니다
예) 매수1만 인정, 매수1/매수2 만 인정, 매수1/매수2/매수3 만 인정>
<<매도는 반대 적용>>
* 손절 10틱 1청 15틱 2청 30틱 3청 90틱 등으로 청산될수있도록 설정하되 각각의 틱수또한 임의로 설정하게 셑팅
감사합니다.
답변 1
예스스탁 예스스탁 답변
2017-08-03 11:45:11
안녕하세요
예스스탁입니다,
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틱 등으로 청산될수있도록 설정하되 각각의 틱수또한 임의로 설정하게 셑팅
감사합니다.