커뮤니티

예스랭귀지 Q&A

글쓰기
답변완료

지표수식 전환부탁

다음 수식을 시스템트레이딩 수식전환부탁드립니다. //Begin study("Didi Index Exponencial") short = 3, mid = 8, long = 20 DidiLonga = ema(close, long) - ema(close, mid) DidiCurta = ema(close, short) - ema(close, mid) plot(DidiLonga, color=#ff0000) plot(DidiCurta, color=#009900) plot(0) //End
프로필 이미지
이대표
2020-01-29
260
글번호 135462
지표
답변완료

예스트레이더 수식으로 전환 문의드립니다.

study("T3 MTF", overlay=true) res = input(title="Time Frame", type=resolution, defval="D") T3FiboLine = input(false, title="Show T3 Fibonacci Ratio Line?") length1 = input(8, "T3 Length") a1 = input(0.7, "Volume Factor") e1=ema((high + low + 2*close)/4, length1) e2=ema(e1,length1) e3=ema(e2,length1) e4=ema(e3,length1) e5=ema(e4,length1) e6=ema(e5,length1) c1=-a1*a1*a1 c2=3*a1*a1+3*a1*a1*a1 c3=-6*a1*a1-3*a1-3*a1*a1*a1 c4=1+3*a1+a1*a1*a1+3*a1*a1 T3=c1*e6+c2*e5+c3*e4+c4*e3 T3k = security(tickerid, res, T3) plot(T3k, color=red, linewidth=3, title="T3") length12 = input(5, "T3 Length fibo") a12 = input(0.618, "Volume Factor fibo") e12=ema((high + low + 2*close)/4, length12) e22=ema(e12,length12) e32=ema(e22,length12) e42=ema(e32,length12) e52=ema(e42,length12) e62=ema(e52,length12) c12=-a12*a12*a12 c22=3*a12*a12+3*a12*a12*a12 c32=-6*a12*a12-3*a12-3*a12*a12*a12 c42=1+3*a12+a12*a12*a12+3*a12*a12 T32=c12*e62+c22*e52+c32*e42+c42*e32 T32k = security(tickerid, res, T32) plot(T3FiboLine and T32k ? T32k : na, color=blue, linewidth=2, title="T3fibo") multi timeframe으로 가능할지 문의드립니다. 좋은 하루되세요 감사합니다.
프로필 이미지
로즈버드
2020-01-29
239
글번호 135461
지표
답변완료

65783번 재문의드렸습니다(냉무)

한번만더 봐주시기바랍니다
프로필 이미지
유로파54
2020-01-29
168
글번호 135458
지표
답변완료

질문드립니다.

