커뮤니티
문의드립니다
2026-02-06 14:10:51
195
글번호 230404
수고하십니다.
Input : shortPeriod(12), longPeriod(26), Period(9);
Inputs: RSILength(10), OverSold(30),OverBought(100);
Var : MACD1(0,Data1),MACD2(0,Data2),R(0,Data1);
MACD1 = data1(MACD(shortPeriod, longPeriod));
MACD2 = data2(MACD(shortPeriod, longPeriod));
R = Data1(RSI(RSILength));
If MACD2 > 0 and Crossup(R, OverSold) Then
Buy ("RSI");
if CrossUp(MACD2,0) Then
Buy ();
if MarketPosition == 1 Then
{
if CrossDown(MACD2,0)or Crossup(R, OverBought) Then
Sell("S");
}
1. 여기서매도식만 고치는 것 부탁드립니다.
2. data1 rsi oscillator 매도신호시50%만 매도 or data2 macd 0하향돌파시 data1 모두매도
3. 총현재잔액이 5% 상승시 5%매도 . 또 현재잔액이 5%상승시 5%매도..or data2 macd0 하향돌파시 data1모두매도
답변 1
예스스탁 예스스탁 답변
2026-02-06 17:37:07
안녕하세요
예스스탁입니다.
분할로 청산하므로 청산함수로 변경해 작성해 드립니다.
Input : shortPeriod(12), longPeriod(26), Period(9);
Inputs: RSILength(10), OverSold(30),OverBought(100);
Var : MACD1(0,Data1),MACD2(0,Data2),R(0,Data1);
MACD1 = data1(MACD(shortPeriod, longPeriod));
MACD2 = data2(MACD(shortPeriod, longPeriod));
R = Data1(RSI(RSILength));
If MACD2 > 0 and Crossup(R, OverSold) Then
Buy ("RSI");
if CrossUp(MACD2,0) Then
Buy ();
if MarketPosition == 1 Then
{
if Crossup(R, OverBought) Then
ExitLong("x1",OnClose,Def,"",Floor(MaxContracts*0.5),1);
if CrossDown(MACD2,0) Then
ExitLong("x2");
if CurrentContracts == MaxContracts Then
ExitLong("bx1",AtLimit,EntryPrice*1.05,"",Floor(MaxContracts*0.05),1);
Else
ExitLong("bx2",AtLimit,LatestExitPrice(0)*1.05,"",Floor(MaxContracts*0.05),1);
}
즐거운 하루되세요
다음글
이전글