JayRogers

Simple Horizontal Value and Offsets

Requested by @TAFA94

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

Simple Horizontal Value and Offsets [Auto Shift]
Remove from Favorite Scripts Add to Favorite Scripts
//@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)
Great work! Thank you so much! Been searching for something like this on TV for months! You have my respect!
Reply
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. :)
+1 Reply
United States
United Kingdom
India
España
France
Italia
Polska
Brasil
Россия
Türkiye
Indonesia
Malaysia
日本
한국
Home Stock Screener Forex Signal Finder Economic Calendar How It Works Chart Features House Rules Moderators For the WEB Widgets Stock Charting Library Priority Support Feature Request Blog & News FAQ Help & Wiki Twitter
Profile Profile Settings Account and Billing Priority Support Ideas Published Followers Following Private Messages Chat Sign Out