예스스탁
예스스탁 답변
2025-08-19 10:12:31
안녕하세요
예스스탁입니다.
1
input : P1(5);
var : mav1(0),T1(0);
mav1 = ma(C,P1);
if mav1 > mav1[1] Then
T1 = 1;
if mav1 < mav1[1] Then
T1 = -1;
if T1 == 1 and T1 != T1[1] Then
Buy();
if T1 == -1 and T1 != T1[1] Then
Sell();
2
input : P1(5),P2(20);
var : mav1(0),T1(0);
var : mav2(0),T2(0);
mav1 = ma(C,P1);
mav2 = ma(C,P2);
if mav1 > mav1[1] Then
T1 = 1;
if mav1 < mav1[1] Then
T1 = -1;
if mav2 > mav2[1] Then
T2 = 1;
if mav2 < mav2[1] Then
T2 = -1;
Condition1 = T1 == 1 and T2 == 1;
Condition2 = T1 == -1 and T2 == -1;
if Condition1 == true and Condition1[1] == False Then
Buy();
if MarketPosition == 1 and Condition1 == False Then
ExitLong();
if Condition2 == true and Condition2[1] == False Then
Sell();
if MarketPosition == -1 and Condition2 == False Then
ExitShort();
3
input : P1(5),P2(20),P3(60);
var : mav1(0),T1(0);
var : mav2(0),T2(0);
var : mav3(0),T3(0);
mav1 = ma(C,P1);
mav2 = ma(C,P2);
mav3 = ma(C,P3);
if mav1 > mav1[1] Then
T1 = 1;
if mav1 < mav1[1] Then
T1 = -1;
if mav2 > mav2[1] Then
T2 = 1;
if mav2 < mav2[1] Then
T2 = -1;
if mav3 > mav3[1] Then
T2 = 1;
if mav3 < mav3[1] Then
T3 = -1;
Condition1 = T1 == 1 and T2 == 1 and T3 == 1;
Condition2 = T1 == -1 and T2 == -1 and T3 == -1;
if Condition1 == true and Condition1[1] == False Then
Buy();
if MarketPosition == 1 and Condition1 == False Then
ExitLong();
if Condition2 == true and Condition2[1] == False Then
Sell();
if MarketPosition == -1 and Condition2 == False Then
ExitShort();
4
input : P1(5),P2(20),P3(60),P4(120);
var : mav1(0),T1(0);
var : mav2(0),T2(0);
var : mav3(0),T3(0);
var : mav4(0),T4(0);
mav1 = ma(C,P1);
mav2 = ma(C,P2);
mav3 = ma(C,P3);
mav4 = ma(C,P4);
if mav1 > mav1[1] Then
T1 = 1;
if mav1 < mav1[1] Then
T1 = -1;
if mav2 > mav2[1] Then
T2 = 1;
if mav2 < mav2[1] Then
T2 = -1;
if mav3 > mav3[1] Then
T3 = 1;
if mav3 < mav3[1] Then
T3 = -1;
if mav4 > mav4[1] Then
T4 = 1;
if mav4 < mav4[1] Then
T4 = -1;
Condition1 = T1 == 1 and T2 == 1 and T3 == 1 and T4 == 1;
Condition2 = T1 == -1 and T2 == -1 and T3 == -1 and T4 == -1;
if Condition1 == true and Condition1[1] == False Then
Buy();
if MarketPosition == 1 and Condition1 == False Then
ExitLong();
if Condition2 == true and Condition2[1] == False Then
Sell();
if MarketPosition == -1 and Condition2 == False Then
ExitShort();
즐거운 하루되세요
> 고박사122 님이 쓴 글입니다.
> 제목 : 수식작성 부탁드립니다.
> 안녕하세요. 운영자님
제가 이번에 부탁드릴 사항은
예를들어
신호 A : 5일선이 우상향 반전시 매수신호, 우하향 반전시 매도신호
신호 B : 5일선, 20일선이 모두 우상향 시 매수신호, 둘중 하나라도 우하향하면 청산
5일선, 20일선이 모두 우하향 시 매도신호, 둘중 하나라도 우상향하면 청산
신호 C : 5일선, 20일선, 60일선이 모두 우상향 시 매수신호, 셋중 하나라도 우하향하면
청산
5일선, 20일선, 60일선이 모두 우하향 시 매도신호, 셋중 하나라도 우상향하면
청산
신호 D : 5일선, 20일선, 60일선, 120일선이 모두 우상향 시 매수신호,
넷중 하나라도 우하향하면 청산
5일선, 20일선, 60일선, 120일선이 모두 우하향 시 매도신호,
넷중 하나라도 우상향하면 청산
이런식으로 원하는 이동평균선들을 선택만 하면 신호가 발생할 수 있도록 가능한지 문의 드립니다.