커뮤니티

수식 부탁드려요

프로필 이미지
코스모
2016-04-29 21:00:07
138
글번호 97554
답변완료
안녕하세요. 다음 내용의 수식 부탁합니다. 1. 30분봉 차트에서 일봉차트의 스토캐스틱(20,12,12)과 스토캐스틱(5,3,3)을 계산하여, 2. 일봉 차트의 스토캐스틱(20,12,12)에 데드크로스가 발생하는 시점에 30분봉 차트에서 매도 진입. 3. 스토캐스틱(5,3,3 )의 골든크로스 발생하면 매도청산. 즉, 일봉차트를 이용하면 다음날 시가에 체결되므로 다음날 말고 당일 발생 시점에 30분봉 차트에서 진입/청산 하고자 합니다. 감사합니다.
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2016-05-02 17:35:23

안녕하세요 예스스탁입니다. input : Period(20), Period1(12), Period2(12),sto1(5),sto2(3),sto3(3); var : cnt(0); var : shighVal(0), slowVal(0), sFK(0), sSK(0), sSD(0); var : sEp1(0), sEp2(0), sPreSK(0), sPreSD(0); var : highVal(0), lowVal(0), FK(0), SK(0), SD(0); var : Ep1(0), Ep2(0), PreSK(0), PreSD(0); #일봉 스토 5-3-3 shighVal = dayhigh(0); slowVal = daylow(0); for cnt = 0 to sto1-1 { if dayHigh(cnt) > shighVal then shighVal = dayhigh(cnt); if dayLow(cnt) < slowVal then slowVal = dayLow(cnt); } sfK = (C-slowVal)/(shighVal-slowVal)*100; sEp1 = 2/(sto2+1); sEp2 = 2/(sto3+1); if date != date[1] then { sPreSK = sSK[1]; sPreSD = sSD[1]; } sSK = sFK * sEP1 + sPreSK * (1-sEP1); sSD = sSK * sEP2 + sPreSD * (1-sEP2); #일봉 스토 20-12-12 highVal = dayhigh(0); lowVal = daylow(0); for cnt = 0 to Period-1 { if dayHigh(cnt) > highVal then highVal = dayhigh(cnt); if dayLow(cnt) < lowVal then lowVal = dayLow(cnt); } fK = (C-lowVal)/(highVal-lowVal)*100; Ep1 = 2/(Period1+1); Ep2 = 2/(Period2+1); if date != date[1] then { PreSK = SK[1]; PreSD = SD[1]; Condition1 = false; Condition2 = false; } SK = FK * EP1 + PreSK * (1-EP1); SD = SK * EP2 + PreSD * (1-EP2); if Condition1 == false and sk > Sd and preSK < preSD and PreSK > 0 and PreSD > 0 Then{ Condition1 = true; buy(); } if Condition2 == false and sk < Sd and preSK > preSD and PreSK > 0 and PreSD > 0 Then{ Condition2 = true; sell(); } if MarketPosition == 1 and ssk < sSd and spreSK > spreSD and sPreSK > 0 and sPreSD > 0 Then exitlong(); if MarketPosition == -1 and ssk > sSd and spreSK < spreSD and sPreSK > 0 and sPreSD > 0 Then ExitShort(); 즐거운 하루되세요 > 코스모 님이 쓴 글입니다. > 제목 : 수식 부탁드려요 > 안녕하세요. 다음 내용의 수식 부탁합니다. 1. 30분봉 차트에서 일봉차트의 스토캐스틱(20,12,12)과 스토캐스틱(5,3,3)을 계산하여, 2. 일봉 차트의 스토캐스틱(20,12,12)에 데드크로스가 발생하는 시점에 30분봉 차트에서 매도 진입. 3. 스토캐스틱(5,3,3 )의 골든크로스 발생하면 매도청산. 즉, 일봉차트를 이용하면 다음날 시가에 체결되므로 다음날 말고 당일 발생 시점에 30분봉 차트에서 진입/청산 하고자 합니다. 감사합니다.