커뮤니티

예스랭귀지 Q&A

글쓰기
답변완료

문의드립니다.

안녕하세요 예스랭귀지로 변환 부탁드려도 될까요? 감사드립니다 study("Sell / Buy Rates", overlay = false, precision = 0) prd = input(title="Period", defval = 34, minval = 1) tw = high - max(open, close) bw = min(open, close) - low body = abs(close - open) _rate(cond) => 0.5 * (tw + bw + (cond ? 2 * body : 0)) / (tw + bw + body) volup = volume * _rate(open <= close) voldown = volume * _rate(open >= close) rate = linreg(volup - voldown, prd, 0) col = rate > 0 ? (falling(rate, 5) ? green : lime) : rate < 0 ? rising(rate, 5) ? maroon : red : na plot(rate, color = col, style = columns)
프로필 이미지
로즈버드
2021-11-16
630
글번호 153633
지표
답변완료

문의드립니다

안녕하세요 항상 도움주심 감사드리고 있습니다. 아래의 수식을 예스랭귀지로 변환 가능할지 문의드립니다. 감사합니다. 좋은 하루되세요! Periods = input(title="ATR Period", type=input.integer, defval=10) src = input(hl2, title="Source") Multiplier = input(title="ATR Multiplier", type=input.float, step=0.1, defval=3.0) changeATR= input(title="Change ATR Calculation Method ?", type=input.bool, defval=true) showsignals = input(title="Show Buy/Sell Signals ?", type=input.bool, defval=true) highlighting = input(title="Highlighter On/Off ?", type=input.bool, defval=true) atr2 = sma(tr, Periods) atr= changeATR ? atr(Periods) : atr2 up=src-(Multiplier*atr) up1 = nz(up[1],up) up := close[1] > up1 ? max(up,up1) : up dn=src+(Multiplier*atr) dn1 = nz(dn[1], dn) dn := close[1] < dn1 ? min(dn, dn1) : dn trend = 1 trend := nz(trend[1], trend) trend := trend == -1 and close > dn1 ? 1 : trend == 1 and close < up1 ? -1 : trend upPlot = plot(trend == 1 ? up : na, title="Up Trend", style=plot.style_linebr, linewidth=2, color=color.green) buySignal = trend == 1 and trend[1] == -1 plotshape(buySignal ? up : na, title="UpTrend Begins", location=location.absolute, style=shape.circle, size=size.tiny, color=color.green, transp=0) plotshape(buySignal and showsignals ? up : na, title="Buy", text="Buy", location=location.absolute, style=shape.labelup, size=size.tiny, color=color.green, textcolor=color.white, transp=0) dnPlot = plot(trend == 1 ? na : dn, title="Down Trend", style=plot.style_linebr, linewidth=2, color=color.red) sellSignal = trend == -1 and trend[1] == 1 plotshape(sellSignal ? dn : na, title="DownTrend Begins", location=location.absolute, style=shape.circle, size=size.tiny, color=color.red, transp=0) plotshape(sellSignal and showsignals ? dn : na, title="Sell", text="Sell", location=location.absolute, style=shape.labeldown, size=size.tiny, color=color.red, textcolor=color.white, transp=0) mPlot = plot(ohlc4, title="", style=plot.style_circles, linewidth=0) longFillColor = highlighting ? (trend == 1 ? color.green : color.white) : color.white shortFillColor = highlighting ? (trend == -1 ? color.red : color.white) : color.white fill(mPlot, upPlot, title="UpTrend Highligter", color=longFillColor) fill(mPlot, dnPlot, title="DownTrend Highligter", color=shortFillColor) alertcondition(buySignal, title="SuperTrend Buy", message="SuperTrend Buy!") alertcondition(sellSignal, title="SuperTrend Sell", message="SuperTrend Sell!") changeCond = trend != trend[1] alertcondition(changeCond, title="SuperTrend Direction Change", message="SuperTrend has changed direction!")
프로필 이미지
카탈레나
2021-11-16
613
글번호 153632
지표
답변완료

문의드립니다

plot1(Data2(NextBarOpen)); ................................... 상기 지표식은 예전 문의글에서 답변해 주신 지표식입니다 .. 예전 문의글 : 참조챠트 데이타2의 봉에서 시가가 나오면 본챠트에 그시가선을(참조챠트의 시가) 수평으로 그어 주세요 상기지표식 시가부분을 종가로 바꾸어 주세요 감사합니다..
프로필 이미지
zmfha
2021-11-16
538
글번호 153629
지표
답변완료

