커뮤니티
수식 부탁드립니다.
2016-01-07 08:52:21
136
글번호 94156
1. 해외선물 크루드오일 5분봉. 시장시간
거래시간은 07시30분~10시까지 ( 10시이후까지 익절혹은청산이 안되면 자동청산)
07시30분 종가를 기점으로, 호가가 가중이동평균3선을 돌파하면 매수,매도 하는전략을 구현하고싶습니다.
익절과 손절라인은 피봇포인트와 1,2차 지지 저항선 에 터치하면 손절혹은 익절
답변 1
예스스탁 예스스탁 답변
2016-01-07 09:38:35
안녕하세요
예스스탁입니다.
var : Tcond(false),mav(0);
Var : Pivot(0),R1(0),R2(0),S1(0),S2(0);
Pivot = (DayHigh(1)+DayLow(1)+DayClose(1))/3;
R1 = 2*Pivot-DayLow(1);
R2 = Pivot+DayHigh(1)-DayLow(1);
S1 = 2*Pivot-DayHigh(1);
S2 = Pivot-DayHigh(1)+DayLow(1);
mav = wma(c,3);
if stime == 073000 or (stime > 073000 and stime[1] < 073000) Then
Tcond = true;
if stime == 100000 or (stime > 100000 and stime[1] < 100000) Then{
Tcond = false;
ExitLong();
ExitShort();
}
if Tcond == true Then{
if crossup(C,mav) Then
buy();
if CrossDown(c,mav) Then
sell();
}
if MarketPosition == 1 Then{
if NextBarOpen <= Pivot Then
exitlong("bx1",Atlimit,pivot);
Else
exitlong("bx2",AtStop,pivot);
if NextBarOpen <= R1 Then
ExitLong("bP1",atlimit,R1);
if NextBarOpen <= R2 Then
ExitLong("bP2",atlimit,R2);
if NextBarOpen >= S1 Then
ExitLong("bL1",AtStop,S1);
if NextBarOpen >= S2 Then
ExitLong("bL2",AtStop,S2);
}
if MarketPosition == -1 Then{
if NextBarOpen >= Pivot Then
ExitShort("sx1",Atlimit,pivot);
Else
ExitShort("sx2",AtStop,pivot);
if NextBarOpen >= S1 Then
ExitLong("sP1",atlimit,S1);
if NextBarOpen >= S2 Then
ExitLong("sP2",atlimit,S2);
if NextBarOpen <= R1 Then
ExitLong("sL1",AtStop,R1);
if NextBarOpen <= R2 Then
ExitLong("sL2",AtStop,S2);
}
SetStopEndofday(100000);
즐거운 하루되세요
> 아키 님이 쓴 글입니다.
> 제목 : 수식 부탁드립니다.
> 1. 해외선물 크루드오일 5분봉. 시장시간
거래시간은 07시30분~10시까지 ( 10시이후까지 익절혹은청산이 안되면 자동청산)
07시30분 종가를 기점으로, 호가가 가중이동평균3선을 돌파하면 매수,매도 하는전략을 구현하고싶습니다.
익절과 손절라인은 피봇포인트와 1,2차 지지 저항선 에 터치하면 손절혹은 익절
다음글