커뮤니티
수식 부탁드립니다.
2017-03-19 20:26:25
125
글번호 107971
안녕하세요
아래 수식에 1번,2번 조건을 첨가해 주시면 감사하겠습니다.
1번조건은 60 이평이 우상향할때는 매도신호가 나오지 않게하고
2번조건은 60 이평이 우하향할때는 매수신호가 나오지 않게 하는것입니다.
input : P1(10),P2(20);
input : sto1(5),sto2(3);
Input : TRIXPeriod(12), TRIXsigPeriod(9);
var : mav1(0),mav2(0);
var : TRIXv(0),TRIXs(0),stok(0),S(0);
mav1 = ma(C,P1);
mav2 = ma(C,P2);
stok = StochasticsK(sto1,sto2);
TRIXv = TRIX(TRIXPeriod);
TRIXs = ema(TRIXv,TRIXsigPeriod);
if crossup(stok,30) Then
S = 1;
if crossup(stok,70) Then
S = 2;
if CrossDown(stok,30) Then
S = -1;
if crossup(stok,70) Then
S = -2;
if mav1 > mav2 and
mav1 > mav1[1] and mav2 > mav2[1] and
S == 1 and stok > 30 and
crossup(Trixv,trixs) Then
buy();
if MarketPosition == 1 and CrossDown(mav1,mav2) Then
ExitLong();
if mav1 < mav2 and
mav1 < mav1[1] and mav2 < mav2[1] and
S == -2 and stok < 70 and
CrossDown(Trixv,trixs) Then
sell();
if MarketPosition == -1 and CrossUp(mav1,mav2) Then
ExitShort();
감사드립니다.
답변 1
예스스탁 예스스탁 답변
2017-03-20 17:46:09
안녕하세요
예스스탁입니다.
input : P1(10),P2(20),P3(60);
input : sto1(5),sto2(3);
Input : TRIXPeriod(12), TRIXsigPeriod(9);
var : mav1(0),mav2(0),mav3(0),T(0);
var : TRIXv(0),TRIXs(0),stok(0),S(0);
mav1 = ma(C,P1);
mav2 = ma(C,P2);
mav3 = ma(C,P3);
stok = StochasticsK(sto1,sto2);
TRIXv = TRIX(TRIXPeriod);
TRIXs = ema(TRIXv,TRIXsigPeriod);
if mav3 > mav3[1] Then
T = 1;
if mav3 < mav3[1] Then
T = -1;
if crossup(stok,30) Then
S = 1;
if crossup(stok,70) Then
S = 2;
if CrossDown(stok,30) Then
S = -1;
if crossup(stok,70) Then
S = -2;
if T == 1 and
mav1 > mav2 and
mav1 > mav1[1] and mav2 > mav2[1] and
S == 1 and stok > 30 and
crossup(Trixv,trixs) Then
buy();
if MarketPosition == 1 and CrossDown(mav1,mav2) Then
ExitLong();
if T == -1 and
mav1 < mav2 and
mav1 < mav1[1] and mav2 < mav2[1] and
S == -2 and stok < 70 and
CrossDown(Trixv,trixs) Then
sell();
if MarketPosition == -1 and CrossUp(mav1,mav2) Then
ExitShort();
즐거운 하루되세요
> 뭐이런걸다 님이 쓴 글입니다.
> 제목 : 수식 부탁드립니다.
>
안녕하세요
아래 수식에 1번,2번 조건을 첨가해 주시면 감사하겠습니다.
1번조건은 60 이평이 우상향할때는 매도신호가 나오지 않게하고
2번조건은 60 이평이 우하향할때는 매수신호가 나오지 않게 하는것입니다.
input : P1(10),P2(20);
input : sto1(5),sto2(3);
Input : TRIXPeriod(12), TRIXsigPeriod(9);
var : mav1(0),mav2(0);
var : TRIXv(0),TRIXs(0),stok(0),S(0);
mav1 = ma(C,P1);
mav2 = ma(C,P2);
stok = StochasticsK(sto1,sto2);
TRIXv = TRIX(TRIXPeriod);
TRIXs = ema(TRIXv,TRIXsigPeriod);
if crossup(stok,30) Then
S = 1;
if crossup(stok,70) Then
S = 2;
if CrossDown(stok,30) Then
S = -1;
if crossup(stok,70) Then
S = -2;
if mav1 > mav2 and
mav1 > mav1[1] and mav2 > mav2[1] and
S == 1 and stok > 30 and
crossup(Trixv,trixs) Then
buy();
if MarketPosition == 1 and CrossDown(mav1,mav2) Then
ExitLong();
if mav1 < mav2 and
mav1 < mav1[1] and mav2 < mav2[1] and
S == -2 and stok < 70 and
CrossDown(Trixv,trixs) Then
sell();
if MarketPosition == -1 and CrossUp(mav1,mav2) Then
ExitShort();
감사드립니다.
이전글