문의드립니다.

안녕하세요? Onclsoe와 Atmarket에 대하여 몇가지 질문드립니다. 1. OnClose가 종가 청산인데 실제 트레이딩에서 청산은 다음 시가가 되겠죠? 그러면 결국 실제 매매에서는 다음 봉 시가에 청산하는 AtMarket와 OnClose가 같다고 보면 되는 것인지요? 2. 시뮬레이션 결과 출력에서는 OnClose는 종가로, AtMarket은 다음봉 시가로 청산가격이 출력되므로 결과가 다릅니다. OnClose는 종가 청산시 전략 성과가 어떻게 되는지 보는 주로 시뮬레이션용에 사용하는 것 같습니다. 3. 결국 모의 트레이딩과 실제 트레이딩의 괴리를 줄이기 위해서는 Onclose보다 AtMarket을 사용해야 할 것 같습니다. 상기의 내용들은 제가 매뉴얼을 보고 생각한 것들로 확인차 문의를 드립니다. 상기의 내용들 중에 제가 틀리게 생각하고 있는 부분이 있다면 코멘트바랍니다. 감사합니다.
프로필 이미지
inreever
2021-11-16
551
글번호 153628
지표
답변완료

연속 양봉 음봉 더하기

차트에 연속 양봉이나 음봉이 출현시 연속된 양봉이나 음봉을 한나의 양봉,음봉으로 표시 할수 있나요? (양봉 5개 연속 출현시 1개 양봉으로 표시)
프로필 이미지
호테
2021-11-16
390
글번호 153627
지표

신대륙발견 님에 의해서 삭제되었습니다.

프로필 이미지
신대륙발견
2021-11-16
9
글번호 153626
시스템

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

프로필 이미지
after512
2021-11-16
14
글번호 153625
사용자 함수
답변완료

문의 드립니다.

항상 감사드립니다. 주신 수식에 조언 주신대로 시간 조정하고 거래횟수를 추가해서 데모를 해보았습니다. 거래횟수 제한 수식을 잘못 넣었는지 시간내내 계속 거래가 되었습니다. 수정 부탁드립니다. 아래 내용 조금 헷갈려서요. 아래 수식 주석 부탁드립니다. 그리고 BX. CX 부분을 신호나온 이전캔들 N개의 최고가, 최저가 돌파시 하는 수식도 부탁드립니다. 감사합니다. input : n1(5); input : StartTime(231000),EndTime(053000); input : 익절틱수(80),손절틱수(0), 거래횟수(N); var : Tcond(false), T(0), entry(0); Array : H1[50](0),L1[50](0); if (sdate != sdate[1] and stime >= EndTime) or (sdate == sdate[1] and stime >= EndTime and stime[1] < EndTime) Then Tcond = False; if (sdate != sdate[1] and stime >= StartTime) or (sdate == sdate[1] and stime >= StartTime and stime[1] < StartTime) Then Tcond = true; { T = 0; Tcond = true; entry = 0; } if (MarketPosition != 0 and MarketPosition != MarketPosition[1]) or (MarketPosition == MarketPosition[1] and TotalTrades > TotalTrades[1]) Then entry = entry+1; if Tcond == true and entry < 거래횟수 Then { if MarketPosition <= 0 and NextBarOpen <= Highest(H,n1) Then Buy("b1",AtStop,Highest(H,n1)+PriceScale*1); if MarketPosition >= 0 and NextBarOpen >= Lowest(L,N1) Then Sell("s1",AtStop,Lowest(L,N1)-PriceScale*1); if MarketPosition == 1 Then ExitLong("bx",AtStop,L[BarsSinceEntry]-PriceScale*1); if MarketPosition == -1 Then ExitShort("sx",AtStop,H[BarsSinceEntry]+PriceScale*1); } SetStopProfittarget(PriceScale*익절틱수,PointStop); SetStopLoss(PriceScale*손절틱수,PointStop); IF Endtime > starttime Then SetStopEndofday(Endtime); Else { if sDate != sDate[1] Then SetStopEndofday(Endtime); } if (sdate != sdate[1] and stime >= StartTime) or (sdate == sdate[1] and stime >= StartTime and stime[1] < StartTime) Then { IF Endtime <= starttime Then { SetStopEndofday(0); } }
프로필 이미지
jesten77
2021-11-15
580
글번호 153624
시스템
답변완료

