답변완료
시스템 변수 수정요청
아래의 식에서 진입은 매수신호에만 가능하고, 매도신호시 청산만 가능하도록 수정부탁드립니다.Inputs: TurnLen(9), PrdLen1(26); if PrdLen1 >= TurnLen*2 Then{ value1 = (Highest(High, TurnLen) + Lowest(Low, TurnLen)) / 2; //전환 Value2 = (Highest(High, PrdLen1) + Lowest(Low, PrdLen1)) / 2; //기준 If crossup(value1,Value2) Then { Buy ("LE") ; } If crossdown(value1,Value2) Then { Sell ("SE"); }}
답변완료
수식 부탁 드립니다
안녕하십니까?수식 부탁 드립니다1.MidMid = BBandsC(period, D1); Valuewhen(1, CrossUp(C, Mid), Low)2.UpUp = BBandsUp(period, D1);Valuewhen(1, CrossUp(C, Up), Low)3.DnDn = BBandsDown(period, D1);Valuewhen(1, CrossUp(C, Dn), Low)=====[ 분리 ] ================4. 5일선5. 20일선6. 5일선과 20일선_G/C선7. 5일선_고점8. 5일선_저점9. 20일선_고점10. 20일선_저점--------------------------------------------항상 감사 합니다
vwap이 없어서 m/v로 구현했는데 이게 그냥 종가 같습니다. 맞는지 확인부탁드립니다.
안녕하세요? 고생이 많으셔요.vwap지표를 활용하고 싶은데, 차트 내장 지표에 없어서, 나름대로 m/v로 구해서 사용하는데,알고보니까 m=c*v 라서 결국 m/v는 c(종가)가 되었습니다.저는 거래대금이 각 시간별 체결된 금액과 거래량을 곱한 것을 누적한 것인 줄 알았는데, 그게 아니었다는 것을 방금 알게 되었습니다.그래서 차트에서 확인해 보기 위해서 지표로 아래와 같이 만들어보니 Plot1(m/v, "m/v");plot2(c, "c");두 개가 거의 비슷하지만 또 약간은 다릅니다.m/v=c 인가요?며칠을 거래량과 거래대금을 알기 위해서 공부했는데, 정신이 멍 합니다.혹시 해결책이나 활용방법이 있는지 팁을 알려주시면 감사하겠습니다.감사합니다.
답변완료
아래 내용 수정 부탁합니다. 실행이 안됩니다
// ─────────────────────────────────────────────// 고변동성 최적화 버전 (SMA20 / RSI5)// 1차 진입 → 실패 시 역추세 마틴 진입(2배)// ─────────────────────────────────────────────// 사용자 설정값input : P(20); // SMA 기간input : RSIlen(5); // RSI 기간input : StopPoint(1.0); // 기본 손절 1.0ptinput : TakePoint(1.0); // 기본 익절 1.0pt// 변수 선언var : sma20(0), rsi5(0), atr14(0);var : longCond(false), shortCond(false);var : entryPrice(0), martin(false);// ─────────────────────────────// 계산식// ─────────────────────────────sma20 = average(Close, P);rsi5 = RSI(Close, RSIlen);atr14 = AvgTrueRange(14);// ─────────────────────────────// 변동성 필터 (전일 대비 40%↑)// ─────────────────────────────if (atr14 > atr14[1] * 1.40) then begin // 변동성 과다 → 트레이딩 중단 longCond = false; shortCond = false;endelse begin // 정상 구간에서만 신호 활성화 // ───────────────────────────── // 1차 진입 조건 // ───────────────────────────── // 상승 매수 조건 longCond = (Close > sma20) and (Close > Highest(High, 3)[1]) and // 직전 3봉 고점 돌파 종가 기준 (rsi5 > 45 and rsi5 < 70); // RSI 중립 구간 진입 시만 // 하락 매도 조건 shortCond = (Close < sma20) and (Close < Lowest(Low, 3)[1]) and // 직전 3봉 저점 돌파 (rsi5 < 55 and rsi5 > 30);end;// ─────────────────────────────// 1차 진입 로직// ─────────────────────────────if (marketposition = 0 and not martin) then begin if longCond then begin buy(1) next bar at market; entryPrice = Close; end; if shortCond then begin sellshort(1) next bar at market; entryPrice = Close; end;end;// ─────────────────────────────// 1차 손절·익절// 손절폭은 변동성 장 대응으로 1.8배// ─────────────────────────────if (marketposition = 1 and not martin) then begin sell("1_LS") next bar at entryPrice - StopPoint*1.8 stop; sell("1_LTP") next bar at entryPrice + TakePoint limit;end;if (marketposition = -1 and not martin) then begin buytocover("1_SS") next bar at entryPrice + StopPoint*1.8 stop; buytocover("1_STP") next bar at entryPrice - TakePoint limit;end;// ─────────────────────────────// 1차 손절 후 2차 (마틴) 역추세 진입// RSI 반전 + 반대방향 돌파 조합// ─────────────────────────────if (marketposition = 0 and martin = false) then begin // 1차가 매수였을 경우 → 매도 마틴 if (Close < entryPrice - StopPoint*1.8) and (rsi5 < 50) then begin sellshort(2) next bar at market; martin = true; entryPrice = Close; end; // 1차가 매도였을 경우 → 매수 마틴 if (Close > entryPrice + StopPoint*1.8) and (rsi5 > 50) then begin buy(2) next bar at market; martin = true; entryPrice = Close; end;end;// ─────────────────────────────// 2차 마틴 손절·익절 (손절폭 2.2배)// 수량은 2배 진입이므로 리스크 관리 주의// ─────────────────────────────if (marketposition = 1 and martin) then begin sell("2_LS") next bar at entryPrice - StopPoint*2.2 stop; sell("2_LTP") next bar at entryPrice + TakePoint limit;end;if (marketposition = -1 and martin) then begin buytocover("2_SS") next bar at entryPrice + StopPoint*2.2 stop; buytocover("2_STP") next bar at entryPrice - TakePoint limit;end;// ─────────────────────────────// 포지션 종료 시 마틴 초기화// ─────────────────────────────if (marketposition = 0) then martin = false;
답변완료
종목검색식 요청드립니다.
당일 10분봉에서 아래 키움신호가 발생한 모든 종목을 검색하는 검색식을 만들고 싶습니다. 도움 부탁드립니다. 가능하다면 일별로 조회가능하도록 해주시면 감사하겠습니다. (예시 : N(당일), N-1(1일전), N-2(2일전) 등) 아니면 N봉이내 10분봉에서 아래신호가 발생한 모든 종목을 검색하는 검색식으로 해도 괜찮습니다.* 키움신호수식 a = ma(c, 60); b = (a + avgif(c - a, -1, 0.0) - 2 * stdevif(c - a, -1, 0.0)); d = (b * k); crossup(c, d)