커뮤니티
부탁드립니다.
2018-12-04 17:07:55
180
글번호 124143
항상 감사드립니다.
매구 가능 조건 후 (BuyEntry == true)
mav1 > mav2 and mav3[1] < mav3 상태이면서
U2 == 1 and U2!=U2[1] 이면 매수하는 식으로 해보았습니다.
매구 가능 조건 후 (BuyEntry == true)
mav1 > mav2 and mav3[1] < mav3 상태가 풀리면
U2 == 1 and U2!=U2[1] 이어도 매수하지 않고 싶습니다.
아래식은 매수 가능 조건후 mav1 > mav2 and mav3[1] < mav3 상태가 풀리더라도
한참뒤어 mav1 > mav2 and mav3[1] < mav3 와 U2 == 1 and U2!=U2[1] 가 만족되면
매수가 들어갑니다.
부탁드립니다.
1식은 제가 구성해 본 식이며, 2식은 작성해 주신 식입니다.
두개 모두 동일합니다.
1.
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 BuyEntry == true
and mav1 > mav2 and mav3[1] < mav3
and U2 == 1 and U2!=U2[1] 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);
}
2.
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);
}
답변 1
예스스탁 예스스탁 답변
2018-12-05 10:11:32
안녕하세요
예스스탁입니다.
T변수 하나로 컨트롤 되게 수정해 드립니다.
mav1 > mav2 and mav3[1] < mav3 조건이 만족하면 1
위 조건이 만족하지 않으면 T를 0으로 초기화하게 변경했습니다.
T가 1인상태에서 fastD가 80을 하향이탈하면 T는 2가 되고
T가 2인상태에서 fask가 상승전환하면 매수하고 T는 3으로 값이 변경되어
fastD가 하향이탈후 한번만 매수되게 했습니다.
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), 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;
#가중이평 조건이 만족하면 1
if mav1 > mav2 and mav3[1] < mav3 then
t = 1;
Else #조건이 만족하지 않으면 0
T = 0;
# 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);
}
# T == 2이고
if T == 2 Then
{
#fastk가 상승전화하면
if U2 == 1 and U2!=U2[1] Then
{
#T는 3
T = 3;
#매수
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);
}
즐거운 하루되세요
> 라떼처럼 님이 쓴 글입니다.
> 제목 : 부탁드립니다.
> 항상 감사드립니다.
매구 가능 조건 후 (BuyEntry == true)
mav1 > mav2 and mav3[1] < mav3 상태이면서
U2 == 1 and U2!=U2[1] 이면 매수하는 식으로 해보았습니다.
매구 가능 조건 후 (BuyEntry == true)
mav1 > mav2 and mav3[1] < mav3 상태가 풀리면
U2 == 1 and U2!=U2[1] 이어도 매수하지 않고 싶습니다.
아래식은 매수 가능 조건후 mav1 > mav2 and mav3[1] < mav3 상태가 풀리더라도
한참뒤어 mav1 > mav2 and mav3[1] < mav3 와 U2 == 1 and U2!=U2[1] 가 만족되면
매수가 들어갑니다.
부탁드립니다.
1식은 제가 구성해 본 식이며, 2식은 작성해 주신 식입니다.
두개 모두 동일합니다.
1.
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 BuyEntry == true
and mav1 > mav2 and mav3[1] < mav3
and U2 == 1 and U2!=U2[1] 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);
}
2.
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);
}
다음글
이전글