커뮤니티
수식 질문입니다.
2013-06-16 17:11:18
311
글번호 64361
차트 : 1분봉 차트
버전 : 3.0 (다른 데이터 참조가 안됩니다.)
로직
[매수]
1분봉 종가 해당일 시가(openD)보다 크면 10계약 매수
0.3pt 이익시 2계약 청산
0.9pt 이익시 5계약 청산
2.0pt 이익시 3계약 청산
위 지점에 도달하지 못하고 시가(opendD)보다 내려오면 잔여 계약 모두 청산
[매도] : 동일합니다.
1분봉 종가 해당일 시가(openD)보다 작으면 10계약 매도
0.3pt 이익시 2계약 청산
0.9pt 이익시 5계약 청산
2.0pt 이익시 3계약 청산
위 지점에 도달하지 못하고 시가(opendD)보다 커지면 잔여 계약 모두 청산
아래 식 검토 부탁드립니다 ^^
잘 안돌아 가네요..
======================
Inputs: p1(0.3),p2(0.9),p3(2);
Variables: oo(0);
if oo <> opend(0) then {
oo = Opend(0);
}
MessageLog("오픈 %.3f",oo);
if MarketPosition == 0 then {
if c > oo then {
buy("L1", AtMarket, DEF, 2);
buy("L2", AtMarket, DEF, 5);
buy("L3", AtMarket, DEF, 3);
}
else if c < oo then {
sell("S1",AtMarket, DEF, 2);
sell("S2",AtMarket, DEF, 5);
sell("S3",AtMarket, DEF, 3);
}
}
if MarketPosition == 1 then {
if c < oo then {
exitlong("매수청산",AtMarket);
}
if c > oo+0.3 then {
exitlong("매수청산_1차",OnClose,DEF,"L1",2,1);
}
if c > oo+0.9 then {
exitlong("매수청산_2차",OnClose,DEF,"L2",5,1);
}
if c > oo+2.0 then {
exitlong("매수청산_3차",OnClose,DEF,"L3",3,1);
}
}
if MarketPosition == -1 then {
if c > oo then {
ExitShort("매도청산",AtMarket);
}
if c < oo-0.3 then {
ExitShort("매도청산_1차",OnClose,DEF,"S1",2,1);
}
if c < oo-0.9 then {
ExitShort("매도청산_2차",OnClose,DEF,"S2",5,1);
}
if c < oo-2.0 then {
ExitShort("매도청산_3차",OnClose,DEF,"S3",3,1);
}
}
답변 1
예스스탁 예스스탁 답변
2013-06-17 15:15:00
안녕하세요
예스스탁입니다.
if c > OpenD(0) Then
buy("b",OnClose,def,10);
if MarketPosition == 1 Then{
ExitLong("bx1",atlimit,EntryPrice+0.3,"",2,1);
ExitLong("bx2",atlimit,EntryPrice+0.9,"",5,1);
ExitLong("bx3",atlimit,EntryPrice+2.0,"",3,1);
}
if C < OpenD(0) Then
sell("s",OnClose,def,10);
if MarketPosition == -1 Then{
ExitShort("sx1",atlimit,EntryPrice-0.3,"",2,1);
ExitShort("sx2",atlimit,EntryPrice-0.9,"",5,1);
ExitShort("sx3",atlimit,EntryPrice-2.0,"",3,1);
}
즐거운 하루되세요
> 데몬 님이 쓴 글입니다.
> 제목 : 수식 질문입니다.
> 차트 : 1분봉 차트
버전 : 3.0 (다른 데이터 참조가 안됩니다.)
로직
[매수]
1분봉 종가 해당일 시가(openD)보다 크면 10계약 매수
0.3pt 이익시 2계약 청산
0.9pt 이익시 5계약 청산
2.0pt 이익시 3계약 청산
위 지점에 도달하지 못하고 시가(opendD)보다 내려오면 잔여 계약 모두 청산
[매도] : 동일합니다.
1분봉 종가 해당일 시가(openD)보다 작으면 10계약 매도
0.3pt 이익시 2계약 청산
0.9pt 이익시 5계약 청산
2.0pt 이익시 3계약 청산
위 지점에 도달하지 못하고 시가(opendD)보다 커지면 잔여 계약 모두 청산
아래 식 검토 부탁드립니다 ^^
잘 안돌아 가네요..
======================
Inputs: p1(0.3),p2(0.9),p3(2);
Variables: oo(0);
if oo <> opend(0) then {
oo = Opend(0);
}
MessageLog("오픈 %.3f",oo);
if MarketPosition == 0 then {
if c > oo then {
buy("L1", AtMarket, DEF, 2);
buy("L2", AtMarket, DEF, 5);
buy("L3", AtMarket, DEF, 3);
}
else if c < oo then {
sell("S1",AtMarket, DEF, 2);
sell("S2",AtMarket, DEF, 5);
sell("S3",AtMarket, DEF, 3);
}
}
if MarketPosition == 1 then {
if c < oo then {
exitlong("매수청산",AtMarket);
}
if c > oo+0.3 then {
exitlong("매수청산_1차",OnClose,DEF,"L1",2,1);
}
if c > oo+0.9 then {
exitlong("매수청산_2차",OnClose,DEF,"L2",5,1);
}
if c > oo+2.0 then {
exitlong("매수청산_3차",OnClose,DEF,"L3",3,1);
}
}
if MarketPosition == -1 then {
if c > oo then {
ExitShort("매도청산",AtMarket);
}
if c < oo-0.3 then {
ExitShort("매도청산_1차",OnClose,DEF,"S1",2,1);
}
if c < oo-0.9 then {
ExitShort("매도청산_2차",OnClose,DEF,"S2",5,1);
}
if c < oo-2.0 then {
ExitShort("매도청산_3차",OnClose,DEF,"S3",3,1);
}
}
다음글
이전글