답변완료
문의 드립니다.
input : length(22); input : mult(3.0); input : useClose(1);#1:종가, 0:고가/저가 var : alpha(0),atrv(0),a(0); var : longStop(0),longStopPrev(0),shortStop(0),shortStopPrev(0),dir(1); var : Buysignal(False),Sellsignal(False); alpha = 1 / length ; atrv = IFf(IsNan(ATRV[1]) == true, ma(TrueRange,length) , alpha * TrueRange + (1 - alpha) * IFf(isnan(ATRV[1])==true,0,ATRV[1])); a = mult * atrv; longStop = IFF(useClose == 1,highest(close, length), highest(H,length)) - a; longStopPrev = iff(isnan(longStop[1])==true, longStop,longStop[1]); longStop = iff(close[1] > longStopPrev , max(longStop, longStopPrev) , longStop); shortStop = IFF(useClose == 1,lowest(close, length), lowest(L,length)) + a; shortStopPrev = iff(IsNan(shortStop[1])==true, shortStop[1], shortStop); shortStop = iff(close[1] < shortStopPrev , min(shortStop, shortStopPrev) , shortStop); dir = iff(close > shortStopPrev , 1 , iff(close < longStopPrev , -1 , dir)); buySignal = dir == 1 and dir[1] == -1; sellSignal = dir == -1 and dir[1] == 1; if buySignal == true Then Buy("Buy"); if sellSignal == true Then Sell("Sell");위 시스템 수식을 지표 수식으로 만들어주세요.
ChandelierExit
샹들리에청산
답변완료
부탁드립니다
다음 키움 지표식을 YT로 변환하고 싶습니다. 미리 감사드립니다.수식1: 대세라인a=bbandsup(17,2);b=bbandsup(60,2);valuewhen(1,crossup(a,b)&&C>b,b)수식2: 급등라인a=bbandsup(17,2);b=bbandsup(30,1.8);valuewhen(1,crossup(a,b)&&C>b,b)수식3: 맥점라인a=avg(c,5); b=avg(c,20); d=avg(c,25); e=avg(c,60); valuewhen(1,crossup(C,a) &&crossup(C,b) &&crossup(C,d) &&C>e, C)
답변완료
시스템
Inputs: ATRlen(14), ADXlen(14), RSIlen(14), ADXthWeak(20);
Vars: ATRv(0), ADXv(0), RSIv(0), HTF_MA_Short(0),
HTF_MA_Long(0), HTF_ADX(0), HTF_RangeMode(False);
/*-----------------------------------------------------------------------
① 보조지표 계산
-----------------------------------------------------------------------*/
ATRv = Average(TrueRange(), ATRlen);
ADXv = ADX(ADXlen);
RSIv = RSI(Close, RSIlen);
/*-----------------------------------------------------------------------
② 상위 타임프레임 필터 (비추세 감지)
-----------------------------------------------------------------------*/
If DataNum > 1 Then
Begin
HTF_MA_Short = AverageFC(Close of Data2, 20);
HTF_MA_Long = AverageFC(Close of Data2, 50);
HTF_ADX = ADX(ADXlen) of Data2;
{ 비추세 조건: MA20과 MA50 차이 작고 ADX < 20 }
HTF_RangeMode = (AbsValue(HTF_MA_Short - HTF_MA_Long) < Average(TrueRange of Data2, 20)) and
(HTF_ADX < ADXthWeak);
End;
/*-----------------------------------------------------------------------
③ 진입 조건 (횡보장 전용)
-----------------------------------------------------------------------*/
If HTF_RangeMode Then
Begin
{ RSI 과매도 -> 매수 }
If RSIv < 30 Then
Buy("Range_Buy") Next Bar at Market;
{ RSI 과매수 -> 매도 }
If RSIv > 70 Then
SellShort("Range_Sell") Next Bar at Market;
End;
/*-----------------------------------------------------------------------
④ 청산 (단기 목표 또는 손절)
-----------------------------------------------------------------------*/
If MarketPosition = 1 Then
Begin
ExitLong("TakeProfit_Long") At Limit EntryPrice + ATRv * 1.0;
ExitLong("Stop_Long") AtStop EntryPrice - ATRv * 1.5;
End;
If MarketPosition = -1 Then
Begin
ExitShort("TakeProfit_Short") At Limit EntryPrice - ATRv * 1.0;
ExitShort("Stop_Short") AtStop EntryPrice + ATRv * 1.5;
End;