예스스탁
예스스탁 답변
2024-07-18 16:59:24
안녕하세요
예스스탁입니다.
1
설정창에서 피라미딩을 다른진입신호만 허용으로 설정하고 적용하시기 바랍니다.
input : short(12),long(26),sig(9),P1(20),P2(60);
var : macdv(0),macds(0),m1(0),m2(0),T(0);
macdv = macd(short,long);
macds = ema(macdv,sig);
m1 = ma(C,P1);
m2 = ma(C,P2);
if CrossUp(macdv,macds) Then
{
T = 1;
if macdv < 0 Then
{
T = 2;
Condition1 = False;
Condition2 = False;
}
}
if CrossDown(macdv,macds) Then
{
T = -1;
if macdv > 0 Then
T = -2;
}
if T == 2 and Condition1 == False and CrossUp(c,m1) Then
{
Condition1 = true;
Buy("b1",OnClose,Def,1);
}
if T == 2 and Condition2 == False and CrossUp(c,m2) Then
{
Condition2 = true;
Buy("b2",OnClose,Def,1);
}
if T == -2 and Condition3 == False and CrossDown(c,m1) Then
{
Condition3 = true;
Sell("s1",OnClose,Def,1);
}
if T == -2 and Condition4 == False and CrossDown(c,m2) Then
{
Condition4 = true;
Sell("s2",OnClose,Def,1);
}
2
지표는 매수조건 충족봉에1, 매도조건 충족봉에 -1이 출력되게 작성해 드립니다.
input : short(12),long(26),sig(9),P1(20),P2(60);
var : macdv(0),macds(0),m1(0),m2(0),T(0),pst(0);
macdv = macd(short,long);
macds = ema(macdv,sig);
m1 = ma(C,P1);
m2 = ma(C,P2);
if CrossUp(macdv,macds) Then
{
T = 1;
if macdv < 0 Then
{
T = 2;
Condition1 = False;
Condition2 = False;
}
}
if CrossDown(macdv,macds) Then
{
T = -1;
if macdv > 0 Then
{
T = -2;
Condition3 = False;
Condition3 = False;
}
}
Plot1(0);
if T == 2 and Condition1 == False and CrossUp(c,m1) Then
{
Condition1 = true;
Plot1(1);
}
if T == 2 and Condition2 == False and CrossUp(c,m2) Then
{
Condition2 = true;
Plot1(1);
}
if T == -2 and Condition3 == False and CrossDown(c,m1) Then
{
Condition3 = true;
Plot1(-1);
}
if T == -2 and Condition4 == False and CrossDown(c,m2) Then
{
Condition4 = true;
Plot1(-1);
}
즐거운 하루되세요
> 부득탐승 님이 쓴 글입니다.
> 제목 : 지표 및 시스템신호 수식부탁드립니다
> 1. 매수 : macd가 0선 아래에서 시그널선을 상향돌파 하고 주가가 20이평 혹은 60이평을 돌파할 때 1계약씩 총 2개 매수 진입하는 시스템 신호식
2. 매도 : macd가 0선 위에서 시그널선을 하향붕괴 하고 주가가 20이평 혹은 60이평을 붕괴할 때 1계약씩 총 2개 매도 진입하는 시스템 신호식
차트에 표시하는 지표식 및 시스템 신호 부탁드립니다
3. 그리고 위 매수포지션 보유한 상황에서 위 매도신호 뜰때 매수포지션 청산하고 진입하는 수식으로 부탁드립니다. (반대의 매도 보유한 상황 포함)
감사합니다