1.
Input : Period(12), Period1(5);
Var : value(0);
value = StochasticsK(Period,Period1);
# 매수/매도청산
If CrossUP(value, 20) Then
{
Buy();
}
# 매도/매수청산
If CrossDown(value, 80) Then
{
Sell();
}
2.
Input : Period(14), LPercent(30), SPercent(70);
Var : value(0);
value = RSI(Period);
# 매수/매도청산
If CrossUP(value, LPercent) Then
{
Buy();
}
# 매도/매수청산
If CrossDown(value, SPercent) Then
{
Sell();
}
1번은 스톡이고 2번은 rsi전략인데
이두개의 시스템을 하나로 묵고 싶습니다
두신호의 교집합 둘다 동일한 매수신호 구간에서 매수진입
어느 한쪽이 매도로 바뀌면 청산
두 신호가 매도 교집합 일때 매도 진입
어느 하쪽이 매수로 바뀌면 청산
이런 전략을 부탁드립니다
감사합니다
답변 1
예스스탁
예스스탁 답변
2022-07-18 14:59:25
안녕하세요
예스스탁입니다.
Input : stoPeriod(12), stoPeriod1(5);
Input : Period(14), LPercent(30), SPercent(70);
Var : stok(0),rsiv(0),T(0),S(0);
stok = StochasticsK(stoPeriod,stoPeriod1);
rsiv = RSI(Period);
If CrossUP(stok, 20) Then
T = 1;
If CrossDown(stok, 80) Then
T = -1;
If CrossUP(rsiv, LPercent) Then
S = 1;
If CrossDown(rsiv, SPercent) Then
S = -1;
Condition1 = T == 1 and S == 1;
Condition2 = T == -1 and S == -1;
if MarketPosition <= 0 and
Condition1 == true and Condition1[1] == False Then
Buy();
if MarketPosition == 1 and Condition1 == False Then
ExitLong();
if MarketPosition >= 0 and
Condition2 == true and Condition2[1] == False Then
Sell();
if MarketPosition == -1 and Condition2 == False Then
ExitShort();
즐거운 하루되세요
> cjfdk 님이 쓴 글입니다.
> 제목 : 문의드립니다
> 1.
Input : Period(12), Period1(5);
Var : value(0);
value = StochasticsK(Period,Period1);
# 매수/매도청산
If CrossUP(value, 20) Then
{
Buy();
}
# 매도/매수청산
If CrossDown(value, 80) Then
{
Sell();
}
2.
Input : Period(14), LPercent(30), SPercent(70);
Var : value(0);
value = RSI(Period);
# 매수/매도청산
If CrossUP(value, LPercent) Then
{
Buy();
}
# 매도/매수청산
If CrossDown(value, SPercent) Then
{
Sell();
}
1번은 스톡이고 2번은 rsi전략인데
이두개의 시스템을 하나로 묵고 싶습니다
두신호의 교집합 둘다 동일한 매수신호 구간에서 매수진입
어느 한쪽이 매도로 바뀌면 청산
두 신호가 매도 교집합 일때 매도 진입
어느 하쪽이 매수로 바뀌면 청산
이런 전략을 부탁드립니다
감사합니다