답변완료
수고하십니다
항상 좋은 일만 있으시기 바랍니다Raff-Regression-Channel지표 x축을psar현재구간 +직전구간 +전전구간 +전전전구간4구간을 기준으로 적용 되어 나오게요청 합니다아래수식은 음의구간만 나오는데 양의구간도 나오게 수정 요청합니다Input : af(0.02), maxAF(0.2);var : t(0),tl(0),tl1(0),tl2(0),tl3(0),tl4(0),tl5(0),tl6(0),tl7(0),tl8(0),tl9(0) ,tx1(0),tx2(0),color(0);var : hh(0),hd(0),ht(0),hh1(0),tl11(0);var : ll(0),ld(0),lt(0),ll1(0),tl22(0);var1 = SAR(af,maxAF);if CrossUp(C,var1) Then{ T = 1; hh = h; hh1 = hh[1]; hd = sDate; ht = sTime; if ll > 0 Then { tl1 = TL_New(hd,ht,hh,NextBarSdate,NextBarStime,hh); tl2 = TL_New(hd,ht,hh/1.01,NextBarSdate,NextBarStime,hh/1.01); tl3 = TL_New(hd,ht,hh/1.02,NextBarSdate,NextBarStime,hh/1.02); tl11 = tl1[1]; TL_SetEnd(tl11,Sdate[1],Stime[1],hh1); Text_SetStyle(tx1,2,1); if hh1 == 0 or (hh1 > 0 and hh > hh1) Then color = Red; }}else if CrossDown(C,var1) Then{ T = -1; ll = l; ll1 = ll[1]; ld = sDate; lt = sTime; if hh > 0 Then { }}Else{ if t == 1 then { if h > hh Then { hh = h; hd = sDate; ht = sTime; TL_SetEnd(tl,hd,ht,hh); TL_SetBegin(tl1,hd,ht,hh); TL_SetBegin(tl2,hd,ht,hh/1.01); TL_SetBegin(tl3,hd,ht,hh/1.02); Text_SetLocation(tx1,sDate,sTime,hh); if (hh1 > 0 and hh > hh1) Then color = Red; } } if t == -1 then { if l < ll Then { ll = l; ld = sDate; lt = sTime; } }}TL_SetEnd(tl1,NextBarSdate,NextBarStime,hh);TL_SetEnd(tl2,NextBarSdate,NextBarStime,hh/1.01);TL_SetEnd(tl3,NextBarSdate,NextBarStime,hh/1.02);
2026-01-12
353
글번호 229709
지표
답변완료
문의드립니다.
아래 식은 두가지 경우 입니다.코인에서 사용하고자 합니다.두가지 모두 금액을 입력하여 매수 할 수 있도록 추가 부탁드립니다. (피라미딩 방식으로 매수하려고 합니다.)청산은 제가 직접 할 것입니다.부탁드립니다^.^Input : Period(14), sigPeriod(9);var : TRIXv(0),TRIXs(0);TRIXv = TRIX(Period);TRIXs = ema(TRIXv,sigPeriod);if CrossUp(TRIXv,TRIXs) and TRIXv < 0 Then Buy("B",OnClose,def);----------------------------------------------------------Input : Period(14), sigPeriod(9),BBP(20),DV(1);var : TRIXv(0),TRIXs(0),BBdn(0);TRIXv = TRIX(Period);TRIXs = ema(TRIXv,sigPeriod);BBdn = BollBandDown(BBP,dv);if L <= BBdn and CrossUp(TRIXv,TRIXs) and TRIXv < 0 Then Buy("B",OnClose,def);
2026-01-11
144
글번호 229706
시스템
답변완료
지표변환 부탁드립니다.
// This Pine Script® code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/// © MisinkoMaster//@version=6indicator("Extreme HMA ATR Bands", "EHA Bands | MisinkoMaster", overlay =true, behind_chart = false)////////////////////////////////////////////////////////////////////////////////////////////////////////Import Librariesimport TradingView/ta/12////////////////////////////////////////////////////////////////////////////////////////////////////////Get User Defined Inputslen = input.int(33, "Length")src = input.source(close, "Source")atr_len = input.int(30, "ATR Length")atr_mul = input.float(0.7, title = "ATR Multiplier", step = 0.05)////////////////////////////////////////////////////////////////////////////////////////////////////////Calculationssqrtlen = math.round(math.sqrt(len))halflen = math.round(len/2)hma = ta.ema(src, sqrtlen)h = ta.highest(hma, len)l = ta.lowest(hma, len)hh = ta.lowest(h, halflen)ll = ta.highest(l, halflen)hhh = ta.lowest(hh, sqrtlen)lll = ta.highest(ll, sqrtlen)mid = (hh+ll)/2atr = ta.atr(atr_len)*atr_mulUpper = mid+atrLower = mid-atr////////////////////////////////////////////////////////////////////////////////////////////////////////Trend Logicvar trend = 0L = src > UpperS = src < Lowerif L trend := 1if S trend := -1////////////////////////////////////////////////////////////////////////////////////////////////////////Plottingvar col = color.rgb(81, 81, 81)var colT = color.rgb(81, 81, 81, 50)if L col := color.rgb(0, 217, 197) colT := color.rgb(0, 217, 197, 50)if S col := color.rgb(217, 0, 197) colT := color.rgb(217, 0, 197, 50)up = plot(Upper, "Upper", col, 2)lp = plot(Lower, "Lower", col, 2)mp = plot(mid, "Base Line", color = col, linewidth = 2, linestyle = plot.linestyle_dashed)fill(up, lp, colT)plotcandle(open, high, low, close, color = col, wickcolor = col, bordercolor = col, display = display.pane)
2026-01-11
1056
글번호 229704
지표
답변완료
시스템식에서 실 계좌 정보를 불러 오는것이 가능하나요?
시스템 트레이딩에서 실계좌 포지션 동기화 방법에 대해 알고 싶습니다. 시스템식에서 사용하는 marketposition은 시스템 트레이딩에 의해 진입 청산된 경우에만 적용되는 것으로 알고 있는데.. 예를들어 시스템식에 의해 매수 진입을 했을 경우,,시스템이 자동청산으로 청산을 하지 않은 상황에서 내가 수동으로 매수청산을 한경우, marketposition은 계속 시스템에 의해 매수진입한 marketposition == 1 인 상태로 남아 있을 것인데,, 실 계좌에서는 내가 이미 수동으로 처리를 했기 때문에 실 계좌의 position은 0 을 나타내고 있읍니다. 이러케 시스템에 의한 규칙과 실계좌가 불일치할 경우, 어떠한 방식으로 포지션을 동기화 할수가 있나요? (포지션 동기화는 시스템의 marketposition을 실계좌의 포지션에 일치시켜야 됨) .. 내가 알기로는 지표식에서는 가능한 것으로 알고는 있는데,, 예를들어 if 계좌정보표시 == 1 then begin RealAvgPrice = GetPositionAveragePrice(SymbolCode, 실계좌번호, 0); SellQty = GetPositionQuantity(SymbolCode, 실계좌번호, 1); BuyQty = GetPositionQuantity(SymbolCode, 실계좌번호, 2); // [핵심] 처음 진입했을 때(수량이 0이다가 생겼을 때)의 시간을 기록 if (SellQty > 0 or BuyQty > 0) then begin if EntryTime == 0 then // 아직 기록 전이라면 (진입 첫 봉) begin EntryTime = sTime; EntryDate = sDate; end; end else // 수량이 없으면 초기화 begin EntryTime = 0; EntryDate = 0; end; 이런식으로 해서 실계좌 정보를 읽어 올수가 있는데,, 시스템식에서도 동일 명령어로 읽어온후 시스템식의 marketposition과 차이가 발생시 어떠한 방식으로 동기화 시킬수 있는지를 알고 싶습니다.
2026-01-11
345
글번호 229702
시스템
답변완료
종목검색식 부탁드립니다
요일M = floor(D/100)%100;YY = if((M+1-1) == 1 or (M+1-1) == 2, floor(D/10000)-1,floor(D/10000));YA= floor(YY/100);YB=YY%100;MM = if((M+1-1) == 1, 13, if((M+1-1) == 2, 14, M));DD=D%100;A=(DD + floor(13*(MM+1)/5)+YB+ floor(YB/4)+floor(YA/4)+YA*5)%7;if(A==0, 6, A-1)이전주종가A=요일(DATE);Valuewhen(n, A(1)>A, C(1))수식1A1=C-이전주종가(1);A2=이전주종가(1)-이전주종가(2);A3=이전주종가(2)-이전주종가(3);A4=이전주종가(3)-이전주종가(4);A5=이전주종가(4)-이전주종가(5);A6=이전주종가(5)-이전주종가(6);A7=이전주종가(6)-이전주종가(7);A8=이전주종가(7)-이전주종가(8);A9=이전주종가(8)-이전주종가(9);수식2A10=이전주종가(9)-이전주종가(10);A11=이전주종가(10)-이전주종가(11);A12=이전주종가(11)-이전주종가(12);A13=이전주종가(12)-이전주종가(13);A14=이전주종가(13)-이전주종가(14);sumA=if(A1>0,A1,0)+if(A2>0,A2,0)+if(A3>0,A3,0)+if(A4>0,A4,0)+if(A5>0,A5,0)+if(A6>0,A6,0)+if(A7>0,A7,0)+if(A8>0,A8,0)+if(A9>0,A9,0)+if(A10>0,A10,0)+if(A11>0,A11,0)+if(A12>0,A12,0)+if(A13>0,A13,0)+if(A14>0,A14,0);수식3sumB=abs(A1)+abs(A2)+abs(A3)+abs(A4)+abs(A5)+abs(A6)+abs(A7)+abs(A8)+abs(A9)+abs(A10)+abs(A11)+abs(A12)+abs(A13)+abs(A14);sumA/sumB*100수식4(약세)A=sumA/sumB*100;IF(A<=50,1, 0)수식4(약세 )구간에 있는 종목검색식 부탁드립니다
2026-01-10
327
글번호 229700
종목검색