다시 문의 드립니다.

친절한 도움에 감사드립니다. 수식을 다시 데모해보았는데요... 진입과 청산에 차이가 있는 부분이 있어 남깁니다. 진입은 1번 캔들 종가에 매도가 들어가는 것이 맞는데.. 다음 캔들 종가에 들어갔습니다. 그리고 청산은 이해가 가지 않게 정리되었네요.. 두번째 이미지 사진에서도 거래횟수로 1회로 해서 데모해보았는데요. 1번과 2번 두 번 진입이 되었습니다. 그리고 2번 진입한 것은 중간에 손절되지 않고 거래 종료시간에 청산(3번)했는데 이것도 맞지 않습니다. 이미지 남겨드립니다. 확인 부탁드립니다. input : n1(5); input : StartTime(233000),EndTime(013000); input : 익절틱수(80),손절틱수(0),거래횟수(3); var : Tcond(false), T(0), entry(0); Array : H1[50](0),L1[50](0); if (sdate != sdate[1] and stime >= EndTime) or (sdate == sdate[1] and stime >= EndTime and stime[1] < EndTime) Then Tcond = False; if (sdate != sdate[1] and stime >= StartTime) or (sdate == sdate[1] and stime >= StartTime and stime[1] < StartTime) Then { T = 0; Tcond = true; entry = 0; } if (MarketPosition != 0 and MarketPosition != MarketPosition[1]) or (MarketPosition == MarketPosition[1] and TotalTrades > TotalTrades[1]) Then entry = entry+1; if Tcond == true and entry < 거래횟수 Then { if H > Highest(H,n1)[1] and C > O Then Buy("b"); if L < Lowest(L,N1)[1] and C < O Then Sell("s"); if MarketPosition == 1 Then ExitLong("bx",AtStop,L[BarsSinceEntry]-PriceScale*1); if MarketPosition == -1 Then ExitShort("sx",AtStop,H[BarsSinceEntry]+PriceScale*1); } SetStopProfittarget(PriceScale*익절틱수,PointStop); SetStopLoss(PriceScale*손절틱수,PointStop); IF Endtime > starttime Then SetStopEndofday(Endtime); Else { if sDate != sDate[1] Then SetStopEndofday(Endtime); } if (sdate != sdate[1] and stime >= StartTime) or (sdate == sdate[1] and stime >= StartTime and stime[1] < StartTime) Then { IF Endtime <= starttime Then { SetStopEndofday(0); } }
프로필 이미지
jesten77
2021-11-15
755
글번호 153623
시스템
답변완료

수식검토 부탁드립니다

input : 카운팅시작일자(20211109), 카운팅시작시간(080000),Period(56); var : Tcond(false); var : sum(0); var : TL(0), TL1(0); if sdate >= 카운팅시작일자 and stime >= 카운팅시작시간 Then Tcond = true; if Tcond == true Then { if (sdate != sdate[1] and stime >= 카운팅시작시간) or (sdate == sdate[1] and stime >= 카운팅시작시간 and stime[1] < 카운팅시작시간) Then Variables: BullP(0), BearP(0); if Bdate != Bdate[1] Then sum = 0; if C > O Then sum = (sum+v*0.1); if C < O Then sum = (sum-v*0.1); BullP = (HIGH - ema(h,Period)); BearP = (LOW - ema(l,Period)); if BullP>0 then { var1 = BullP; } Else { var2 = BearP; if bullp > 80 Then { TL = TL_New(sDate,sTime,O,NextBarSdate,NextBarStime,O); TL_SetExtRight(TL,True); } if bearp < -80 Then { TL1 = TL_New(sDate,sTime,O,NextBarSdate,NextBarStime,O); TL_SetExtRight(TL1,True); }}} 신속한 답변주셔서 대단히 감사합니다.상기수식으로 실행한 결과 캡쳐1에서 80 이상 일때 수평선 라인이 표현되어야 하는데 80 미만에서 라인이 형성됩니다 마찬가지로 캡쳐2에서 -80 이하일때 수평선이 형성되어야하는데 -80 이상일때 수평선이 형성되어 수식수정 부탁 드립니다..
프로필 이미지
수색대대
2021-11-16
532
글번호 153621
지표