예스스탁
예스스탁 답변
2023-03-07 15:39:16
안녕하세요
예스스탁입니다.
1
종목검색은 최대제공봉수가 500봉입니다.
종목검색속성에서 검색에필요한최소기간에 500봉 지정하고 검색하시기 바랍니다.
2
올리신 수식에서 쐐기매수1과 삼각매수는 당일 첫진입일경우만 발생합니다.
수식에서 카운트해 첫번째 조건만족했을때만 종목검색됩니다.
3
Input: len(8), s1(0.37), s2(2.7);
var : slv1(0),slv2(0),slb1(0),slb2(0),shv1(0),shv2(0),shb1(0),shb2(0);
var : low_trendline(0),low_radian(0),high_trendline(0),high_radian(0);
var : Cond1(false),Cond2(false),Cond3(false),T(0);
slv1=SwingLow(1,low,len,len,100);
slv2=SwingLow(2,low,len,len,100);
slb1=SwingLowBar(1,low,len,len,100);
slb2=SwingLowBar(2,low,len,len,100);
shv1=SwingHigh(1,high,len,len,100);
shv2=SwingHigh(2,high,len,len,100);
shb1=SwingHighBar(1,high,len,len,100);
shb2=SwingHighbar(2,high,len,len,100);
If slb2 > slb1 then{
low_trendline =(slv1-slv2)/(slb2-slb1)*slb1+slv1;
low_radian=(((slv1-slv2)/slv2)*100)/(slb2-slb1);
}
If shb2>shb1 then{
high_trendline =(shv1-shv2)/(shb2-shb1)*shb1+shv1;
high_radian=(((shv1-shv2)/shv2)*100)/(shb2-shb1);
}
Var1=round(atan(low_radian)*180/pie,2);
Var2=round(atan(high_radian)*180/pie,2);
If Var1>0 And Var2>0 And Var1>var2 And high_trendline>low_trendline then# '상향쐐기형
Cond1=True;
Else
Cond1=False;
If Var1<0 And Var2<0 And Var1>var2 And high_trendline > low_trendline then# '하향쐐기형
Cond2=True;
Else
Cond2=False;
If Var1>0 And Var2<0 And high_trendline>low_trendline then# '삼각형
Cond3=True;
Else
Cond3=False;
Var10=highd(1)-lowd(1);
If sdate<>sdate[1] then
{
Var50=0;
T = 0;
}
If stime<150000 then
{
If var50==0 and Cond1==True And L <= low_trendline and low[1]>low_trendline[1] and Bdate == Bdate[1] then
{
Var50=var50+1;
T = -1;
}
If var50==0 and Cond2==True And H >= high_trendline and high[1] < high_trendline[1] and Bdate == Bdate[1] then
{
T = 1;
Var50=var50+1;
Find(1);
}
If Cond3=True And low[1]>low_trendline[1] And high[1]<high_trendline[1] then
{
if var50==0 and H >= high_trendline Then
{
T = 1;
Var50=var50+1;
Find(1);
}
if var50==0 and L <= Low_trendline Then
{
T = -1;
Var50=var50+1;
}
}
if var50==0 and H >= OpenD(0)+Var10*s1 and Bdate == Bdate[1] Then
{
T = 1;
Var50=var50+1;
}
if var50==0 and L <= opend(0)-var10*S1 and Bdate == Bdate[1] Then
{
T = -1;
Var50=var50+1;
}
}
즐거운 하루되세요
> 구호리 님이 쓴 글입니다.
> 제목 : 수식요청합니다.
> 아래 시스템자료를 종목검색식으로 변환 요청합니다.
쐐기매수1 또는 삼각매수 2가지만 종목검색요청하오며, 기타 매수, 매도는 삭제 부탁드립니다.
Input: len(8), s1(0.37), s2(2.7);
var : slv1(0),slv2(0),slb1(0),slb2(0),shv1(0),shv2(0),shb1(0),shb2(0);
var : low_trendline(0),low_radian(0),high_trendline(0),high_radian(0);
var : Cond1(false),Cond2(false),Cond3(false);
slv1=SwingLow(1,low,len,len,100);
slv2=SwingLow(2,low,len,len,100);
slb1=SwingLowBar(1,low,len,len,100);
slb2=SwingLowBar(2,low,len,len,100);
shv1=SwingHigh(1,high,len,len,100);
shv2=SwingHigh(2,high,len,len,100);
shb1=SwingHighBar(1,high,len,len,100);
shb2=SwingHighbar(2,high,len,len,100);
If slb2 > slb1 then{
low_trendline =(slv1-slv2)/(slb2-slb1)*slb1+slv1;
low_radian=(((slv1-slv2)/slv2)*100)/(slb2-slb1);
}
If shb2>shb1 then{
high_trendline =(shv1-shv2)/(shb2-shb1)*shb1+shv1;
high_radian=(((shv1-shv2)/shv2)*100)/(shb2-shb1);
}
Var1=round(atan(low_radian)*180/pie,2);
Var2=round(atan(high_radian)*180/pie,2);
If Var1>0 And Var2>0 And Var1>var2 And high_trendline>low_trendline then# '상향쐐기형
Cond1=True;
Else
Cond1=False;
If Var1<0 And Var2<0 And Var1>var2 And high_trendline > low_trendline then# '하향쐐기형
Cond2=True;
Else
Cond2=False;
If Var1>0 And Var2<0 And high_trendline>low_trendline then# '삼각형
Cond3=True;
Else
Cond3=False;
Var10=highd(1)-lowd(1);
If sdate<>sdate[1] then{
Var50=TotalTrades;
}
If stime<150000 then{
If TotalTrades-var50==0 then{
If Cond1==True And low>low_trendline then{
sell("쐐기매도1",Atstop,low_trendline );
}
If Cond2==True And high<high_trendline then{
buy("쐐기매수1",Atstop,high_trendline );
}
If Cond3=True And low>low_trendline And high<high_trendline then{
buy("삼각매수",Atstop,high_trendline );
sell("삼각매도",Atstop,low_trendline );
}
buy("매수",Atstop,opend(0)+var10*S1);
sell("매도",Atstop,opend(0)-var10*S1);
}
}
If stime<150000 then{
If TotalTrades-var50==1 then{
If Cond1==True And low>low_trendline then{
sell("쐐기매도2",Atstop,low_trendline );
}
If Cond2==True And high<high_trendline then{
buy("쐐기매수2",Atstop,high_trendline );
}
}
}
If MarketPosition<>0 then{
exitlong("매수추적",Atstop,highest(high,barssinceentry+1)-Atr(20)*S2);
exitshort("매도추적",Atstop,lowest(low,barssinceentry+1)+Atr(20)*S2);
}