답변완료
문의 드립니다.
안녕하세요 ~예전에 수식이 안된다고 했는데, 현재는 가능한지 재 확인 요청 드립니다. RSI(5) 70이상일때, 현재가격이 아래의 수식을 돌파하는 종목 검색식 입니다. A=avg(c,2);B=A+AvgIf(c-A,1,0.0)+1.4*Stdevif(c-A,1,0.0);D=Bbandsup(9,2);d1=crossup(D,B);d2=crossdown(D,B);valuewhen(1, d1 or d2,o)감사합니다.
답변완료
Chandelier Exit 코딩을 부탁드립니다.
//@version=6// Copyright (c) 2019-present, Alex Orekhov (everget)// Chandelier Exit script may be freely distributed under the terms of the GPL-3.0 license.indicator('Chandelier Exit', shorttitle = 'CE', overlay = true)const string calcGroup = 'Calculation'length = input.int(22, title = 'ATR Period', group = calcGroup)mult = input.float(3.0, step = 0.1, title = 'ATR Multiplier', group = calcGroup)useClose = input.bool(true, title = 'Use Close Price for Extremums', group = calcGroup)const string visualGroup = 'Visuals'showLabels = input.bool(true, title = 'Show Buy/Sell Labels', group = visualGroup)highlightState = input.bool(true, title = 'Highlight State', group = visualGroup)const string alertGroup = 'Alerts'awaitBarConfirmation = input.bool(true, title = 'Await Bar Confirmation', group = alertGroup)//---atr = mult * ta.atr(length)longStop = (useClose ? ta.highest(close, length) : ta.highest(length)) - atrlongStopPrev = nz(longStop[1], longStop)longStop := close[1] > longStopPrev ? math.max(longStop, longStopPrev) : longStopshortStop = (useClose ? ta.lowest(close, length) : ta.lowest(length)) + atrshortStopPrev = nz(shortStop[1], shortStop)shortStop := close[1] < shortStopPrev ? math.min(shortStop, shortStopPrev) : shortStopvar int dir = 1dir := close > shortStopPrev ? 1 : close < longStopPrev ? -1 : dirconst color textColor = color.whiteconst color longColor = color.greenconst color shortColor = color.redconst color longFillColor = color.new(color.green, 85)const color shortFillColor = color.new(color.red, 85)buySignal = dir == 1 and dir[1] == -1longStopPlot = plot(dir == 1 ? longStop : na, title = 'Long Stop', style = plot.style_linebr, linewidth = 2, color = longColor)plotshape(buySignal ? longStop : na, title = 'Long Stop Start', location = location.absolute, style = shape.circle, size = size.tiny, color = longColor)plotshape(buySignal and showLabels ? longStop : na, title = 'Buy Label', text = 'Buy', location = location.absolute, style = shape.labelup, size = size.tiny, color = longColor, textcolor = textColor)sellSignal = dir == -1 and dir[1] == 1shortStopPlot = plot(dir == 1 ? na : shortStop, title = 'Short Stop', style = plot.style_linebr, linewidth = 2, color = shortColor)plotshape(sellSignal ? shortStop : na, title = 'Short Stop Start', location = location.absolute, style = shape.circle, size = size.tiny, color = shortColor)plotshape(sellSignal and showLabels ? shortStop : na, title = 'Sell Label', text = 'Sell', location = location.absolute, style = shape.labeldown, size = size.tiny, color = shortColor, textcolor = textColor)midPricePlot = plot(ohlc4, title = '', display = display.none, editable = false)fill(midPricePlot, longStopPlot, title = 'Long State Filling', color = (highlightState and dir == 1 ? longFillColor : na))fill(midPricePlot, shortStopPlot, title = 'Short State Filling', color = (highlightState and dir == -1 ? shortFillColor : na))await = awaitBarConfirmation ? barstate.isconfirmed : truealertcondition(dir != dir[1] and await, title = 'CE Direction Change', message = 'Chandelier Exit has changed direction, {{exchange}}:{{ticker}}')alertcondition(buySignal and await, title = 'CE Buy', message = 'Chandelier Exit Buy, {{exchange}}:{{ticker}}')alertcondition(sellSignal and await, title = 'CE Sell', message = 'Chandelier Exit Sell, {{exchange}}:{{ticker}}')
답변완료
ZLSMA 지표를 만들고자 합니다.
안녕하세요? 트레이딩뷰에 있는 ZLSMA 지표를 만들고자 합니다. 변환에 에러가 발생하여 부탁드립니다.// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/// © veryfid//@version=4study(title = "ZLSMA - Zero Lag LSMA", shorttitle="ZLSMA", overlay=true, resolution="")length = input(title="Length", type=input.integer, defval=32)offset = input(title="Offset", type=input.integer, defval=0)src = input(close, title="Source")lsma = linreg(src, length, offset)lsma2 = linreg(lsma, length, offset)eq= lsma-lsma2zlsma = lsma+eqplot(zlsma, color=color.yellow, linewidth=3)
답변완료
질문 있습니다.
안녕하세요.제 시스템을 마이크로 크루드 오일에 적용 중인데,Text_New로 손익을 표시하려고 하는데 차트에 나타나지 않습니다.【현재 상황】- 진입/청산 신호(▲매수, ▼매도)는 정상 표시됨- 손익 표시(+100pt, -50pt)만 나타나지 않음- ShowProfit = 1로 설정되어 있음【코드】var : CurrentProfit(0);if MarketPosition == 1 Then { CurrentProfit = (PositionProfit / PriceScale) / PointScale; ExitLong("Trend_ExitL"); if ShowProfit == 1 Then { if CurrentProfit >= 0 Then Text_New(sDate, sTime, H + 50.0, "+" + NumToStr(CurrentProfit, 1) + "pt"); Else Text_New(sDate, sTime, L - 50.0, NumToStr(CurrentProfit, 1) + "pt"); }}【종목 정보】- 마이크로 크루드 오일- TickSize = 0.01- TickValue = 0.1- PointScale = 1【궁금한 점】1. Text_New 위치가 차트 밖으로 나가서 안 보이는 건가요?2. PositionProfit / PriceScale 계산이 크루드 오일에서 다른가요?3. Exit 명령과 Text_New의 타이밍 문제인가요?다시 말해서Text_New로 차트에 텍스트 표시하는데 안 나타납니다.- 진입 신호는 나옴- 손익 표시만 안 나옴- ShowProfit = 1- H + 50.0, L - 50.0 위치크루드 오일 차트 범위가 58~62인데 텍스트 위치 때문인가요?마이크로 골드에서는 동일한 코드가 정상 작동했는데,크루드 오일에서만 안 나타나서 문의드립니다.그리고 유로, 파운드, 호주달러는 어떻게 하면 될까요?감사합니다.