JayRogers

Simple Horizontal Value and Offsets

2634 visningar
160
Requested by @TAFA94

  • Simple horizontal values extending up and down from a median value.
  • Set Median Value, and set offset values. Simples!
Kommentera: Auto adjusting median version here:

Open-source script

In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in a publication is governed by House Rules. You can favorite it to use it on a chart.

Want to use this script on a chart?
//@version=2

study(title="Simple Horizontal Value and Offsets", shorttitle="SHV", overlay=true)

// Revision:    1
// Author:      JayRogers
//
// Description:
//  - Requested by @TAFA94
//  - Simple horizontal values extending up and down from a median value.
//  - Set Median Value, and set offset values. Simples.

valMedian   = input(defval=1.09, title="Median Value")
valOffset   = input(defval=0.0025, title="Offset Value")

// offset multiplier function.
offsetMult(num) => num * valOffset

// Plot median line
midline     = plot(valMedian, title="Median Line", color=#0099FF, linewidth=2, transp=0)

// ..colour and transparency variables for quicker 'style' edits..
_dc = #0099FF
_dt = 50
// plot upward offsets
plus1   = plot(valMedian + offsetMult(1), title="Plus 1", color=_dc, linewidth=1, transp=_dt)
plus2   = plot(valMedian + offsetMult(2), title="Plus 2", color=_dc, linewidth=1, transp=_dt)
plus3   = plot(valMedian + offsetMult(3), title="Plus 3", color=_dc, linewidth=1, transp=_dt)
plus4   = plot(valMedian + offsetMult(4), title="Plus 4", color=_dc, linewidth=1, transp=_dt)
plus5   = plot(valMedian + offsetMult(5), title="Plus 5", color=_dc, linewidth=1, transp=_dt)
plus6   = plot(valMedian + offsetMult(6), title="Plus 6", color=_dc, linewidth=1, transp=_dt)
plus7   = plot(valMedian + offsetMult(7), title="Plus 7", color=_dc, linewidth=1, transp=_dt)
plus8   = plot(valMedian + offsetMult(8), title="Plus 8", color=_dc, linewidth=1, transp=_dt)
plus9   = plot(valMedian + offsetMult(9), title="Plus 9", color=_dc, linewidth=1, transp=_dt)
plus10  = plot(valMedian + offsetMult(10), title="Plus 10", color=_dc, linewidth=1, transp=_dt)
// plot downward offsets
minus1  = plot(valMedian - offsetMult(1), title="minus 1", color=_dc, linewidth=1, transp=_dt)
minus2  = plot(valMedian - offsetMult(2), title="minus 2", color=_dc, linewidth=1, transp=_dt)
minus3  = plot(valMedian - offsetMult(3), title="minus 3", color=_dc, linewidth=1, transp=_dt)
minus4  = plot(valMedian - offsetMult(4), title="minus 4", color=_dc, linewidth=1, transp=_dt)
minus5  = plot(valMedian - offsetMult(5), title="minus 5", color=_dc, linewidth=1, transp=_dt)
minus6  = plot(valMedian - offsetMult(6), title="minus 6", color=_dc, linewidth=1, transp=_dt)
minus7  = plot(valMedian - offsetMult(7), title="minus 7", color=_dc, linewidth=1, transp=_dt)
minus8  = plot(valMedian - offsetMult(8), title="minus 8", color=_dc, linewidth=1, transp=_dt)
minus9  = plot(valMedian - offsetMult(9), title="minus 9", color=_dc, linewidth=1, transp=_dt)
minus10 = plot(valMedian - offsetMult(10), title="minus 10", color=_dc, linewidth=1, transp=_dt)
If you like what I do, consider buying me a nice fresh cup of tea :)

https://paypal.me/JayRogersKreations

Kommentarer

Great for lower indicators! Thanks!
Svara
Great work! Thank you so much! Been searching for something like this on TV for months! You have my respect!
Svara
Building new, or importing complex indicators and strategies is great if that's what you want/need, but it surprises me how a lot of "simple" things seem to get overlooked here.

Happy to contribute to the K.I.S.S club lol. :)
+2 Svara