커뮤니티
시스템식
2013-07-18 14:20:10
165
글번호 65480
아래의 식에서 StochasticsK는 2분봉, RSI는 1분봉의 매수매도 시그날이 나오게끔 변환해 주세요.
Input : stoPeriod(12), stoPeriod1(5);
Input : RsiPeriod(14), LPercent(30), SPercent(70);
value1 = StochasticsK(stoPeriod,stoPeriod1);
value2 = RSI(RsiPeriod);
If CrossUP(value1, 20) Then
{
Buy("b1");
}
If IsEntryName("b1") == true and CrossDown(value1, 80) Then
{
Sell();
}
If CrossUP(value2, LPercent) Then
{
Buy("b2");
}
If IsEntryName("b2") == true and CrossDown(value2, SPercent) Then
{
Sell();
}
답변 1
예스스탁 예스스탁 답변
2013-07-18 21:15:27
안녕하세요
예스스탁입니다.
1분봉 차트에 적용하셔야 합니다.
차트의 최대 봉조회건수가 5000건이고
스토케스틱 같은 경우에 지수이평이 기본 이평방법이므로
타분봉 지표의 경우 실제 2분봉과 다를수 있습니다.
이용에 참고하시기 바랍니다.
input : Atime(2),StoPeriod(10), StoPeriod1(6), StoPeriod2(6);
Input : RsiPeriod(14), LPercent(30), SPercent(70);
var : count(0), highVal(0), lowVal(0), StoFastK(0), StoK(0), StoD(0);
var : Ep(0), EP1(0), JISU(0), DINDEX(0), PreStoK(0), PreStoD(0),cnt(0);
Array : HH[50](0),LL[50](0);
var1 = TimeToMinutes(stime)%Atime;
if dayindex == 0 or (var1 < var1[1] and stime > stime[1]) Then{
HH[0] = H;
LL[0] = L;
for cnt = 1 to 49{
HH[cnt] = HH[cnt-1][1];
LL[cnt] = LL[cnt-1][1];
}
}
if H > HH[0] Then
HH[0] = H;
if L < LL[0] Then
LL[0] = L;
highVal = HH[0];
lowVal = LL[0];
for count = 0 to StoPeriod-1 {
if HH[count] > highVal then
highVal = HH[count];
if LL[count] < lowVal then
lowVal = LL[count];
}
StoFastK = (C-lowVal)/(highVal-lowVal)*100;
#### Slow StochasticsK ####
Ep = 2/(StoPeriod1+1);
if DINDEX >= StoPeriod and (date != date[1] or var1 < var1[1]) then {
DINDEX = DINDEX + 1;
PreStoK = StoK[1];
}
if DINDEX <= 1 then
StoK = StoFastK ;
else
StoK = StoFastK * EP + PreStoK * (1-EP);
#### Slow StochasticsD ####
Ep1 = 2/(StoPeriod2+1);
if date != date[1] or var1 < var1[1] then {
DINDEX = DINDEX + 1;
PreStoD = StoD[1];
}
if DINDEX <= 1 then
StoD = StoK ;
else
StoD = StoK * EP1 + PreStoD * (1-EP1);
value2 = RSI(RsiPeriod);
If stok > 20 and PreStoK < 20 Then
Buy("b1");
If IsEntryName("b1") == true and stok < 80 and PreStoK > 80 Then
Sell();
If CrossUP(value2, LPercent) Then
Buy("b2");
If IsEntryName("b2") == true and CrossDown(value2, SPercent) Then
Sell();
즐거운 하루되세요
> erwe343 님이 쓴 글입니다.
> 제목 : 시스템식
> 아래의 식에서 StochasticsK는 2분봉, RSI는 1분봉의 매수매도 시그날이 나오게끔 변환해 주세요.
Input : stoPeriod(12), stoPeriod1(5);
Input : RsiPeriod(14), LPercent(30), SPercent(70);
value1 = StochasticsK(stoPeriod,stoPeriod1);
value2 = RSI(RsiPeriod);
If CrossUP(value1, 20) Then
{
Buy("b1");
}
If IsEntryName("b1") == true and CrossDown(value1, 80) Then
{
Sell();
}
If CrossUP(value2, LPercent) Then
{
Buy("b2");
}
If IsEntryName("b2") == true and CrossDown(value2, SPercent) Then
{
Sell();
}