명절 잘 보내셨는지요.. 항상 도움주셔서 감사드리며 질문드립니다. 하나. 분봉에서 countif(condition5,20)로 조건삽입하면 전일에 이어서 결과가 나옵니다. coundition5를 초기화 해도 안돼네요.. 초기화 방법좀 부탁합니다. 둘. 분봉에서 오늘일짜를 (조건만족시)저장해서 몇일후 불러서 사용하는 방법. 예) 삼일전 조건만족 && 조건A && ... 셋. SetStopLoss,SetStopEndofDay, SetStopTrailing...등 주문함수를 조건별로 아래와 같은 형식의 결과값을 원하면 가능한 함수가 어떤함수가 있나요..(주 문함수중에) 아니면 모든함수를 풀어서 사용해야 되나요.. if 조건 then{ SetStopLoss(3,Percent); SetStopTrailing((30,10); } Else if 조건 then{ SetStopLoss(5,Percent); SetStopTrailing((30,15); }
프로필 이미지
다낚아
2020-01-29
188
글번호 135455
시스템

byheekim 님에 의해서 삭제되었습니다.

프로필 이미지
byheekim
2020-01-28
0
글번호 135454
지표
답변완료

시스템식 부탁드립니다.

항상 도움 주셔서 감사합니다. 아래의 Easy Language Code 코드를 예스랭귀지로 변환 부탁드립니다. 감사합니다. #---------------- # 요청 시스템1 #---------------- Inputs: TradeUnit(100), Band1(0), // Should be between 0 and 1 Band2(0), // Should be between 0 and 1 ExitBand(0); // Should be between 0 and .5 Variables: Support(0), Resistance(0); If CurrentBar = 1 then Begin Support = C; Resistance = C; End; If time >= 930 and time <= 1000 then begin If Close > Resistance then begin Resistance = Close; End; If Close < Support then begin Support = Close; End; End; #----------- If time > 1000 and time < 1500 then begin #----------- { Long Entry } If Close <= (Resistance + Band1) and Close >= (Resistance - Band2) and Close > Close[1] and marketposition = 0 then begin Buy TradeUnit shares next bar market; End; { Long Exit } If marketposition = 1 and marketposition = marketposition(1) then begin Sell TradeUnit shares next bar at (Close - ExitBand) stop; End; { Long Money Management } If marketposition = 1 and (Close - EntryPrice)*TradeUnit <= -75 then begin Sell TradeUnit shares next bar market; End; { Short Entry } If Close <= (Support + Band2) and Close >= (Support - Band1) and Close < Close[1] and marketposition = 0 then begin Sell short TradeUnit shares next bar market; End; { Short Exit } If marketposition = -1 and marketposition = marketposition(1) then begin Buy to cover TradeUnit shares next bar at (Close + ExitBand) stop; End; { Short Money Management } If marketposition = -1 and (EntryPrice - Close)*TradeUnit <= -75 then begin Buy to Cover TradeUnit shares next bar market; End; #----------- End; #----------- If time >= 1530 then begin If marketposition = 1 then begin Sell TradeUnit shares next bar market; End; If marketposition = -1 then begin Buy to Cover TradeUnit shares next bar market; End; End; #---------------- # 요청 시스템2 # Long-Only Strategy #---------------- Input: InitialBalance(100000), // The account size at start of trading NDay(20) // How many days long is this systems basis (20 or 55 day) ; Variables: N(0), // Underlying volatility of the stock DPP(Close), // Dollar per price of the stock StopLoss(0), // Stop loss value DollarRisk(0), // Dollar risk value T radeUnit(100), // How much to trade based on idea that 1N represents 1% of account equity UnitsHeld(0), // How many units are currently held NotationalAccount(10000), // Notational Account, hard coded for testing purposes LastAccount(0), // Last account size to reevaluate drawdown Stop_On(False), // Stop loss boolean Fast_Ave ( 0 ) , // Fast moving average value Slow_Ave ( 0 ) , // Slow moving average value Cross_Over (False); // Simple cross-over filter ; { Set-up } Cross_Over = False; Fast_Ave = Xaverage ( Close , 50 ) ; Slow_Ave = Xaverage ( Close , 200 ) ; If Fast_Ave > Slow_Ave and Slow_Ave > Slow_Ave [ 1 ] Then Cross_Over = True; { Position Sizing } N = VolatilityStdDev(NDay); DPP = Close; // Price of the stock is equal to its close DollarRisk = NotationalAccount * 0.01; TradeUnit = IntPortion(DollarRisk/(N*DPP)); StopLoss = 2 * N; // Decrease the size of the notational account if 10% drawdown If NotationalAccount < (LastAccount * 0.9) Then Begin NotationalAccount = NotationalAccount * 0.8; Print(File("c: urtle_notational.txt"), NotationalAccount); End Else Begin LastAccount = NotationalAccount; End; { Entry } // Do not even consider a trade if too many units are on the line If UnitsHeld < 12 then Begin // Enter if price exceeds by a single tick high of the preceding NDays) If Close > HighD(NDay) and Cross_Over then Begin If marketposition = 0 then begin Buy ("Long") TradeUnit shares next bar market; UnitsHeld = UnitsHeld + TradeUnit; End; If marketposition = 1 then begin Buy ("Long more") (TradeUnit / 2) shares next bar market; UnitsHeld = UnitsHeld + (TradeUnit / 2); End; End; End; { Stop } if ( Close - EntryPrice ) > StopLoss then begin Stop_On = True; End Else begin Stop_On = False; End; { Exit} If Close < LowD(NDay/2) and Stop_On then begin Sell ("Long Exit") currentshares shares next bar market; UnitsHeld = 0; End; #---------------- # 요청 시스템2 # Long-Only Strategy #---------------- Input: InitialBalance(100000), // The account size at start of trading NDay(20) // How many days long is this systems basis (20 or 55 day) ; Variables: N(0), // Underlying volatility of the stock DPP(Close), // Dollar per price of the stock StopLoss(0), // Stop loss value DollarRisk(0), // Dollar risk value TradeUnit(100), // How much to trade based on idea that 1N represents 1% of account equity UnitsHeld(0), // How many units are currently held NotationalAccount(10000), // Notational Account, hard coded for testing purposes LastAccount(0), // Last account size to reevaluate drawdown Stop_On(False), // Stop loss boolean Fast_Ave ( 0 ) , // Fast moving average value Slow_Ave ( 0 ) , // Slow moving average value Cross_Over (False); // Simple cross-over filter ; { Set-up } Cross_Over = False; Fast_Ave = Xaverage ( Close , 50 ) ; Slow_Ave = Xaverage ( Close , 200 ) ; If Fast_Ave < Slow_Ave and Slow_Ave < Slow_Ave [ 1 ] Then Cross_Over = True; { Position Sizing } N = VolatilityStdDev(NDay); DPP = Close; // Price of the stock is equal to its close DollarRisk = NotationalAccount * 0.01; TradeUnit = IntPortion(DollarRisk/(N*DPP)); StopLoss = 2 * N; // Decrease the size of the notational account if 10% drawdown If NotationalAccount < (LastAccount * 0.9) Then Begin NotationalAccount = NotationalAccount * 0.8; Print(File("c: urtle_short_notational.txt"), NotationalAccount); End Else Begin LastAccount = NotationalAccount; End; { Entry } // Do not even consider a trade if too many units are on the line #* If UnitsHeld < 12 then Begin #* // Enter if price exceeds by a single tick high of the preceding NDays) If Close < LowD(NDay) and Cross_Over then Begin SellShort ("Short") N shares next bar market; UnitsHeld = UnitsHeld + TradeUnit; End; If marketposition = -1 then begin SellShort ("Short more") (N / 2) shares next bar market; UnitsHeld = UnitsHeld + (TradeUnit / 2); End; End; #* End; #* { Stop } if ( Close - EntryPrice ) < StopLoss then begin Stop_On = True; End Else begin Stop_On = False; End; { Exit} If Close > HighD(NDay/2) and Stop_On then begin BuyToCover ("Short Exit") currentshares shares next bar market; UnitsHeld = 0; End;
프로필 이미지
양치기
2020-01-28
353
글번호 135453
시스템

참새사냥꾼 님에 의해서 삭제되었습니다.

프로필 이미지
참새사냥꾼
2020-01-28
2
글번호 135452
시스템
답변완료

타주기 이평 부탁드립니다.

아래는 이전에 받은 틱봉을 타주기로 바꾸는 지표입니다. 종가 이평선을 나타낼 수 있도록 부탁드리겠습니다. 감사합니다. input : n(3); var : TF(0),S1(0),D1(0),TM(0),cnt(0),idx(0); Array : OO[10](0), HH[10](0),LL[10](0),CC[10](0); if Bdate != Bdate[1] Then { S1 = TimeToMinutes(stime); D1 = sdate; idx = 0; } Else idx = idx+1; if D1 > 0 then { if sdate == D1 Then TM = TimeToMinutes(stime)-S1; Else TM = TimeToMinutes(stime)+1440-S1; TF = idx%n; if Bdate != Bdate[1] or (Bdate == Bdate[1] and TF < TF[1]) Then { OO[0] = O; HH[0] = H; LL[0] = L; for cnt = 1 to 9 { OO[cnt] = OO[cnt-1][1]; HH[cnt] = HH[cnt-1][1]; LL[cnt] = LL[cnt-1][1]; CC[cnt] = CC[cnt-1][1]; } } if H > HH[0] Then HH[0] = H; if L < LL[0] Then LL[0] = L; CC[0] = C; plot1(OO[0],"시가"); plot2(HH[0],"고가"); plot3(LL[0],"저가"); plot4(CC[0],"종가"); }
프로필 이미지
maker
2020-01-28
209
글번호 135450
지표
답변완료

예스트레이더 수식으로 변환 문의드립니다.

CCI = input(20) ATR = input(5) Multiplier=input(1,title='ATR Multiplier') original=input(true,title='original coloring') thisCCI = cci(close, CCI) lastCCI = nz(thisCCI[1]) bufferDn= high + Multiplier * sma(tr,ATR) bufferUp= low - Multiplier * sma(tr,ATR) if (thisCCI >= 0 and lastCCI < 0) bufferUp := bufferDn[1] if (thisCCI <= 0 and lastCCI > 0) bufferDn := bufferUp[1] if (thisCCI >= 0) if (bufferUp < bufferUp[1]) bufferUp := bufferUp[1] else if (thisCCI <= 0) if (bufferDn > bufferDn[1]) bufferDn := bufferDn[1] x=thisCCI >= 0 ?bufferUp:thisCCI <= 0 ?bufferDn:x[1] swap=x>x[1]?1:x<x[1]?-1:swap[1] swap2=swap==1?lime:red swap3=thisCCI >=0 ?lime:red swap4=original?swap3:swap2 plot(x,color=swap4,transp=0,linewidth=3) 감사합니다.
프로필 이미지
로즈버드
2020-01-28
249
글번호 135436
지표
답변완료

지표 수정 부탁드립니다.

틱봉에서 N분봉으로 변환 후 N분간 고/저점을 나타내는 수식을 이전에 부탁드려 받은 적이 있습니다. 현재 봉이 고가나 저가를 갱신하면 해당 지표의 고/저점도 같이 갱신되므로 사용하지 못하고 있습니다. 1봉 전의 N분간 고/저점을 나타내고 싶은데 수식을 봐도 어디에 [1]을 넣어야 할지 몰라 이렇게 문의 드립니다. 수정 부탁드립니다. 감사합니다. 아래는 이전에 받았던 수식 입니다. input : n(3),CC(10),CF(3),Per1(25),Per2(50),Per3(75); input : 굵기1(1),굵기2(1),굵기3(1),굵기4(1),굵기5(1),굵기6(1); input : 색상1(RED),색상2(MAGENTA),색상3(GREEN),색상4(CYAN),색상5(BLUE),색상6(BLACK); var : TF(0),S1(0),D1(0),TM(0),cnt(0),T1(0),HH(0),LL(0),ii(0),TT(0); var : TL1(0),TL2(0),TL3(0),TL4(0),TL5(0),TL6(0); var : O1(0),H1(0),L1(0),C1(0),sum(0),mav(0),VD(0),VT(0),VM(0),VP(0); Array : V1[100](0); if Bdate != Bdate[1] Then { S1 = TimeToMinutes(stime); D1 = sdate; TT = stime; ii = 0; } Else ii = ii+1; if D1 > 0 then { #영업일변경 기준으로 경과된 분 if sdate == D1 Then TM = TimeToMinutes(stime)-S1; Else TM = TimeToMinutes(stime)+1440-S1; //n분 미만 if TM < n then { //당일최고와 최저가를 기준으로 선 출력 hh = DayHigh; ll = daylow; TL_Delete(TL1); TL_Delete(TL2); TL_Delete(TL3); TL_Delete(TL4); TL_Delete(TL5); TL1 = TL_New(D1,TT,HH,Sdate,stime,HH); TL2 = TL_New(D1,TT,HH-(HH-LL)*0.25,Sdate,stime,HH-(HH-LL)*(Per1/100)); TL3 = TL_New(D1,TT,HH-(HH-LL)*0.50,Sdate,stime,HH-(HH-LL)*(Per2/100)); TL4 = TL_New(D1,TT,HH-(HH-LL)*0.75,Sdate,stime,HH-(HH-LL)*(Per3/100)); TL5 = TL_New(D1,TT,LL,Sdate,stime,LL); } else //분이상 경과 { //최근 n분 이내에서 최고가와 최저가 계산해서 선 출력 HH = H; LL = L; for cnt = 0 to ii { if TM[cnt] > TM-N then { if H[cnt] > HH Then HH = H[cnt]; if L[cnt] < LL Then LL = L[cnt]; TT = stime[cnt]; } if TM[cnt] < TM-N Then cnt = ii+1; } TL_Delete(TL1); TL_Delete(TL2); TL_Delete(TL3); TL_Delete(TL4); TL_Delete(TL5); TL1 = TL_New(D1,TT,HH,Sdate,stime,HH); TL2 = TL_New(D1,TT,HH-(HH-LL)*0.25,Sdate,stime,HH-(HH-LL)*(Per1/100)); TL3 = TL_New(D1,TT,HH-(HH-LL)*0.50,Sdate,stime,HH-(HH-LL)*(Per2/100)); TL4 = TL_New(D1,TT,HH-(HH-LL)*0.75,Sdate,stime,HH-(HH-LL)*(Per3/100)); TL5 = TL_New(D1,TT,LL,Sdate,stime,LL); } TL_SetColor(TL1,RED); TL_SetColor(TL2,MAGENTA); TL_SetColor(TL3,GREEN); TL_SetColor(TL4,CYAN); TL_SetColor(TL5,BLUE); TL_SetSize(TL1, 굵기1); TL_SetSize(TL2, 굵기2); TL_SetSize(TL3, 굵기3); TL_SetSize(TL4, 굵기4); TL_SetSize(TL5, 굵기5); #1분봉 기준(시,고,저,종,거래량 계산) if bdate != bdate[1] or (Bdate == bdate[1] and TM > TM[1]) Then { O1 = O; H1 = H; L1 = L; V1[0] = 0 ; for cnt = 1 to 99 { V1[cnt] = v1[cnt-1][1]; } } if H > H1 Then H1 = H; if L < L1 Then L1 = L; C1 = C; V1[0] = V1[0]+V; TL_Delete(TL6); if V1[cc] > 0 then { sum = 0; for cnt = 1 to CC { sum = sum + V1[cnt]; } mav = sum/CC; //최근 1분거래량이 이전 cc봉 평균대비 CF배 이상이면 if V1[0] >= mav*CF Then { //날짜,시간,TM값, 평균값 저장 VD = sdate; VT = stime; VM = TM; VP = (O1+H1+L1+C1)/4; } //오늘 거래량조건이 발생한적 있고 현재부터 20분 이내이면 출력 if VD == sdate and VM > TM-n Then { TL6 = TL_new(D1,TT,VP,Sdate,stime,VP); TL_SetColor(TL6,BLACK); TL_SetSize(TL6,굵기6); } } }
프로필 이미지
maker
2020-01-28
213
글번호 135434
지표