Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // SET 4: Monthly
- // ------------------------------------------------------------------- Enablers
- enable_set4_high = input.bool(defval=true, title='Set 4h', group='Set 4')
- enable_set4_low = input.bool(defval=true, title='Set 4l', group='Set 4')
- enable_set4_fill = input.bool(defval=true, title='Set 4 Fill', group='Set 4')
- // --------------------------------------------------------------------- Inputs
- set4_length = input.int(defval=9, title='Length s4', group='Set 4')
- set4_offset = input.int(defval=0, title='Offset s4', group='Set 4')
- // Resolutions
- set4_high_resolution = input.timeframe(title='Resolution s4h', defval='M', group='Set 4')
- set4_low_resolution = input.timeframe(title='Resolution s4l', defval='M', group='Set 4')
- // Fillers
- set4_high_filler_modifier = input.float(defval=7.0, title='Filler Modifier s4h (%)', group='Set 4')
- set4_low_filler_modifier = input.float(defval=7.0, title='Filler Modifier s4hl (%)', group='Set 4')
- // ----------------------------------------------------------------------- Security
- // Expressions
- set4_high_expression = ta.ema(high, set4_length)
- set4_low_expression = ta.ema(low, set4_length)
- // Get values using anti-repainting
- set4_high_sec = _nrp(set4_high_resolution, set4_high_expression) // core4 is high
- set4_low_sec = _nrp(set4_low_resolution, set4_low_expression) // core4 is low
- // ----------------------------------------------------------------------- Timeframe Disablers
- set4_timeframe_disable = timeframe.period == 'M' ? false : true
- // --------------------------------------------------------------------- Plotting
- // Colors
- set4_high_color = color.new(color_monthly, 50)
- set4_low_color = color.new(color_monthly, 50)
- set4_high_helper_color = color.new(color_monthly, 30)
- set4_low_helper_color = color.new(color_monthly, 30)
- set4_high_filler_color = color.new(color_monthly, 90)
- set4_low_filler_color = color.new(color_monthly, 90)
- // Visible Core
- set4_high_sec_plot = plot(enable_emac and enable_set4 and enable_set4_high and set4_timeframe_disable ? set4_high_sec : na, title='s4h', color=set4_high_color, linewidth=3, offset=set4_offset)
- set4_low_sec_plot = plot(enable_emac and enable_set4 and enable_set4_low and set4_timeframe_disable ? set4_low_sec : na, title='s4l', color=set4_low_color, linewidth=3, offset=set4_offset)
- // Non-visible Core
- set4_high_filler_modifier_calculated = set4_high_filler_modifier / 100
- set4_low_filler_modifier_calculated = set4_low_filler_modifier / 100
- set4_high_series = set4_high_sec + set4_high_sec * set4_high_filler_modifier_calculated
- set4_low_series = set4_low_sec + set4_low_sec * set4_low_filler_modifier_calculated
- set4_high_helper_plot = plot(enable_emac and enable_set4 and enable_set4_high and set4_timeframe_disable and enable_set4_fill ? set4_high_series : na, title='s4helper', color=dashed_color(set4_high_helper_color, high_gap), linewidth=1, offset=set4_offset)
- set4_low_helper_plot = plot(enable_emac and enable_set4 and enable_set4_low and set4_timeframe_disable and enable_set4_fill ? set4_low_series : na, title='s4lhelper', color=dashed_color(set4_low_helper_color, low_gap), linewidth=1, offset=set4_offset)
- // Fillers
- fill(plot1=set4_high_sec_plot, plot2=set4_high_helper_plot, color=set4_high_filler_color, title='Set 4h Fill')
- fill(plot1=set4_low_sec_plot, plot2=set4_low_helper_plot, color=set4_low_filler_color, title='Set 4l Fill')
Advertisement
Add Comment
Please, Sign In to add comment