can you add this indicator // This source code is subject to the terms of the Mozilla…
- User
can you add this indicator // This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/ // © RicardoSantos
//@version=5 indicator('Open Range Breakout', 'Range Breakout', true)
int mode = input.int(1, 'Mode (1:timeframe, 2:session):', minval=1, maxval=2) string tf = input.string('60', 'Timeframe for open range:', confirm=false) string tf2 = input.string('D', 'Timeframe for range capture:', confirm=false) string sess = input.session('0400-1500', 'Session for mode 2:') repaint = input.bool(true, 'Repaint?') ? barmerge.lookahead_on : barmerge.lookahead_off
bool is_new_day = switch mode 1 => ta.change(time(tf2)) > 0 2 => ta.change(nz(time(tf2, sess), 0)) > 0 => false bool is_end_session = switch mode 2 => na(time(tf2, sess)) => false
var float ND_open = na var float ND_high = na var float ND_low = na var float ND_stretch = 0 var float filter_high = na var float filter_low = na var float filter_high_stretch = na var float filter_low_stretch = na [tfo, tfh, tfl, tfr] = request.security(syminfo.tickerid, tf, [open, high, low, math.max(high-open, open-low)], lookahead=repaint) if is_new_day ND_open := tfo ND_high := tfh ND_low := tfl ND_stretch := na(ND_stretch[1]) ? 0.0 : (ND_stretch[1] * 9 + tfr) / 10 filter_high := ND_high filter_low := ND_low filter_high_stretch := ND_high + ND_stretch filter_low_stretch := ND_low - ND_stretch if is_end_session filter_high := na filter_low := na filter_high_stretch := na filter_low_stretch := na
plvl(src)=> src!=src[1]?na:src st = plot.style_linebr fh = plot(title='TR', series=plvl(filter_high), style=st, color=color.black) fl = plot(title='BR', series=plvl(filter_low), style=st, color=color.black) fhs = plot(title='TS', series=plvl(filter_high_stretch), style=st, color=color.green) fls = plot(title='BS', series=plvl(filter_low_stretch), style=st, color=color.maroon)
fill(title='Positive Stretch', plot1=fh, plot2=fhs, color=color.rgb(76, 175, 79, 50)) fill(title='Negative Stretch', plot1=fl, plot2=fls, color=color.rgb(136, 14, 79, 50)) , into this //@version=3
study(title="Magic MA", shorttitle="Magic MA", overlay=true, max_bars_back=2000)
// // Author: JustUncleL // Date: 10-July-2016 // Version: v3 // // Description: // A trend following indicator that uses fast QQE crosses with Moving Averages // for trend direction filtering. QQE or Qualitative Quantitative Estimation is based // on the relative strength index, but uses a smoothing technique as an additional // transformation. //
// - INPUTS START // Slow MA - type, source, length type3 = input(defval="HullMA", title="Slow MA Type: ", options=["SMA", "EMA", "WMA", "VWMA", "SMMA", "DEMA", "TEMA", "HullMA", "ZEMA", "TMA", "SSMA"], type=string) len3 = input(defval=57, title="Slow Length", minval=1) // Changed slow length to 57 // // QQE rsi Length, Smoothing, fast ATR factor, source RSILen = input(6,title='RSI Length') SF = input(3,title='RSI Smoothing Factor') QQE = input(2.618,title='Fast QQE Factor') threshhold = input(10, title="RSI Threshhold") // filter = input(false,title="Use Moving Average Filter") dfilter = input(false, title="Use Trend Directional Filter" ) ushunt = input(false, title="Use Shunt Alerts to prevent Repaint") RSIsrc = input(close,title="Source") srcclose= RSIsrc shunt = ushunt ? (RSIsrc==open ? 0 : 1) : 0 // - INPUTS END
- Assistant
- User
fixed error line 24 Cannot call 'ta.wma' with argument 'length'='call 'math.sqrt' (input float)'. An argument of 'input float' type was used but a 'series int' is expected. , line 21 The function 'ta.sma' should be called on each calculation for consistency. It is recommended to extract the call from the ternary operator or from the scope
- Assistant