커뮤니티
문의
2015-12-16 10:01:51
119
글번호 93448
input : Period(100);
var : Counter(0), Lowval(0), Highval(0), DownVel(0),UpVel(0), DnAroon(0),UpAroon(0) ;
Input : PercentRLen(10), OverSold(10), OverBought(90), BTrigger(62), STrigger(38),당일수익(90);
Var : PcntR(0), AvgValue(0), BSetup(False),Ssetup(False),NP(0),PreNP(0),dayPL(0),profit(0),T(0);
Lowval= Lowest(Low, Period+1);
Highval = Highest(High, Period+1);
For counter= 0 To Period {
If Low[counter] == Lowval Then
DownVel = counter;
If High[counter] == highval Then
UpVel = counter;
}
DnAroon = 100*(Period-DownVel)/Period;
UpAroon = 100*(Period-UpVel)/Period;
if UpAroon >= 30 or DnAroon >= 30 Then{
if crossup(dnaroon , uparoon) Then
buy("반대매수");
if crossup(uparoon , dnaroon) Then
sell("반대매도");
}
if UpAroon <= 30 or DnAroon <= 30 Then{
if crossup(dnaroon , uparoon) Then
Sell("매도");
if crossup(uparoon,dnaroon) Then
Buy("매수");
}
위식에서 crossup 해서 교차한 시점이 30 이하 나 이상일때 매수 매도 진입할수있게하고싶습니다.
교차할때 값을 구해서 그값이 30 이하 OR 이상일때 진입할수있도록 입니다
#########################################################
아래식에서 포지션 진입후 예로 매수 진입했으면 청산신호가 나올시에
손실중이면 청산하지 말고 진입가 + 2틱 일때 청산하게 해주세요 단: 대장매수,,대장매도 신호가 나오면 손실중이라도 무조건 청산하게 하고요
input : b_time1(000000),e_time1(240000),목표청산1(3);
input : stoK_p11(150),stoK_p12(250),stoK_p13(10);
input : ma_p11(15),ma_p12(3),ma_p13(5),ma_p14(10),ma_p15(10),ma_p16(20),ma_p17(15); # 이부분에서 ma_p13(15),ma_p17(15)
input : sto1(10),sto2(6);
Var:stoK1(0),stoD1(0),TRIXv(0),TRIXsig(0),stok2(0),T(0);
stok2 = StochasticsK(sto1,sto2);
If b_time1 <= Time and Time <= e_time1 Then
{
stoK1 = StochasticsK(stoK_p11,stoK_p12);
stoD1 = StochasticsD(stoK_p11,stoK_p12,stoK_p13);
If countif(ma(C,ma_p11)[1] < ma(C,ma_p11),1) == 1
and (ma(C,ma_p12)[1] <= ma(C,ma_p13)[1] and ma(C,ma_p12) > ma(C,ma_p13))
and countif(ma(C,ma_p14)[1] < ma(C,ma_p14),1) == 1
and countif(ma(C,ma_p15)[1] < ma(C,ma_p15),1) == 1
and countif(ma(C,ma_p16)[1] < ma(C,ma_p16),1) == 1
and countif(ma(C,ma_p17)[1] < ma(C,ma_p17),1) == 1
Then
{
T = 1;
if MarketPosition == -1 Then
ExitShort("대장매수");
}
If countif(ma(C,ma_p11)[1] > ma(C,ma_p11),1) == 1
and (ma(C,ma_p12)[1] >= ma(C,ma_p13)[1] and ma(C,ma_p12) < ma(C,ma_p13))
and countif(ma(C,ma_p14)[1] > ma(C,ma_p14),1) == 1
and countif(ma(C,ma_p15)[1] > ma(C,ma_p15),1) == 1
and countif(ma(C,ma_p16)[1] > ma(C,ma_p16),1) == 1
and countif(ma(C,ma_p17)[1] > ma(C,ma_p17),1) == 1
Then
{
T = -1;
if MarketPosition == 1 Then
ExitLong("대장매도");
}
}
if T == 1 then{
if countif(stok2>stok2[1],2) == 1 and stok2[1] < 30 Then
buy("매수");
if countif(stok2<stok2[1],2) == 1 and stok2[1] > 70 Then
ExitLong("매수청산");
}
if T == -1 then{
if countif(stok2<stok2[1],2) == 1 and stok2[1] > 70 Then
sell("매도");
if countif(stok2>stok2[1],2) == 1 and stok2[1] < 30 Then
ExitShort("매도청산");
}
답변 1
예스스탁 예스스탁 답변
2015-12-16 11:37:58
안녕하세요
예스스탁입니다.
1.
Aroon은 UpAroon ,DnAroon 2개의 값이 있습니다.
매수나 매도식에 해당 값으로 조건을 지정하시면 됩니다.
어떤 값이 30이상이하인지 불명해서
돌파하는 값이 매수면 30이하, 매도는 30이상으로 지정했습니다.
의도하신 부분과 다르신면 값지정하셔서 수치변경하시면 됩니다.
input : Period(100);
var : Counter(0), Lowval(0), Highval(0), DownVel(0),UpVel(0), DnAroon(0),UpAroon(0) ;
Input : PercentRLen(10), OverSold(10), OverBought(90), BTrigger(62), STrigger(38),당일수익(90);
Var : PcntR(0), AvgValue(0), BSetup(False),Ssetup(False),NP(0),PreNP(0),dayPL(0),profit(0),T(0);
Lowval= Lowest(Low, Period+1);
Highval = Highest(High, Period+1);
For counter= 0 To Period {
If Low[counter] == Lowval Then
DownVel = counter;
If High[counter] == highval Then
UpVel = counter;
}
DnAroon = 100*(Period-DownVel)/Period;
UpAroon = 100*(Period-UpVel)/Period;
if crossup(dnaroon , uparoon) and UpAroon <= 30 Then
buy("반대매수");
if crossup(uparoon , dnaroon) and uparoon >= 30 Then
sell("반대매도");
if crossup(dnaroon , uparoon) and dnaroon >= 30 Then
Sell("매도");
if crossup(uparoon,dnaroon) and uparoon <= 30 Then
Buy("매수");
2.
input : b_time1(000000),e_time1(240000),목표청산1(3);
input : stoK_p11(150),stoK_p12(250),stoK_p13(10);
input : ma_p11(15),ma_p12(3),ma_p13(5),ma_p14(10),ma_p15(10),ma_p16(20),ma_p17(15); # 이부분에서 ma_p13(15),ma_p17(15)
input : sto1(10),sto2(6);
Var:stoK1(0),stoD1(0),TRIXv(0),TRIXsig(0),stok2(0),T(0);
stok2 = StochasticsK(sto1,sto2);
If b_time1 <= Time and Time <= e_time1 Then
{
stoK1 = StochasticsK(stoK_p11,stoK_p12);
stoD1 = StochasticsD(stoK_p11,stoK_p12,stoK_p13);
If countif(ma(C,ma_p11)[1] < ma(C,ma_p11),1) == 1
and (ma(C,ma_p12)[1] <= ma(C,ma_p13)[1] and ma(C,ma_p12) > ma(C,ma_p13))
and countif(ma(C,ma_p14)[1] < ma(C,ma_p14),1) == 1
and countif(ma(C,ma_p15)[1] < ma(C,ma_p15),1) == 1
and countif(ma(C,ma_p16)[1] < ma(C,ma_p16),1) == 1
and countif(ma(C,ma_p17)[1] < ma(C,ma_p17),1) == 1
Then
{
T = 1;
if MarketPosition == -1 Then
ExitShort("대장매수");
}
If countif(ma(C,ma_p11)[1] > ma(C,ma_p11),1) == 1
and (ma(C,ma_p12)[1] >= ma(C,ma_p13)[1] and ma(C,ma_p12) < ma(C,ma_p13))
and countif(ma(C,ma_p14)[1] > ma(C,ma_p14),1) == 1
and countif(ma(C,ma_p15)[1] > ma(C,ma_p15),1) == 1
and countif(ma(C,ma_p16)[1] > ma(C,ma_p16),1) == 1
and countif(ma(C,ma_p17)[1] > ma(C,ma_p17),1) == 1
Then
{
T = -1;
if MarketPosition == 1 Then
ExitLong("대장매도");
}
}
if T == 1 then{
if countif(stok2>stok2[1],2) == 1 and stok2[1] < 30 Then
buy("매수");
if countif(stok2<stok2[1],2) == 1 and stok2[1] > 70 and C >= EntryPrice+PriceScale*2 Then
ExitLong("매수청산");
}
if T == -1 then{
if countif(stok2<stok2[1],2) == 1 and stok2[1] > 70 Then
sell("매도");
if countif(stok2>stok2[1],2) == 1 and stok2[1] < 30 and C <= EntryPrice-PriceScale*2 Then
ExitShort("매도청산");
}
즐거운 하루되세요
> 자라도 님이 쓴 글입니다.
> 제목 : 문의
> input : Period(100);
var : Counter(0), Lowval(0), Highval(0), DownVel(0),UpVel(0), DnAroon(0),UpAroon(0) ;
Input : PercentRLen(10), OverSold(10), OverBought(90), BTrigger(62), STrigger(38),당일수익(90);
Var : PcntR(0), AvgValue(0), BSetup(False),Ssetup(False),NP(0),PreNP(0),dayPL(0),profit(0),T(0);
Lowval= Lowest(Low, Period+1);
Highval = Highest(High, Period+1);
For counter= 0 To Period {
If Low[counter] == Lowval Then
DownVel = counter;
If High[counter] == highval Then
UpVel = counter;
}
DnAroon = 100*(Period-DownVel)/Period;
UpAroon = 100*(Period-UpVel)/Period;
if UpAroon >= 30 or DnAroon >= 30 Then{
if crossup(dnaroon , uparoon) Then
buy("반대매수");
if crossup(uparoon , dnaroon) Then
sell("반대매도");
}
if UpAroon <= 30 or DnAroon <= 30 Then{
if crossup(dnaroon , uparoon) Then
Sell("매도");
if crossup(uparoon,dnaroon) Then
Buy("매수");
}
위식에서 crossup 해서 교차한 시점이 30 이하 나 이상일때 매수 매도 진입할수있게하고싶습니다.
교차할때 값을 구해서 그값이 30 이하 OR 이상일때 진입할수있도록 입니다
#########################################################
아래식에서 포지션 진입후 예로 매수 진입했으면 청산신호가 나올시에
손실중이면 청산하지 말고 진입가 + 2틱 일때 청산하게 해주세요 단: 대장매수,,대장매도 신호가 나오면 손실중이라도 무조건 청산하게 하고요
input : b_time1(000000),e_time1(240000),목표청산1(3);
input : stoK_p11(150),stoK_p12(250),stoK_p13(10);
input : ma_p11(15),ma_p12(3),ma_p13(5),ma_p14(10),ma_p15(10),ma_p16(20),ma_p17(15); # 이부분에서 ma_p13(15),ma_p17(15)
input : sto1(10),sto2(6);
Var:stoK1(0),stoD1(0),TRIXv(0),TRIXsig(0),stok2(0),T(0);
stok2 = StochasticsK(sto1,sto2);
If b_time1 <= Time and Time <= e_time1 Then
{
stoK1 = StochasticsK(stoK_p11,stoK_p12);
stoD1 = StochasticsD(stoK_p11,stoK_p12,stoK_p13);
If countif(ma(C,ma_p11)[1] < ma(C,ma_p11),1) == 1
and (ma(C,ma_p12)[1] <= ma(C,ma_p13)[1] and ma(C,ma_p12) > ma(C,ma_p13))
and countif(ma(C,ma_p14)[1] < ma(C,ma_p14),1) == 1
and countif(ma(C,ma_p15)[1] < ma(C,ma_p15),1) == 1
and countif(ma(C,ma_p16)[1] < ma(C,ma_p16),1) == 1
and countif(ma(C,ma_p17)[1] < ma(C,ma_p17),1) == 1
Then
{
T = 1;
if MarketPosition == -1 Then
ExitShort("대장매수");
}
If countif(ma(C,ma_p11)[1] > ma(C,ma_p11),1) == 1
and (ma(C,ma_p12)[1] >= ma(C,ma_p13)[1] and ma(C,ma_p12) < ma(C,ma_p13))
and countif(ma(C,ma_p14)[1] > ma(C,ma_p14),1) == 1
and countif(ma(C,ma_p15)[1] > ma(C,ma_p15),1) == 1
and countif(ma(C,ma_p16)[1] > ma(C,ma_p16),1) == 1
and countif(ma(C,ma_p17)[1] > ma(C,ma_p17),1) == 1
Then
{
T = -1;
if MarketPosition == 1 Then
ExitLong("대장매도");
}
}
if T == 1 then{
if countif(stok2>stok2[1],2) == 1 and stok2[1] < 30 Then
buy("매수");
if countif(stok2<stok2[1],2) == 1 and stok2[1] > 70 Then
ExitLong("매수청산");
}
if T == -1 then{
if countif(stok2<stok2[1],2) == 1 and stok2[1] > 70 Then
sell("매도");
if countif(stok2>stok2[1],2) == 1 and stok2[1] < 30 Then
ExitShort("매도청산");
}