커뮤니티
문의드립니다.
2018-12-03 14:05:33
183
글번호 124089
문의드립니다.
t=1 --> t=2까지 간 후 (Crossdown(FstD, 80) 된 후)
t=1이 만족되는 구간에서 (mav1>mav2 & mav3 상향구간 인 상태)
바로 다음의 FastK에 대해서 다시 상승때 매수를 하고 싶습니다.
Crossdown(FstD, 80) 된 후(t=2) FastK가 몇번의 굴곡이 있은 후에 FastK가 다시 상승하면 매수되는 현상이 있습니다. 수정 부탁드립니다.
매도도 동일합니다.
감사합니다.
Input : Period(5), Period1(5);
Input : P1(30), P2(60), P3(300);
var : FstK(0),FstD(0);
var : mav1(0), mav2(0), mav3(0);
var : t(0), t1(0), tx(0), U2(0);
var : BH(0),SL(0),HE(0),LE(0);
FstK = FastK(Period);
FstD = FastD(Period,Period1);
mav1 = wma(C, P1);
mav2 = wma(C, P2);
mav3 = wma(c, P3);
if FstK[1] < FstK Then #FstK 상승
U2 = 1;
if FstK[1] > FstK Then #FstK 하강
U2 = -1;
if mav1 > mav2 and mav3[1] < mav3 then {
t = 1; #t는1 mav1>mav2 & mav3 상향구간 t값은 t1에 저장
t1 = t[1];
}
# t가 1인 상태에서 Fstk가 80을 CrossDown 하면 t = 2로 변경 ● 출력
if t == 1 and Crossdown(FstD, 80) Then {
t = 2; #t는 2로 변경
#●출력
tx = Text_New(sdate,stime,H+PriceScale,"●"+NumToStr(C,2));
Text_SetStyle(tx,2,2);
Text_SetColor(tx,RED);
}
# mav1>mav2 & mav3 상향구간
# Crossdown(Fastk, 80) t는 2까지 기록했고
# mav1>mav2 & mav3 상향구간 인 상태이고 FastK가 다시 상승하면 매수
if t > 0 and t1 >= 2
and U2 == 1 and U2!=U2[1] Then {
buy("B3");
}
if MarketPosition == 1 Then{
BH = highest(H,BarsSinceEntry);
if MaxEntries == 1 Then
HE = LatestEntryPrice(0);
if MaxEntries >= 2 and LatestEntryPrice(0) > HE Then
HE = LatestEntryPrice(0);
SetStopProfittarget(0.4);
ExitLong("B손절",AtStop,HE-PriceScale*80);
}
답변 1
예스스탁 예스스탁 답변
2018-12-04 10:03:47
안녕하세요
예스스탁입니다.
T가 2가 된후 변수하나를 추가해 첫번째 fastk상승전환시만 매수하게 하시면 됩니다.
첨부된 수식에서 BuyEntry변수 참고하시기 바랍니다.
수식에 매도 내용이 없습니다. 해당 내용 참고하셔서 추가하시면 됩니다.
Input : Period(5), Period1(5);
Input : P1(30), P2(60), P3(300);
var : FstK(0),FstD(0);
var : mav1(0), mav2(0), mav3(0);
var : t(0), t1(0), tx(0), U2(0);
var : BH(0),SL(0),HE(0),LE(0);
var : BuyEntry(false);
FstK = FastK(Period);
FstD = FastD(Period,Period1);
mav1 = wma(C, P1);
mav2 = wma(C, P2);
mav3 = wma(c, P3);
if FstK[1] < FstK Then #FstK 상승
U2 = 1;
if FstK[1] > FstK Then #FstK 하강
U2 = -1;
if mav1 > mav2 and mav3[1] < mav3 then
{
t = 1; #t는1 mav1>mav2 & mav3 상향구간 t값은 t1에 저장
t1 = t[1];
}
# t가 1인 상태에서 Fstk가 80을 CrossDown 하면 t = 2로 변경 ● 출력
if t == 1 and Crossdown(FstD, 80) Then
{
t = 2; #t는 2로 변경
#●출력
tx = Text_New(sdate,stime,H+PriceScale,"●"+NumToStr(C,2));
Text_SetStyle(tx,2,2);
Text_SetColor(tx,RED);
BuyEntry = true; //매수가능
}
# mav1>mav2 & mav3 상향구간
# Crossdown(Fastk, 80) t는 2까지 기록했고
# mav1>mav2 & mav3 상향구간 인 상태이고 FastK가 다시 상승하면 매수
if t > 0 and t1 >= 2
and U2 == 1 and U2!=U2[1] and
BuyEntry == true Then 매수가능일때만 매수
{
BuyEntry = false;# false로 초기화
buy("B3");
}
if MarketPosition == 1 Then
{
BH = highest(H,BarsSinceEntry);
if MaxEntries == 1 Then
HE = LatestEntryPrice(0);
if MaxEntries >= 2 and LatestEntryPrice(0) > HE Then
HE = LatestEntryPrice(0);
SetStopProfittarget(0.4);
ExitLong("B손절",AtStop,HE-PriceScale*80);
}
즐거운 하루되세요
> 라떼처럼 님이 쓴 글입니다.
> 제목 : 문의드립니다.
> 문의드립니다.
t=1 --> t=2까지 간 후 (Crossdown(FstD, 80) 된 후)
t=1이 만족되는 구간에서 (mav1>mav2 & mav3 상향구간 인 상태)
바로 다음의 FastK에 대해서 다시 상승때 매수를 하고 싶습니다.
Crossdown(FstD, 80) 된 후(t=2) FastK가 몇번의 굴곡이 있은 후에 FastK가 다시 상승하면 매수되는 현상이 있습니다. 수정 부탁드립니다.
매도도 동일합니다.
감사합니다.
Input : Period(5), Period1(5);
Input : P1(30), P2(60), P3(300);
var : FstK(0),FstD(0);
var : mav1(0), mav2(0), mav3(0);
var : t(0), t1(0), tx(0), U2(0);
var : BH(0),SL(0),HE(0),LE(0);
FstK = FastK(Period);
FstD = FastD(Period,Period1);
mav1 = wma(C, P1);
mav2 = wma(C, P2);
mav3 = wma(c, P3);
if FstK[1] < FstK Then #FstK 상승
U2 = 1;
if FstK[1] > FstK Then #FstK 하강
U2 = -1;
if mav1 > mav2 and mav3[1] < mav3 then {
t = 1; #t는1 mav1>mav2 & mav3 상향구간 t값은 t1에 저장
t1 = t[1];
}
# t가 1인 상태에서 Fstk가 80을 CrossDown 하면 t = 2로 변경 ● 출력
if t == 1 and Crossdown(FstD, 80) Then {
t = 2; #t는 2로 변경
#●출력
tx = Text_New(sdate,stime,H+PriceScale,"●"+NumToStr(C,2));
Text_SetStyle(tx,2,2);
Text_SetColor(tx,RED);
}
# mav1>mav2 & mav3 상향구간
# Crossdown(Fastk, 80) t는 2까지 기록했고
# mav1>mav2 & mav3 상향구간 인 상태이고 FastK가 다시 상승하면 매수
if t > 0 and t1 >= 2
and U2 == 1 and U2!=U2[1] Then {
buy("B3");
}
if MarketPosition == 1 Then{
BH = highest(H,BarsSinceEntry);
if MaxEntries == 1 Then
HE = LatestEntryPrice(0);
if MaxEntries >= 2 and LatestEntryPrice(0) > HE Then
HE = LatestEntryPrice(0);
SetStopProfittarget(0.4);
ExitLong("B손절",AtStop,HE-PriceScale*80);
}
다음글
이전글