Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
- // © Maurizio-Ciullo
- //@version=4
- study(title="Livelli Daily OHLC", overlay=true)
- //Inputs 14/14/30/30
- swt = input(true, title="Show This Daily OHLC?")
- input_media_D_high = input(title="media_D_high", type=input.integer, defval=12, minval=1, maxval=500, group="Medie_Giornaliere")
- input_media_D_low = input(title="media_D_low", type=input.integer, defval=12, minval=1, maxval=500, group="Medie_Giornaliere")
- input_media_D_high_smoothed = input(title="media_D_high_smoothed", type=input.integer, defval=29, minval=1, maxval=500, group="Medie_Giornaliere_Smoothed")
- input_media_D_low_smoothed = input(title="media_D_low_smoothed", type=input.integer, defval=25, minval=1, maxval=500, group="Medie_Giornaliere_Smoothed")
- //Startd Detecting Daily Highs/Lows //////////////////////////////////////
- wtdo = security(syminfo.tickerid, 'D', open)
- wpdo = security(syminfo.tickerid, 'D', open [1])
- wpc = security(syminfo.tickerid, 'D', close)
- wpdc = security(syminfo.tickerid, 'D', close [1])
- wph = security(syminfo.tickerid, 'D', high)
- wpdh = security(syminfo.tickerid, 'D', high [1])
- wpl = security(syminfo.tickerid, 'D', low)
- wpdl = security(syminfo.tickerid, 'D', low[1])
- //Daily Plots
- plot(swt and wtdo ? wtdo : na, title="Weekly Open", style=plot.style_circles, linewidth=1, color=color.silver)
- plot(swt and wpc ? wpc : na, title="Weekly Close", style=plot.style_circles, linewidth=1, color=color.fuchsia)
- plot(swt and wph ? wph : na, title="Weekly High", style=plot.style_circles, linewidth=1, color=color.green)
- plot(swt and wpl ? wpl : na, title="Weekly Low", style=plot.style_circles, linewidth=1, color=color.red)
- //End Detecting Daily Highs/Lows //////////////////////////////////////
Add Comment
Please, Sign In to add comment