커뮤니티
교육잘받았습니다. 수식부탁합니다.
2011-06-13 18:07:51
643
글번호 39655
하이투자증교육잘받았고 감사드립니다. 지난번 답해주신 수식 고맙습니다. 수식적용해보니 에러가 많이 발생해 현재 에러수정해 보려 애쓰고 있습니다. 다음은 지난번 수식보다는 좀 간단한 전략입니다. 별첨전략에 대한 수식부탁드리고 에러작업까지 해 주시면 고맙겠네요. 그리고 별첨전략은 다운받으시고 바로 삭제해 주십시요. 꾸벅 꾸벅....
답변 2
예스스탁 예스스탁 답변
2011-06-13 14:20:01
안녕하세요
예스스탁입니다.
# SS(=SLOW STOCHASTICS, 12/6) 와 MACD(12/26/9)
var : pip(0,data1),D2MACDV(0,data2),D2MACDS(0,data2),D2StoK(0,data2),D2StoD(0,data2);
var : position(0,data1),D1MACDV(0,data1),D1MACDS(0,data1),D1StoK(0,data1),D1StoD(0,data1),sto(0,data1),sto1(0,data1);
D1MACDV = data1(MACD(12,26));
D1MACDS = data1(ema(D1MACDV,9));
D2MACDV = data2(MACD(12,26));
D2MACDS = data2(ema(D2MACDV,9));
D1StoK = data1(StochasticsK(12,6));
D1StoD = data1(StochasticsD(12,6,6));
D2StoK = data2(StochasticsK(12,6));
D2StoD = data2(StochasticsD(12,6,6));
Pip = PriceScale*10;
if D2MACDV > D2MACDV[1]+0.00005 Then
position = 1;
if D2MACDV < D2MACDV[1]-0.00005 Then
position = -1;
if abs(D2MACDV-D2MACDV[1]) <= 0.00005 Then{
if Position[1] == 1 Then
position = -1;
if Position[1] == -1 Then
position = 1;
}
if date != date[1] Then{
Sto = 0;
Sto1 = 0;
}
if Sto <= 0 and crossup(D1StoK,D1StoD+4.0) and D1StoK < 30 Then
Sto = 1;
if Sto >= 0 and crossdown(D1StoK,D1StoD-4.0) Then
Sto = -1;
if MarketPosition == 0 and position == 1 and sto == 1 and crossup(D1MACDV,D1MACDS+0.001) Then
buy("SSGCMGC매수",AtMarket,def,5);
if MarketPosition == 1 and IsEntryName("SSGCMGC매수") then{
exitlong("bx1",Atlimit,EntryPrice+Pip*80);
if CrossDown(D1MACDV,D1MACDS) Then
ExitLong("bx2",AtMarket);
}
if MarketPosition == 0 and position == 1 and (crossup(D1MACDV,D1MACDS) or D1MACDV > D1MACDS) Then
buy("M기돌매수",AtMarket,def,5);
if MarketPosition == 1 and IsEntryName("M기돌매수") then{
exitlong("bx3",Atlimit,EntryPrice+Pip*100);
if CrossDown(D1MACDV,0) and countif(CrossUp(D1MACDV,0.003),BarsSinceEntry) < 1 Then
ExitLong("bx4",AtMarket);
if CrossDown(D1MACDV,-0.005) and countif(CrossUp(D1MACDV,0.003),BarsSinceEntry) >= 1 and D1MACDV< D2MACDS Then
ExitLong("bx5",AtMarket);
}
if CrossDown(D1StoK,D1StoD-4.0) and D1StoK > 70 Then
Sto1 = 1;
if CrossUp(D1StoK,D1StoD+4.0) Then
Sto1 = -1;
if MarketPosition == 0 and position == -1 and sto1 == 1 and CrossDown(D1MACDV,D1MACDS) Then
sell("SSDCMDC매도",AtMarket,def,5);
if MarketPosition == 1 and IsEntryName("SSDCMDC매도") then{
ExitShort("sx1",Atlimit,EntryPrice-Pip*80);
if CrossUp(D1MACDV,D1MACDS) Then
ExitLong("sx2",AtMarket);
}
if MarketPosition == 0 and position == -1 and (CrossDown(D1MACDV,D1MACDS) or D1MACDV < D1MACDS) Then
Sell("M기돌매도",AtMarket,def,5);
if MarketPosition == -1 and IsEntryName("M기돌매도") then{
ExitShort("sx3",Atlimit,EntryPrice-Pip*100);
if CrossUp(D1MACDV,0) and countif(CrossDown(D1MACDV,-0.003),BarsSinceEntry) < 1 Then
ExitShort("sx4",AtMarket);
if CrossUp(D1MACDV,-0.003) and countif(CrossDown(D1MACDV,-0.003),BarsSinceEntry) >= 1 and D1MACDV > D2MACDS Then
ExitShort("sx5",AtMarket);
}
if 조건은 모두 봉완성시가 기본체계입니다.
이용에 참고하시기 바랍니다.
즐거운 하루되세요
> 백세 님이 쓴 글입니다.
> 제목 : 교육잘받았습니다. 수식부탁합니다.
> 하이투자증교육잘받았고 감사드립니다. 지난번 답해주신 수식 고맙습니다. 수식적용해보니 에러가 많이 발생해 현재 에러수정해 보려 애쓰고 있습니다. 다음은 지난번 수식보다는 좀 간단한 전략입니다. 별첨전략에 대한 수식부탁드리고 에러작업까지 해 주시면 고맙겠네요. 그리고 별첨전략은 다운받으시고 바로 삭제해 주십시요. 꾸벅 꾸벅....
백세
2011-06-17 11:20:33
오류가 많이 발생하는데 어떻게 해야하는지 답답하군요. 거래는 빨리 시작해야하는데....
> 예스스탁 님이 쓴 글입니다.
> 제목 : Re : 교육잘받았습니다. 수식부탁합니다.
> 안녕하세요
예스스탁입니다.
# SS(=SLOW STOCHASTICS, 12/6) 와 MACD(12/26/9)
var : pip(0,data1),D2MACDV(0,data2),D2MACDS(0,data2),D2StoK(0,data2),D2StoD(0,data2);
var : position(0,data1),D1MACDV(0,data1),D1MACDS(0,data1),D1StoK(0,data1),D1StoD(0,data1),sto(0,data1),sto1(0,data1);
D1MACDV = data1(MACD(12,26));
D1MACDS = data1(ema(D1MACDV,9));
D2MACDV = data2(MACD(12,26));
D2MACDS = data2(ema(D2MACDV,9));
D1StoK = data1(StochasticsK(12,6));
D1StoD = data1(StochasticsD(12,6,6));
D2StoK = data2(StochasticsK(12,6));
D2StoD = data2(StochasticsD(12,6,6));
Pip = PriceScale*10;
if D2MACDV > D2MACDV[1]+0.00005 Then
position = 1;
if D2MACDV < D2MACDV[1]-0.00005 Then
position = -1;
if abs(D2MACDV-D2MACDV[1]) <= 0.00005 Then{
if Position[1] == 1 Then
position = -1;
if Position[1] == -1 Then
position = 1;
}
if date != date[1] Then{
Sto = 0;
Sto1 = 0;
}
if Sto <= 0 and crossup(D1StoK,D1StoD+4.0) and D1StoK < 30 Then
Sto = 1;
if Sto >= 0 and crossdown(D1StoK,D1StoD-4.0) Then
Sto = -1;
if MarketPosition == 0 and position == 1 and sto == 1 and crossup(D1MACDV,D1MACDS+0.001) Then
buy("SSGCMGC매수",AtMarket,def,5);
if MarketPosition == 1 and IsEntryName("SSGCMGC매수") then{
exitlong("bx1",Atlimit,EntryPrice+Pip*80);
if CrossDown(D1MACDV,D1MACDS) Then
ExitLong("bx2",AtMarket);
}
if MarketPosition == 0 and position == 1 and (crossup(D1MACDV,D1MACDS) or D1MACDV > D1MACDS) Then
buy("M기돌매수",AtMarket,def,5);
if MarketPosition == 1 and IsEntryName("M기돌매수") then{
exitlong("bx3",Atlimit,EntryPrice+Pip*100);
if CrossDown(D1MACDV,0) and countif(CrossUp(D1MACDV,0.003),BarsSinceEntry) < 1 Then
ExitLong("bx4",AtMarket);
if CrossDown(D1MACDV,-0.005) and countif(CrossUp(D1MACDV,0.003),BarsSinceEntry) >= 1 and D1MACDV< D2MACDS Then
ExitLong("bx5",AtMarket);
}
if CrossDown(D1StoK,D1StoD-4.0) and D1StoK > 70 Then
Sto1 = 1;
if CrossUp(D1StoK,D1StoD+4.0) Then
Sto1 = -1;
if MarketPosition == 0 and position == -1 and sto1 == 1 and CrossDown(D1MACDV,D1MACDS) Then
sell("SSDCMDC매도",AtMarket,def,5);
if MarketPosition == 1 and IsEntryName("SSDCMDC매도") then{
ExitShort("sx1",Atlimit,EntryPrice-Pip*80);
if CrossUp(D1MACDV,D1MACDS) Then
ExitLong("sx2",AtMarket);
}
if MarketPosition == 0 and position == -1 and (CrossDown(D1MACDV,D1MACDS) or D1MACDV < D1MACDS) Then
Sell("M기돌매도",AtMarket,def,5);
if MarketPosition == -1 and IsEntryName("M기돌매도") then{
ExitShort("sx3",Atlimit,EntryPrice-Pip*100);
if CrossUp(D1MACDV,0) and countif(CrossDown(D1MACDV,-0.003),BarsSinceEntry) < 1 Then
ExitShort("sx4",AtMarket);
if CrossUp(D1MACDV,-0.003) and countif(CrossDown(D1MACDV,-0.003),BarsSinceEntry) >= 1 and D1MACDV > D2MACDS Then
ExitShort("sx5",AtMarket);
}
if 조건은 모두 봉완성시가 기본체계입니다.
이용에 참고하시기 바랍니다.
즐거운 하루되세요
> 백세 님이 쓴 글입니다.
> 제목 : 교육잘받았습니다. 수식부탁합니다.
> 하이투자증교육잘받았고 감사드립니다. 지난번 답해주신 수식 고맙습니다. 수식적용해보니 에러가 많이 발생해 현재 에러수정해 보려 애쓰고 있습니다. 다음은 지난번 수식보다는 좀 간단한 전략입니다. 별첨전략에 대한 수식부탁드리고 에러작업까지 해 주시면 고맙겠네요. 그리고 별첨전략은 다운받으시고 바로 삭제해 주십시요. 꾸벅 꾸벅....
다음글
이전글