답변완료
수식문의 드립니다._( _ _)_
항상 도와주심에 감사드립니다. _(_ _)_만들어 본 아래의 두 수식이 제 뜻과는 다른 결과가 나온 것 같아서 같아서 문의 드립니다.1.수식var : ii(0),HO(0);var : Month(0), MOpen(0), 중심(0),PreMC(0), PreMO(0);var1 = ma(C,5);Var2 = ma(C,20);condition1 = CrossUp(var1,Var2) ; condition2 = CrossUp(C[1], 중심)or CrossUp(C[2], 중심) or CrossUp(C[3], 중심)or CrossUp(C, 중심) ; Month = Floor(date/100);if Month != Month[1] Then { PreMC = C[1]; PreMO = MOpen; MOpen = O ;}중심 = ((PreMC + PreMO)/2 + MOpen)/2;if HO > 0 and C > HO and Index <= ii+3 Then{ HO = 0; Find(1);}if condition1 == true and condition2 == true and c >= c[1] * 1.05 and c > o Then{ ii = Index; if C < O Then HO = O; Else HO = 0;}Else{ if ii > 0 and Index <= ii+3 Then { if C < O and (HO == 0 or (HO > 0 and O > HO)) Then HO = O; }}1수식은 0봉전에서 1~ 3봉내 최고음봉시가를 돌파하는 데 520골든크로스가 0봉전에서 3봉전까지 모든 봉에서 나올 수 있다 라는 내용이 포함이 되어야 합니다.2.수식var : ii(0),HO(0);var1 = ma(c,5);var2 = ma(c,20);var3 = ma(c,60);var4 = ma(c,120);var5 = ma(c,240);var6 = ma(c,480);Condition1 = var1 > Var2 and Var2 > Var3 and Var3 > Var4 and Var4 > Var5; if HO > 0 and C > HO and Index <= ii+5 Then{ HO = 0; Find(1);}if Index < 90 and CrossUp(h,VAR2) and C >O Then{ ii = Index; if C < O Then HO = O; Else HO = 0;}Else{ if ii > 0 and Index <= ii+5 Then { if C < O and (HO == 0 or (HO > 0 and O > HO)) Then HO = O; }}2.수식은 상장된지 90일이내 종목에 대해서 역시나 5봉전에서 20일선을 돌파하고 0봉전 에서 1~4봉중 최고 음봉시가를 돌파하는 검색식인데요검색이 안됩니다. 아마도 인덱스 내용이 겹쳐서 그런 듯도 하고요....수식에 문제가 있는 듯 한데 부탁 드립니다. _(_ _)_
답변완료
수식문의
아래는 며칠 전에 해주신 수식입니다.일목균형(9,24,49)의 선행스팬1(A), 선행스팬2(B)가5봉전 A<B, 4,3,2,1,0봉전 A>=B or4봉전 " , 3,2,1,0봉전 " or3봉전 " , 2,1,0봉전 " or2봉전 " , 1,0봉존 " or1봉전 " , 0봉전 " 조건하에서 0봉에 아래 수식에 의한 신호가 발생하는 종목검색을 위한 수식으로수정문의(수식추가)드립니다.======================================================var : AA(0),BB(0),MM(0), dis(0);dis = (O-ma(C,50))/ma(C,50)*100;AA=BollBandUp(17,2);BB=BollBandUp(40,2);MM=EnvelopeUp(20,2);if ((c>ma(h,5) and Crossup(AA,MM)) or(c>ma(h,5) and BB>MM and Crossup(AA,BB)) or(AA>BB and BB>MM and Crossup(C,AA)) or(Crossup(C,AA) and Crossup(C,BB) and Crossup(C,MM))) and(O/ma(c, 50) >= 0.9 and O/ma(c, 50) <= 1.1)ThenFind(1);
답변완료
수식 부탁 드림니다
안녕 하세요수식 문의 드립니다1. 고점_고가M= ma(H, period); // 고가HH= Highest(M, 봉수); // 5A = Valuewhen(1, HH>HH(1), HH)2. 고점_종가M= ma(C, period); // 종가HH= Highest(M, 봉수);A = Valuewhen(1, HH>HH(1), HH)3. 저점_저가M= ma(L,period);LL= Lowest(M, 봉수);A = Valuewhen(1, LL < LL(1), LL)4. 저점_종가M= ma(C,period);LL= Lowest(M, 봉수);A = Valuewhen(1, LL < LL(1), LL)5. M5ma(C, period1)6. M20ma(C, period2)7. GC & D/CCrossUp(M5, M20) or CrossDown(M5, M20)------------------------------------------------period = 1period1 = 5period2 = 20봉수 = 5----------------------------------------------챠트 표시에1.고점_고가 2.고점_종가3.저점_저가 4.저점_종가5.M5 6. M207. GC나타나게 해 주십시요항상 감사 합니다
답변완료
종목검색식 부탁드립니다
THMA지표가 UT BOT+LinReg 지표를 CROSSUP 하는 종목 부탁해요<THMA 지표>input : len_(40);input : volat(true);input : len_vol(15);input : color_u(Lime);input : color_d(Violet);var : source(0);var : trend(""),vv(0),i(0),k(0),vol(0),thma(0),thma1(0),clr(0);Array : volatility[1000](Nan),SR[1000](Nan);source = close;For i = 999 Downto 1{ volatility[i] = volatility[i-1];}volatility[0] = wma(2 * wma(high - low, len_vol / 2) - wma(high - low, len_vol), round(sqrt(len_vol),0));vv = PercentileArray(1,volatility, 1000);vol = volatility[0]/ vv;thma = wma(wma(source, len_ / 3) * 3 - wma(source, len_ / 2) - wma(source, len_), len_);thma1 = thma[2]; //한봉전 대비이면 [2]를 [1]로 변경IF thma > thma1 TheN clr = color_u;IF thma < thma1 TheN clr = color_d;Plot1(thma,"thma",clr);Plot2(thma+volatility[0],"상단",clr);Plot3(thma-volatility[0],"하단",clr);<UT BOT+LinReg 지표>// === 입력 변수 선언 ===Input: a_buy(2.0), // 매수 민감도 (배수) c_buy(1), // 매수 ATR 기간 a_sell(2.0), // 매도 민감도 (배수) c_sell(1), // 매도 ATR 기간 signal_length(7), // 신호 평활화 sma_signal(true), // 단순이동평균 사용 여부 lin_reg(true), // 선형회귀 사용 여부 linreg_length(11); // 선형회귀 길이// === 변수 선언 ===Vars: // UT Bot 매수 관련 변수 src_buy(0), atr_buy(0), nLoss_buy(0), trail_buy(0), ema_buy(0), above_buy(false), buy_signal_raw(false), buy_signal(false), // UT Bot 매도 관련 변수 src_sell(0), atr_sell(0), nLoss_sell(0), trail_sell(0), ema_sell(0), below_sell(false), sell_signal_raw(false), sell_signal(false), // LinReg 관련 변수 _bopen(0), _bhigh(0), _blow(0), _bclose(0), r(false), signal(0), // 텍스트 객체 buyText(0), sellText(0);// === UT Bot 매수 계산 ===src_buy = C; // 종가 사용atr_buy = ATR(c_buy); // ATR 계산nLoss_buy = a_buy * atr_buy; // 손실 기준값// 트레일링 스톱 계산 (매수용)if IsNan(trail_buy[1]) then{ trail_buy = src_buy - nLoss_buy;}else{ if src_buy > trail_buy[1] and src_buy[1] > trail_buy[1] then { trail_buy = iff(trail_buy[1] > src_buy - nLoss_buy, trail_buy[1], src_buy - nLoss_buy); } else if src_buy < trail_buy[1] and src_buy[1] < trail_buy[1] then { trail_buy = iff(trail_buy[1] < src_buy + nLoss_buy, trail_buy[1], src_buy + nLoss_buy); } else { trail_buy = iff(src_buy > trail_buy[1], src_buy - nLoss_buy, src_buy + nLoss_buy); }}ema_buy = EMA(src_buy, 1); // EMA 계산above_buy = CrossUp(ema_buy, trail_buy); // 상향 돌파 확인buy_signal_raw = src_buy > trail_buy and above_buy; // 원시 매수 신호buy_signal = buy_signal_raw; // 확정 매수 신호// === UT Bot 매도 계산 ===src_sell = C; // 종가 사용atr_sell = ATR(c_sell); // ATR 계산nLoss_sell = a_sell * atr_sell; // 손실 기준값// 트레일링 스톱 계산 (매도용)if IsNan(trail_sell[1]) then{ trail_sell = src_sell + nLoss_sell;}else{ if src_sell > trail_sell[1] and src_sell[1] > trail_sell[1] then { trail_sell = iff(trail_sell[1] > src_sell - nLoss_sell, trail_sell[1], src_sell - nLoss_sell); } else if src_sell < trail_sell[1] and src_sell[1] < trail_sell[1] then { trail_sell = iff(trail_sell[1] < src_sell + nLoss_sell, trail_sell[1], src_sell + nLoss_sell); } else { trail_sell = iff(src_sell > trail_sell[1], src_sell - nLoss_sell, src_sell + nLoss_sell); }}ema_sell = EMA(src_sell, 1); // EMA 계산below_sell = CrossDown(ema_sell, trail_sell); // EMA가 트레일 아래로 하향 돌파sell_signal_raw = src_sell < trail_sell and below_sell; // 원시 매도 신호sell_signal = sell_signal_raw; // 확정 매도 신호// === 신호 표시 ===if buy_signal then{ buyText = Text_New(sDate, sTime, L - 2*PriceScale, "▲"); Text_SetColor(buyText, red); Text_SetStyle(buyText, 1, 0); // 중앙 정렬, 상단}if sell_signal then{ sellText = Text_New(sDate, sTime, H + 2*PriceScale, "▼"); Text_SetColor(sellText,green ); Text_SetStyle(sellText, 1, 2); // 중앙 정렬, 하단}// === LinReg 계산 ===if lin_reg then{ _bopen = LinRegForecast(O, linreg_length, 0); // 선형회귀 시가 _bhigh = LinRegForecast(H, linreg_length, 0); // 선형회귀 고가 _blow = LinRegForecast(L, linreg_length, 0); // 선형회귀 저가 _bclose = LinRegForecast(C, linreg_length, 0); // 선형회귀 종가}else{ _bopen = O; // 실제 시가 _bhigh = H; // 실제 고가 _blow = L; // 실제 저가 _bclose = C; // 실제 종가}r = _bopen < _bclose; // 상승 캔들 여부 확인// 신호선 계산if sma_signal then{ signal = Ma(_bclose, signal_length); // 단순이동평균}else{ signal = EMA(_bclose, signal_length); // 지수이동평균}// === 출력 ===// LinReg 신호선 출력Plot1(signal, "LinReg Signal");