커뮤니티
수식부탁드립니다.
2014-10-14 23:43:08
190
글번호 79409
하루 세번 진입
오전 10시에서 오후 2시 사이에만 진입
macd 다이버전스 신호시 매수/ 매도
또는
stochastics 다이버전스 신호시 매수/ 매도
청산은
30틱이상 50% 이익손실이면 청산
손절 15틱
이상입니다.
답변 2
예스스탁 예스스탁 답변
2014-10-15 13:09:10
안녕하세요
예스스탁입니다.
input : p1(12),p2(26),p3(9),sto1(10),sto2(5),sto3(5);
var : MACDV(0),MACDS(0),stok(0),stod(0),Ecnt(0),HH(0),LL(0);
var : V1(0),V2(0),V11(0),V22(0),V3(0),V4(0),V33(0),V44(0);
var : V5(0),V6(0),V55(0),V66(0),V7(0),V8(0),V77(0),V88(0);
if date != date[1] Then
Ecnt = 0;
if MarketPosition != 0 and MarketPosition != MarketPosition[1] Then
Ecnt = Ecnt+1;
MACDV = MACD(p1,p2);
MACDS = ema(MACDV,P3);
stok = StochasticsK(sto1,sto2);
stod = StochasticsD(sto1,sto2,sto3);
if crossup(MACDV,MACDS) Then{
V1 = MACDV;
V11 = V1[1];
V2 = C;
V22 = V2[1];
if V1 > V11 and V2 < V22 and stime >= 100000 and stime < 140000 and Ecnt < 3 Then
buy("b1");
}
if CrossDown(MACDV,MACDS) Then{
V3 = MACDV;
V33 = V3[1];
V4 = C;
V44 = V4[1];
if V3 < V33 and V4 > V44 and stime >= 100000 and stime < 140000 and Ecnt < 3 Then
sell("s1");
}
if crossup(stok,stod) Then{
V5 = stok;
V55 = V5[1];
V6 = C;
V66 = V6[1];
if V5 > V55 and V6 < V66 and stime >= 100000 and stime < 140000 and Ecnt < 3 Then
buy("b2");
}
if CrossDown(stok,stod) Then{
V7 = stok;
V77 = V7[1];
V8 = C;
V88 = V8[1];
if V7 < V77 and V8 > V88 and stime >= 100000 and stime < 140000 and Ecnt < 3 Then
sell("s2");
}
if MarketPosition == 1 Then{
HH = highest(H,BarsSinceEntry);
if HH >= EntryPrice+PriceScale*30 Then
ExitLong("bx",AtStop,HH-(HH-EntryPrice)*0.5);
}
if MarketPosition == -1 Then{
LL = Lowest(L,BarsSinceEntry);
if LL <= EntryPrice-PriceScale*30 Then
ExitShort("sx",AtStop,LL+(EntryPrice-LL)*0.5);
}
SetStopLoss(PriceScale*15,PointStop);
즐거운 하루되세요
> 바람의투자자 님이 쓴 글입니다.
> 제목 : 수식부탁드립니다.
>
하루 세번 진입
오전 10시에서 오후 2시 사이에만 진입
macd 다이버전스 신호시 매수/ 매도
또는
stochastics 다이버전스 신호시 매수/ 매도
청산은
30틱이상 50% 이익손실이면 청산
손절 15틱
이상입니다.
바람의투자자
2014-10-15 23:07:16
수식 감사합니다.
근데.. 잘 맞지 않는거같아요
주석좀 달아주시겠습니다.
제가 변수값조정을 해서 사용하겠습니다.
> 예스스탁 님이 쓴 글입니다.
> 제목 : Re : 수식부탁드립니다.
>
안녕하세요
예스스탁입니다.
input : p1(12),p2(26),p3(9),sto1(10),sto2(5),sto3(5);
var : MACDV(0),MACDS(0),stok(0),stod(0),Ecnt(0),HH(0),LL(0);
var : V1(0),V2(0),V11(0),V22(0),V3(0),V4(0),V33(0),V44(0);
var : V5(0),V6(0),V55(0),V66(0),V7(0),V8(0),V77(0),V88(0);
if date != date[1] Then
Ecnt = 0;
if MarketPosition != 0 and MarketPosition != MarketPosition[1] Then
Ecnt = Ecnt+1;
MACDV = MACD(p1,p2);
MACDS = ema(MACDV,P3);
stok = StochasticsK(sto1,sto2);
stod = StochasticsD(sto1,sto2,sto3);
if crossup(MACDV,MACDS) Then{
V1 = MACDV;
V11 = V1[1];
V2 = C;
V22 = V2[1];
if V1 > V11 and V2 < V22 and stime >= 100000 and stime < 140000 and Ecnt < 3 Then
buy("b1");
}
if CrossDown(MACDV,MACDS) Then{
V3 = MACDV;
V33 = V3[1];
V4 = C;
V44 = V4[1];
if V3 < V33 and V4 > V44 and stime >= 100000 and stime < 140000 and Ecnt < 3 Then
sell("s1");
}
if crossup(stok,stod) Then{
V5 = stok;
V55 = V5[1];
V6 = C;
V66 = V6[1];
if V5 > V55 and V6 < V66 and stime >= 100000 and stime < 140000 and Ecnt < 3 Then
buy("b2");
}
if CrossDown(stok,stod) Then{
V7 = stok;
V77 = V7[1];
V8 = C;
V88 = V8[1];
if V7 < V77 and V8 > V88 and stime >= 100000 and stime < 140000 and Ecnt < 3 Then
sell("s2");
}
if MarketPosition == 1 Then{
HH = highest(H,BarsSinceEntry);
if HH >= EntryPrice+PriceScale*30 Then
ExitLong("bx",AtStop,HH-(HH-EntryPrice)*0.5);
}
if MarketPosition == -1 Then{
LL = Lowest(L,BarsSinceEntry);
if LL <= EntryPrice-PriceScale*30 Then
ExitShort("sx",AtStop,LL+(EntryPrice-LL)*0.5);
}
SetStopLoss(PriceScale*15,PointStop);
즐거운 하루되세요
> 바람의투자자 님이 쓴 글입니다.
> 제목 : 수식부탁드립니다.
>
하루 세번 진입
오전 10시에서 오후 2시 사이에만 진입
macd 다이버전스 신호시 매수/ 매도
또는
stochastics 다이버전스 신호시 매수/ 매도
청산은
30틱이상 50% 이익손실이면 청산
손절 15틱
이상입니다.
이전글