커뮤니티
타종목 참조식 부탁
2010-11-02 10:30:14
574
글번호 33242
아래식을 타종목 적용식으로 변환 하되
기본종목이 매도(exitlong)신호일때 타종목을 매수(buy)하고
기본종목이 매수신호일때 타종목을 매도하는 조건입니다.
input : P(5), P1(20), P2(20),n(20);
var: 피봇포인트(0), 일차지지(0), 일차저항(0), 이차지지(0), 이차저항(0);
var : 단기이평(0), 장기이평(0), StoK(0), StoD(0);
피봇포인트 = (DayHigh(1)+DayLow(1)+DayClose(1))/3;
일차저항 = (2*피봇포인트) - DayLow(1);
일차지지 = (2*피봇포인트) - DayHigh(1);
이차저항 = 피봇포인트 + (DayHigh(1)-DayLow(1));
이차지지 = 피봇포인트 - (DayHigh(1)-DayLow(1));
단기이평 = ma(C, shortP);
장기이평 = ma(C, longP);
StoK = StochasticsK(p,p1);
StoD = StochasticsD(P,P1,P2);
SetStopProfittarget(n,PercentStop);
###매수식
if c > ma(c,n) and StoK > StoD and StoK > StoK[1] and C > C[1] then buy("매수");
else if crossup(C, 일차저항) and StoK > StoD and C > O then
buy("피봇매수");
###매수청산
if crossdown(단기이평, 장기이평) then exitlong("청산");
###매도식
if StoK < StoD and StoK < StoK[1] and C < O and C < C[1] and IsEntryName("재3",1) == True then
Sell("Sto매도");
else if crossdown(C, 일차지지) and StoK < StoD and C < O then Sell("매도");
###매도청산
if crossup(단기이평, 장기이평) then buy();
if MarketPosition == 0 and IsexitName("피봇매도",1)== true and c <= exitPrice(1)*0.97 then {if c <= o then buy("재3");}
if MarketPosition == 0 and IsexitName("Sto매도",1)== true and c <= exitPrice(1)*0.93 then {if c <= o then buy("재4");}
if MarketPosition == 0 and IsexitName("Sto매도",1)== true and c <= exitPrice(1)*0.90 then {if c <= o then buy("재5");}
답변 1
예스스탁 예스스탁 답변
2010-11-02 14:48:26
안녕하세요
예스스탁입니다.
input : P(5), P1(20), P2(20),n(20),shortP(5),longP(20);
var: 피봇포인트(0,data2), 일차지지(0,data2), 일차저항(0,data2), 이차지지(0,data2), 이차저항(0,data2);
var : 단기이평(0,data2), 장기이평(0,data2), StoK(0,data2), StoD(0,data2);
피봇포인트 = data2((HighD(1)+LowD(1)+CloseD(1))/3);
일차저항 = data2((2*피봇포인트) - LowD(1));
일차지지 = data2((2*피봇포인트) - HighD(1));
이차저항 = data2(피봇포인트 + (HighD(1)-LowD(1)));
이차지지 = data2(피봇포인트 - (HighD(1)-LowD(1)));
단기이평 = data2(ma(C, shortP));
장기이평 = data2(ma(C, longP));
StoK = data2(StochasticsK(p,p1));
StoD = data2(StochasticsD(P,P1,P2));
var1 = data2(C);
#SetStopProfittarget(n,PercentStop);
if MarketPosition == 1 Then{
if CrossDown(data2(L),var1[BarsSinceEntry]*(1-n/100)) Then
exitlong();
}
if MarketPosition == -1 Then{
if CrossUp(data2(H),var1[BarsSinceEntry]*(1+n/100)) Then
ExitShort();
}
###매수식
if data2(c) > data2(ma(c,n)) and StoK > StoD and StoK > StoK[1] and data2(C) > data2(C[1]) then
Sell("매수");
else if crossup(data2(C), 일차저항) and StoK > StoD and data2(C) > data2(O) then
Sell("피봇매수");
###매수청산
if crossdown(단기이평, 장기이평) then
Buy("청산");
###매도식
if StoK < StoD and StoK < StoK[1] and data2(C) < data2(O) and data2(C) < data2(C[1]) and IsEntryName("재3",1) == True then
Sell("Sto매도");
else if crossdown(data2(C), 일차지지) and StoK < StoD and data2(C) < data2(O) then
Sell("매도");
###매도청산
if crossup(단기이평, 장기이평) then ExitLong();
if MarketPosition == 0 and IsexitName("피봇매도",1)== true and data2(C) <= var1[BarsSinceExit(1)]*0.97 then {if data2(c <= o) then Sell("재3");}
if MarketPosition == 0 and IsexitName("Sto매도",1)== true and data2(C) <= var1[BarsSinceExit(1)]*0.93 then {if data2(c <= o) then Sell("재4");}
if MarketPosition == 0 and IsexitName("Sto매도",1)== true and data2(C) <= var1[BarsSinceExit(1)]*0.90 then {if data2(c <= o) then Sell("재5");}
exitlong은 buy로 변경했습니다.
buy매수는 sell매도로 변경했습니다.
시스템함수가 의도와 다르시면 시스템 함수만 변경하시면 됩니다.
즐거운 하루되세요
즐거운 하루되세요
> 대주발 님이 쓴 글입니다.
> 제목 : 타종목 참조식 부탁
> 아래식을 타종목 적용식으로 변환 하되
기본종목이 매도(exitlong)신호일때 타종목을 매수(buy)하고
기본종목이 매수신호일때 타종목을 매도하는 조건입니다.
input : P(5), P1(20), P2(20),n(20);
var: 피봇포인트(0), 일차지지(0), 일차저항(0), 이차지지(0), 이차저항(0);
var : 단기이평(0), 장기이평(0), StoK(0), StoD(0);
피봇포인트 = (DayHigh(1)+DayLow(1)+DayClose(1))/3;
일차저항 = (2*피봇포인트) - DayLow(1);
일차지지 = (2*피봇포인트) - DayHigh(1);
이차저항 = 피봇포인트 + (DayHigh(1)-DayLow(1));
이차지지 = 피봇포인트 - (DayHigh(1)-DayLow(1));
단기이평 = ma(C, shortP);
장기이평 = ma(C, longP);
StoK = StochasticsK(p,p1);
StoD = StochasticsD(P,P1,P2);
SetStopProfittarget(n,PercentStop);
###매수식
if c > ma(c,n) and StoK > StoD and StoK > StoK[1] and C > C[1] then buy("매수");
else if crossup(C, 일차저항) and StoK > StoD and C > O then
buy("피봇매수");
###매수청산
if crossdown(단기이평, 장기이평) then exitlong("청산");
###매도식
if StoK < StoD and StoK < StoK[1] and C < O and C < C[1] and IsEntryName("재3",1) == True then
Sell("Sto매도");
else if crossdown(C, 일차지지) and StoK < StoD and C < O then Sell("매도");
###매도청산
if crossup(단기이평, 장기이평) then buy();
if MarketPosition == 0 and IsexitName("피봇매도",1)== true and c <= exitPrice(1)*0.97 then {if c <= o then buy("재3");}
if MarketPosition == 0 and IsexitName("Sto매도",1)== true and c <= exitPrice(1)*0.93 then {if c <= o then buy("재4");}
if MarketPosition == 0 and IsexitName("Sto매도",1)== true and c <= exitPrice(1)*0.90 then {if c <= o then buy("재5");}
이전글