항상 감사드립니다.
현재 아래의 수식은 진입이 항상 매수만 되는 수식인데,
매도도 진입가능한 (매수/매도 모두 진입가능한) 수식으로 바꿔주시면 감사드리겠습니다.
Input : 매수장기이평길이(200), 매수단기이평길이(10), 매수RSI길이(2), 매수RSI기준(5), 매도이평(10), 매도RSI길이(2), 매도RSI기준(75);
Var : longCondition(False), exitCondition(False);
longCondition = ma(close, 매수장기이평길이) < close and ma(close, 매수단기이평길이) > Close and rsi(매수RSI길이) < 매수RSI기준;
exitCondition = ma(close, 매도이평) < Close and rsi(매도RSI길이) > 매도RSI기준;
if longCondition Then
{
Buy("매수", AtMarket);
}
if exitCondition Then
{
Exitlong("매도", AtMarket);
}
답변 1
예스스탁
예스스탁 답변
2023-03-24 16:27:24
안녕하세요
예스스탁입니다.
Exitlong을 sell로 변경하시면 됩니다.
Input : 매수장기이평길이(200), 매수단기이평길이(10), 매수RSI길이(2), 매수RSI기준(5), 매도이평(10), 매도RSI길이(2), 매도RSI기준(75);
Var : longCondition(False), exitCondition(False);
longCondition = ma(close, 매수장기이평길이) < close and ma(close, 매수단기이평길이) > Close and rsi(매수RSI길이) < 매수RSI기준;
exitCondition = ma(close, 매도이평) < Close and rsi(매도RSI길이) > 매도RSI기준;
if longCondition Then
{
Buy("매수", AtMarket);
}
if exitCondition Then
{
Sell("매도", AtMarket);
}
즐거운 하루되세요
> 행복곰 님이 쓴 글입니다.
> 제목 : 수식 문의 드립니다
> 항상 감사드립니다.
현재 아래의 수식은 진입이 항상 매수만 되는 수식인데,
매도도 진입가능한 (매수/매도 모두 진입가능한) 수식으로 바꿔주시면 감사드리겠습니다.
Input : 매수장기이평길이(200), 매수단기이평길이(10), 매수RSI길이(2), 매수RSI기준(5), 매도이평(10), 매도RSI길이(2), 매도RSI기준(75);
Var : longCondition(False), exitCondition(False);
longCondition = ma(close, 매수장기이평길이) < close and ma(close, 매수단기이평길이) > Close and rsi(매수RSI길이) < 매수RSI기준;
exitCondition = ma(close, 매도이평) < Close and rsi(매도RSI길이) > 매도RSI기준;
if longCondition Then
{
Buy("매수", AtMarket);
}
if exitCondition Then
{
Exitlong("매도", AtMarket);
}