예스스탁
예스스탁 답변
2020-01-02 11:44:36
안녕하세요
예스스탁입니다.
1
var : t(0),rsi1(0),rsi2(0),x(0),y(0);
rsi1 = rsi(14);
rsi2 = rsi(28);
if crossup(rsi2,50) Then
{
t = 1;
x = 0;
}
if CrossDown(rsi2,50) Then
{
t = -1;
y = 0;
}
if t == 1 Then
{
if crossup(rsi2,70) Then
{
x = x+1;
if x == 1 then
buy("b");
}
}
if t == -1 then
{
if CrossDown(rsi2,30) Then
{
y = y+1;
if y == 1 Then
sell("s");
}
}
if MarketPosition == 1 then
{
if CrossDown(rsi1,70) or CrossDown(rsi2,70) or CrossDown(rsi1,rsi2) Then
ExitLong();
}
if MarketPosition == -1 then
{
if CrossUp(rsi1,30) or CrossUp(rsi2,30) or CrossUp(rsi1,rsi2) Then
ExitShort();
}
2
#data1 1분봉
#data2 3분봉
#data3 5분봉
#data4 10분봉
var : t1(0,data1),rsi11(0,data1),rsi12(0,data1),x1(0,data1),y1(0,data1);
var : t2(0,data2),rsi21(0,data2),rsi22(0,data2),x2(0,data2),y2(0,data2);
var : t3(0,data3),rsi31(0,data3),rsi32(0,data3),x3(0,data3),y3(0,data3);
var : t4(0,data4),rsi41(0,data4),rsi42(0,data4),x4(0,data4),y4(0,data4);
var : bbup11(0,data1),bbup12(0,data1),bbdn11(0,data1),bbdn12(0,data1);
var : bbup21(0,data2),bbup22(0,data2),bbdn21(0,data2),bbdn22(0,data2);
var : bbup31(0,data3),bbup32(0,data3),bbdn31(0,data3),bbdn32(0,data3);
var : bbup41(0,data4),bbup42(0,data4),bbdn41(0,data4),bbdn42(0,data4);
rsi11 = data1(rsi(14));
rsi12 = data1(rsi(28));
rsi21 = data2(rsi(14));
rsi22 = data2(rsi(28));
rsi31 = data3(rsi(14));
rsi32 = data3(rsi(28));
rsi41 = data4(rsi(14));
rsi42 = data4(rsi(28));
bbup11 = data1(BollBandUp(10,2));
bbup12 = data1(BollBandUp(20,2));
bbdn11 = data1(BollBandDown(10,2));
bbdn12 = data1(BollBandDown(20,2));
bbup21 = data2(BollBandUp(10,2));
bbup22 = data2(BollBandUp(20,2));
bbdn21 = data2(BollBandDown(10,2));
bbdn22 = data2(BollBandDown(20,2));
bbup31 = data3(BollBandUp(10,2));
bbup32 = data3(BollBandUp(20,2));
bbdn31 = data3(BollBandDown(10,2));
bbdn32 = data3(BollBandDown(20,2));
bbup41 = data4(BollBandUp(10,2));
bbup42 = data4(BollBandUp(20,2));
bbdn41 = data4(BollBandDown(10,2));
bbdn42 = data4(BollBandDown(20,2));
if crossup(rsi12,50) Then
{
t1 = 1;
x1 = 0;
}
if CrossDown(rsi12,50) Then
{
t1 = -1;
y1 = 0;
}
if t1 == 1 Then
{
if crossup(rsi12,70) Then
{
x1 = x1+1;
}
}
if t1 == -1 then
{
if CrossDown(rsi12,30) Then
{
y1 = y1+1;
}
}
if crossup(rsi22,50) Then
{
t2 = 1;
x2 = 0;
}
if CrossDown(rsi22,50) Then
{
t2 = -1;
y2 = 0;
}
if t2 == 1 Then
{
if crossup(rsi22,70) Then
{
x2 = x2+1;
}
}
if t2 == -1 then
{
if CrossDown(rsi22,30) Then
{
y2 = y2+1;
}
}
if crossup(rsi32,50) Then
{
t3 = 1;
x3 = 0;
}
if CrossDown(rsi32,50) Then
{
t3 = -1;
y3 = 0;
}
if t3 == 1 Then
{
if crossup(rsi32,70) Then
{
x3 = x3+1;
}
}
if t3 == -1 then
{
if CrossDown(rsi32,30) Then
{
y3 = y3+1;
}
}
if crossup(rsi42,50) Then
{
t4 = 1;
x4 = 0;
}
if CrossDown(rsi42,50) Then
{
t4 = -1;
y4 = 0;
}
if t4 == 1 Then
{
if crossup(rsi42,70) Then
{
x4 = x4+1;
}
}
if t4 == -1 then
{
if CrossDown(rsi42,30) Then
{
y4 = y4+1;
}
}
if t1 == 1 and t2 == 1 and t3 == 1 and t4 == 1 and
x1 == 1 and x2 == 1 and x3 == 1 and x4 == 1 and
(x1[1] < 1 or x2[1] < 1 or x3[1] < 1 or x4[1] < 1) Then
buy();
if t1 == -1 and t2 == -1 and t3 == -1 and t4 == -1 and
y1 == 1 and y2 == 1 and y3 == 1 and y4 == 1 and
(y1[1] < 1 or y2[1] < 1 or y3[1] < 1 or y4[1] < 1) Then
sell();
if MarketPosition == 1 then
{
if CrossDown(rsi11,70) or CrossDown(rsi12,70) or CrossDown(rsi11,rsi12) Then
ExitLong();
if CrossDown(rsi21,70) or CrossDown(rsi22,70) or CrossDown(rsi21,rsi22) Then
ExitLong();
if CrossDown(rsi31,70) or CrossDown(rsi32,70) or CrossDown(rsi31,rsi32) Then
ExitLong();
if CrossDown(bbup11,bbup12) Then
ExitLong();
if CrossDown(bbup21,bbup22) Then
ExitLong();
if CrossDown(bbup31,bbup32) Then
ExitLong();
}
if MarketPosition == -1 then
{
if CrossUp(rsi11,70) or CrossUp(rsi12,70) or CrossUp(rsi11,rsi12) Then
ExitShort();
if CrossUp(rsi21,70) or CrossUp(rsi22,70) or CrossUp(rsi21,rsi22) Then
ExitShort();
if CrossUp(rsi31,70) or CrossUp(rsi32,70) or CrossUp(rsi31,rsi32) Then
ExitShort();
if CrossUp(bbdn11,bbdn12) Then
ExitShort();
if CrossUp(bbdn21,bbdn22) Then
ExitShort();
if CrossUp(bbdn31,bbdn32) Then
ExitShort();
}
즐거운 하루 되세요
> 이대표 님이 쓴 글입니다.
> 제목 : 시스템 수식
> 수고가 많으십니다.
RSI관련하여 진입과 청산신호를 수식으로 부탁드립니다.
< 조건> RSI 14, RSI 28 (시그널선은 제외)
< 1> (매수진입) RSI 28이 50을 상향돌파후 최초로 70을 상향돌파할때 
(매수청산) 매수진입후           RSI 14가 70을 하향돌파하거나    
       RSI 28이 70을 하향돌파하거나   
        RSI 14가 RSI 28을 데드크로스 할때
