트레이딩뷰 파인스크립트 질문입니다.

트레이딩뷰 파인스크립트 질문입니다.

작성일 2024.01.26댓글 1건
    게시물 수정 , 삭제는 로그인 필요

안녕하세요


지표를 좀 수정하고 싶은데 잘몰라서 질문드립니다.


트레이딩뷰에서 Amazing Oscillator라는 지표구요


추가하면 아래와 같은 이미지로 나옵니다.




'
이렇게 추가된게 보이는데요 지금 세로줄로 점선된 부분 수치가 위에 14라고 적혀있습니다.
가장 위쪽 상단 회색선이 30수치 라인이구요
가장 아래쪽 하단 회색선이 -30수치 라인입니다.


제가 구현하고 싶은 부분은 현재수치만 지금처럼 14라고 보이는데 
현재수치도 궁금하지만 앞전 수치대비해서 얼마나 증감이 있었는지를 그래프위에 숫자로 표시하고
싶습니다.
14 앞전수치가 12.5이거든요 그러면 14-12.5를 뺀 1.5를 저 녹색봉위에 표시하고 싶은데 방법이
없을까요?






현재소스는 아래와 같습니다.





// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © Algoalpha X © SUSHIBOI77


//@version=5
indicator("Amazing Oscillator [Algoalpha]", "AlgoAlpha - Amazing Oscillator")


// Inputs
oscPeriod = input.int(20, "Oscillator Length", minval = 1)
upColor = input.color(#00ffbb, "Up Color")
downColor = input.color(#ff1100, "Down Color")


// Amazing Oscillator Calculation
midpointPrice = hl2
shortSMA = ta.sma(midpointPrice, 5)
longSMA = ta.sma(midpointPrice, 34)
amazingOsc = shortSMA - longSMA


// RSI-like Calculation
rise = ta.rma(math.max(ta.change(amazingOsc), 0), oscPeriod)
fall = ta.rma(-math.min(ta.change(amazingOsc), 0), oscPeriod)
customRSI = (fall == 0 ? 100 : rise == 0 ? 0 : 100 - (100 / (1 + rise / fall))) - 50
opacityLevel = customRSI > 0 and customRSI > customRSI[1] or customRSI < 0 and customRSI < customRSI[1] ? 30 : 80
barColor = customRSI > 0 ? color.new(upColor, opacityLevel) : color.new(downColor, opacityLevel)


// Plots
plot(customRSI, "RSI Column", barColor, 1, plot.style_columns)
plot(customRSI, "RSI Line", customRSI > 0 ? color.new(upColor, 0) : color.new(downColor, 0))
plot(30, "Upper Threshold", color.from_gradient(customRSI, 0, 50, color.new(color.gray, 70), color.new(downColor, 0)), 3)
plot(-30, "Lower Threshold", color.from_gradient(customRSI, -50, 0, color.new(upColor, 0), color.new(color.gray, 70)), 3)
midline = plot(0, "Midline", color.gray)


// Crossover and Crossunder Characters
plotchar(ta.crossover(customRSI, -30) ? -52 : na, "Buy Signal", char = "x", color = upColor, location = location.absolute, size = size.tiny)
plotchar(ta.crossunder(customRSI, 30) ? 52 : na, "Sell Signal", char = "x", color = downColor, location = location.absolute, size = size.tiny)



#트레이딩뷰 파인스크립트 #트레이딩뷰 파인스크립트 강좌 #트레이딩뷰 파인스크립트 자동매매 #트레이딩뷰 파인스크립트 알람 #트레이딩뷰 파인스크립트 모바일

profile_image 익명 작성일 -

트레이딩뷰 파인에디터 다시 질문...

... 트레이딩뷰 홈페이지에서 '파인스크립트(Pine Script)'를 다운로드합니다. 파인스크립트를 실행하고, 다음과 같은 코드를 입력합니다. //@version=4 study(title="당일...