커뮤니티
요청드립니다
2018-05-06 10:06:18
160
글번호 118676
요청드린 사항이 반영이 안되어 다시 요청드립니다
input : n(30);
var : t(0),t1(0),tx(0);
var1 = ma(c,10);
var2 = ma(C,200);
if Crossup(C,var2) Then
{
t = 1;
t1 = t[1];
tx = Text_New(sdate,stime,H+PriceScale,"■"+NumToStr(C,2));
Text_SetStyle(tx,2,2);
Text_SetColor(tx,RED);
Condition1 = false;
}
if CrossDown(C,var2) Then
{
t = -1;
t1 = t[1];
tx = Text_New(sdate,stime,L-PriceScale,"■"+NumToStr(C,2));
Text_SetStyle(tx,2,2);
Text_SetColor(tx,BLUE);
}
if t == -1 and c < var2-PriceScale*n Then{
t = -2;
tx = Text_New(sdate,stime,L-PriceScale,"●"+NumToStr(C,2));
Text_SetStyle(tx,2,2);
Text_SetColor(tx,BLUE);
}
if t == 1 and c > var2+PriceScale*n Then
{
t = 2;
tx = Text_New(sdate,stime,H+PriceScale,"●"+NumToStr(C,2));
Text_SetStyle(tx,2,2);
Text_SetColor(tx,RED);
}
if Condition1 == false and t > 0 and t1 <= -2 and var1 > var2 Then{
buy();
Condition1 = true;
tx = Text_New(sdate,stime,H+PriceScale,"★"+NumToStr(C,2));
Text_SetStyle(tx,2,2);
Text_SetColor(tx,RED);
}
if Condition2 == false and t < 0 and t1 >= 2 and var1 < var2 Then{
sell();
Condition2 = true;
tx = Text_New(sdate,stime,L-PriceScale,"★"+NumToStr(C,2));
Text_SetStyle(tx,2,2);
Text_SetColor(tx,BLUE);
}
SetStopProfittarget(PriceScale*50,PointStop);
SetStopLoss(PriceScale*50,PointStop);
답변 1
예스스탁 예스스탁 답변
2018-05-04 12:00:59
안녕하세요
예스스탁입니다.
1
■와 ★가 조건에 따라 겹칠수가 있습니다.
■는 고가+1틱/저가-1틱, ★은 고가+2틱/저가-틱에 출력합니다.
표시되는 y축값은 사용자분이 조절해 보셔야 합니다.
2
수정한 식입니다.수식에 주석을 붙여드립니다.
이후의 내용은 주석 참고하셔서 수정보완해 사용하시기 바랍니다.
input : n(30),손절틱수(50),익절틱수(50);
var : t(0),t1(0),tx(0),tl(0);
var1 = ma(c,10);
var2 = ma(C,200);
#200선 상향돌파
if Crossup(C,var2) Then
{
#t는 1
t = 1;
#이전구간(하향이탈구간) t값은 t1에 저장
t1 = t[1];
#■출력
tx = Text_New(sdate,stime,H+PriceScale,"■"+NumToStr(C,2));
Text_SetStyle(tx,2,2);
Text_SetColor(tx,RED);
#매수주문을 구간에 한번하기 위한 변수
Condition1 = false;
}
#200선 하향이탈
if CrossDown(C,var2) Then
{
#t는 -1
t = -1;
#이전구간(상향돌파구간) t값은 t1에 저장
t1 = t[1];
#■출력
tx = Text_New(sdate,stime,L-PriceScale,"■"+NumToStr(C,2));
Text_SetStyle(tx,2,2);
Text_SetColor(tx,BLUE);
#매도주문을 구간에 한번하기 위한 변수
Condition2 = false;
}
#t가 1일때 종가가 200선대비 n틱이상 크게되면
if t == 1 and c > var2+PriceScale*n 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가 -1일때 종가가 200선대비 n틱이상 작게되면
if t == -1 and c < var2-PriceScale*n Then{
#t는 -2로 변경
t = -2;
#●출력
tx = Text_New(sdate,stime,L-PriceScale,"●"+NumToStr(C,2));
Text_SetStyle(tx,2,2);
Text_SetColor(tx,BLUE);
}
# 200선 상향돌파하고 직전구간(하향이탈구간) t가 -2까지 기록했으면
if crossup(t,0) and t1 <= -2 Then
{
#★출력
tx = Text_New(sdate,stime,H+PriceScale*3,"★"+NumToStr(C,2));
Text_SetStyle(tx,2,2);
Text_SetColor(tx,RED);
}
# 200선 하향이탈하고 직전구간(상향돌파구간) t가 2까지 기록했으면
if CrossDown(t,0) and t1 >= 2 Then
{
#★출력
tx = Text_New(sdate,stime,L-PriceScale*3,"★"+NumToStr(C,2));
Text_SetStyle(tx,2,2);
Text_SetColor(tx,BLUE);
}
#200선 상향돌파한 구간이고
#직전 햐향이탈한 구간은 t는 -2까지 기록했고
#현재10선이 200선보다 크면 매수
if Condition1 == false and t > 0 and t1 <= -2 and var1 > var2 Then{
Condition1 = true;
buy();
}
#200선 하향이탈한 구간이고
#직전구간(상향돌파구간)애서 t는 2까지 기록했고
#현재10선이 200선보다 작으면 매도
if Condition2 == false and t < 0 and t1 >= 2 and var1 < var2 Then{
Condition2 = true;
sell();
}
#익절
SetStopProfittarget(PriceScale*익절틱수,PointStop);
#손절
SetStopLoss(PriceScale*손절틱수,PointStop);
즐거운 하루되세요
> 라떼처럼 님이 쓴 글입니다.
> 제목 : 요청드립니다
> 요청드린 사항이 반영이 안되어 있어 다시한번 요청드립니다.
●발생 후 (조건 만족 후) 200선 위로 올라갈 경우 ★ 이 표시 되지 않으며,
★ 이후 10개 캔들의 평균값이 200선 위에 있을때 매수,매도(반대) 수식이 반영 안되 있습니다.
부탁드립니다. 감사합니다.
매수
조건1)
이동평균 200선 아래로 내려간 첫번째 캔들의 값 기준 ■
■ 발생 후 아래로 N 틱 이상 내려가면 ● (N(30)틱 이상 갭 발생하면)
조건2)
● 발생 후 다시 200선 위로 캔들이(종가가) 올라가면 ★
조건3)
★ 캔들 이후 10개 갠들의 평균 가격이 200선 보다 높으면 매수
매도 (매수 반대)
조건1)
이동평균 200선 위로 올라간 첫번째 캔들의 값 기준 ■
■ 발생 후 위로 N 틱 이상 올라가면 ● (N(30)틱 이상 갭 발생하면)
조건2)
● 발생 후 다시 200선 아래로 캔들이(종가가) 내려가면 ★
조건3)
★ 캔들 이후 10개 갠들의 평균 가격이 200선 보다 낮으면 매도
■과 ★은 함께 나타날수 있습니다.
200선 위로올라간 첫번째 캔들이면 ■이 발생
●(N틱 갭)발생후 200선 위로 올라간 첫번째 캔들이면 ★이 발생
포지션이 있을경우 손절 30틱 익절 30틱
지표 표시: ■(가격)
●(-N틱)
★
input : n(30);
var : t(0),t1(0),tx(0);
var1 = ma(c,10);
var2 = ma(C,200);
if Crossup(C,var2) Then
{
t = 1;
t1 = t[1];
tx = Text_New(sdate,stime,H+PriceScale,"■"+NumToStr(C,2));
Text_SetStyle(tx,2,2);
Text_SetColor(tx,RED);
Condition1 = false;
}
if CrossDown(C,var2) Then
{
t = -1;
t1 = t[1];
tx = Text_New(sdate,stime,L-PriceScale,"■"+NumToStr(C,2));
Text_SetStyle(tx,2,2);
Text_SetColor(tx,BLUE);
}
if t == -1 and c < var2-PriceScale*n Then{
t = -2;
tx = Text_New(sdate,stime,L-PriceScale,"●"+NumToStr(C,2));
Text_SetStyle(tx,2,2);
Text_SetColor(tx,BLUE);
}
if t == 1 and c > var2+PriceScale*n Then
{
t = 2;
tx = Text_New(sdate,stime,H+PriceScale,"●"+NumToStr(C,2));
Text_SetStyle(tx,2,2);
Text_SetColor(tx,RED);
}
if Condition1 == false and t > 0 and t1 <= -2 and var1 > var2 Then{
buy();
Condition1 = true;
tx = Text_New(sdate,stime,H+PriceScale,"★"+NumToStr(C,2));
Text_SetStyle(tx,2,2);
Text_SetColor(tx,RED);
}
if Condition2 == false and t < 0 and t1 >= 2 and var1 < var2 Then{
sell();
Condition2 = true;
tx = Text_New(sdate,stime,L-PriceScale,"★"+NumToStr(C,2));
Text_SetStyle(tx,2,2);
Text_SetColor(tx,BLUE);
}
SetStopProfittarget(PriceScale*50,PointStop);
SetStopLoss(PriceScale*50,PointStop);
다음글
이전글