(매도진입)  RSI 28이 50을 하향돌파후 최초로 30을 하향돌파할때 
  (매도청산) 매도진입후           RSI 14가 30을 상향돌파하거나     
      RSI 28이 30을 상향돌파하거나   
        RSI 14가 RSI 28을 골드크로스 할때
<2>①1분봉/ 3분봉/ 5분봉/10분봉에서 위 <1>의 조건이 충족될때만 매수진입/ 매도진입/
②매수청산과 매도청산은 5분봉에서 위<1> 조건충족시
③매수청산과 매도청산은
5분봉 또는 3분봉에서 위<1> 조건충족시
④매수청산과 매도청산은
5분봉 또는 3분봉 또는 1분봉에서 위<1> 조건충족시
*즉, 위<1>은 아무봉에서나 조건 충족시 진입 및 청산
위<2>는 진입시는 1분봉 3분봉 5분봉 10분봉 모두 조건 충족시
청산시는 5분봉에서만,
5분봉 또는 3분봉에서,
5분봉 또는 3분봉 또는 1분봉에서
조건충족시 각각 시스템 수식
<3>청산에 있어서 추가적으로
①5분봉에서
볼린저밴드(10/2)상한선이 볼린저밴드(20/2상한선)을 데드크로스(터치 포함)할 때 매수청산
②5분봉 또는 3분봉 에서
볼린저밴드(10/2)상한선이 볼린저밴드(20/2상한선)을 데드크로스(터치 포함)할 때 매수청산
③5분봉 또는 3분봉 또는 1분봉에서
볼린저밴드(10/2)상한선이 볼린저밴드(20/2상한선)을 데드크로스(터치 포함)할 때 매수청산
④5분봉에서
볼린저밴드(10/2)하한선이 볼린저밴드(20/2상한선)을 골드크로스(터치 포함)할 때 매도청산
⑤5분봉 또는 3분봉 에서
볼린저밴드(10/2)하한선이 볼린저밴드(20/2) 하한선을 골드크로스(터치 포함)할 때 매도청산
⑥5분봉 또는 3분봉 에서
볼린저밴드(10/2)하한선이 볼린저밴드(20/2) 하한선을 골드크로스(터치 포함)할 때 매도청산