답변완료
수식 수정 바랍니다.
var : tx(0),hh(0,Data1),hh1(0,Data2),ll(0,Data1),ll1(0,Data2),count(0,data2),cnt(0,Data2);Array : TL[100](0,Data2),VV[100](0,Data2);if Data2(Bdate != Bdate[1]) Then{ hh = Data2(h); hh1 = hh[1]; ll = Data2(l); ll1 = ll[1]; count = 0; //이전일 삭제 For cnt = 0 to 99 { TL_Delete(TL[cnt]); }}if Data2(h) > hh[1] Then hh = data2(h);# Plot1(hh,"60분봉 고가");# Plot2(hh1,"주차트 이전고가");if data2(CrossDown(C,hh1)) Then{ For cnt = 99 downto 1 { tl[cnt] = tl[cnt-1]; } tl[0] = TL_New_Self(data2(sDate),data2(sTime),Data2(O),Data2(NextBarSdate),Data2(NextBarStime),Data2(O)); TL_SetColor(TL[0],Yellow); TL_SetExtRight(TL[0],true); }if Data2(l) < ll[1] Then ll = data2(l);# Plot3(ll,"60분봉 저가");# Plot4(ll1,"주차트 이전저가");if data2(CrossUp(C,ll1)) Then{ For cnt = 99 downto 1 { tl[cnt] = tl[cnt-1]; } tl[0] = TL_New_Self(data2(sDate),data2(sTime),Data2(O),Data2(NextBarSdate),Data2(NextBarStime),Data2(O)); TL_SetColor(TL[0],Red); TL_SetExtRight(TL[0],true); }위 수식대로 지표적용한바 첨부파일 처럼 알아볼수가 없게 표시되어 수정부탁드립니다.이전일의 지표가 같이 표시 됩니다.그리고 plot앞에 ' # ' 표시는 무슨 의미인가요? 지표속성 차트표시 탭에 아무것도 표시되지 않아서요.
TL_New_Self
TL_Delete
Data2
답변완료
문의드립니다
오류수정 부탁드립니다// ===== Bollinger Re-Entry with Trend Filter (Strategy) =====Inputs: Length(100), Mult(1.8), TrendLen(120), AllowShort(0); // 1=숏 허용, 0=롱만Vars: Basis(0), MeanSq(0), DevRaw(0), Dev(0), Upper(0), Lower(0), TrendMA(0), BuySig(false), SellSig(false);// --- 표준편차 수식 계산 ---Basis = Average(Close, Length);MeanSq = Average(Close * Close, Length);DevRaw = SquareRoot(MaxList(0, MeanSq - Basis * Basis));Dev = Mult * DevRaw;Upper = Basis + Dev;Lower = Basis - Dev;TrendMA = Average(Close, TrendLen);// --- 신호 ---BuySig = CrossUp(Close, Lower) and (Close > TrendMA);SellSig = CrossDown(Close, Upper) and (Close < TrendMA);// --- 주문(전략) ---// 롱 진입: 현재 포지션이 롱이 아닐 때만If BuySig and MarketPosition <> 1 Then Buy next bar at market;// 숏 모드If AllowShort = 1 Then begin // 숏 진입: 현재 포지션이 숏이 아닐 때만 If SellSig and MarketPosition <> -1 Then Short next bar at market;endElse begin // 롱만: 롱 보유 중 & 매도 신호면 청산 If MarketPosition = 1 and SellSig Then Sell next bar at market;end;
TS수식변환
답변완료
부탁드립니다
수고하십니다아래수식을 오류 없게 수정부탁드립니다Inputs: ChannelLength(150), // 채널 길이 ChannelWidth(1.5), // 채널 폭 ShowMidLine(true), // 50선 표시 RSILength(14), // RSI 길이 RSIOpacity(70), // RSI 선 투명도 (0~100) UpperThreshold(70), // Scale ShowThresholdLabels(true), // 기준선 라벨 표시 ShowSignalLine(true), // Signal Line 표시 SignalLength(14); // Signal 길이Variables: SumX(0), SumY(0), SumXSqr(0), SumXY(0), Slope(0), Intercept(0), RegStart(0), RegEnd(0), Deviation(0), UpperStart(0), UpperEnd(0), LowerStart(0), LowerEnd(0), RSIValue(0), SmaRSI(0), LowerThreshold(0), StepValue(0), SlopeValue(0), i(0), Val(0), Per(0), LowerVal(0), RSIPlotValue(0), SigPlotValue(0); // 로그 회귀 계산SumX = 0;SumY = 0;SumXSqr = 0;SumXY = 0;For i = 0 to ChannelLength - 1 Begin Val = Log(Close[i]); Per = i + 1; SumX = SumX + Per; SumY = SumY + Val; SumXSqr = SumXSqr + (Per * Per); SumXY = SumXY + (Val * Per);End;Slope = (ChannelLength * SumXY - SumX * SumY) / (ChannelLength * SumXSqr - SumX * SumX);Intercept = (SumY - Slope * SumX) / ChannelLength;// 회귀선 시작과 끝RegStart = ExpValue(Intercept + Slope * ChannelLength);RegEnd = ExpValue(Intercept);// 표준편차Deviation = StandardDev(Close, ChannelLength, 1);// 채널 상단/하단UpperStart = RegStart + Deviation * ChannelWidth;UpperEnd = RegEnd + Deviation * ChannelWidth;LowerStart = RegStart - Deviation * ChannelWidth;LowerEnd = RegEnd - Deviation * ChannelWidth;// RSI 계산RSIValue = RSI(Close, RSILength);SmaRSI = Average(RSIValue, SignalLength);// 스케일 계산LowerThreshold = 100 - UpperThreshold;SlopeValue = (RegStart - RegEnd) / ChannelLength;StepValue = (UpperEnd - LowerEnd) / (UpperThreshold - LowerThreshold);// RSI를 채널에 매핑LowerVal = LowerEnd + SlopeValue * 0;RSIPlotValue = LowerVal + StepValue * (RSIValue - LowerThreshold);SigPlotValue = LowerVal + StepValue * (SmaRSI - LowerThreshold);// 채널 라인 플롯Plot1(UpperEnd, "Upper Channel", RGB(167, 171, 185), default, 2);Plot2(LowerEnd, "Lower Channel", RGB(167, 171, 185), default, 2);// 중앙선 (옵션)If ShowMidLine Then Plot3(RegEnd, "Mid Line", Yellow, Dash, 1);// RSI 라인 플롯Plot4(RSIPlotValue, "RSI", RGB(161, 0, 182), default, 4);// Signal 라인 (옵션)If ShowSignalLine Then Plot5(SigPlotValue, "Signal", Red, default, 2);// 배경색 (옵션 - EasyLanguage는 제한적)// SetPlotBGColor 또는 Plot6-8을 활용하여 영역 표시 가능// 텍스트 표시 (옵션)If ShowThresholdLabels and BarNumber = CurrentBar Then Begin Value1 = Text_New(Date, Time, UpperEnd, " " + NumToStr(UpperThreshold, 2)); Value2 = Text_New(Date, Time, LowerEnd, " " + NumToStr(LowerThreshold, 2)); Value3 = Text_New(Date, Time, RSIPlotValue, " RSI: " + NumToStr(RSIValue, 2)); Text_SetColor(Value1, White); Text_SetColor(Value2, White); Text_SetColor(Value3, White);End;
RSI채널
Text_new
2025-10-19
116
글번호 227020
지표