Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // 8888888888 8888888b. 8888888888 8888888888 d8888 888 .d8888b. .d88888b. As you
- // 888 888 Y88b 888 888 d88888 888 d88P Y88b d88P" "Y88b Can see
- // 888 888 888 888 888 d88P888 888 888 888 888 888 Are all
- // 8888888 888 d88P 8888888 8888888 d88P 888 888 888 888 888 .d8888b Basic free
- // 888 8888888P" 888 888 d88P 888 888 888 88888 888 888 88K tradingview
- // 888 888 T88b 888 888 d88P 888 888 888 888 888 888 "Y8888b. indicators
- // 888 888 T88b 888 888 d8888888888 888 Y88b d88P Y88b. .d88P X88 repackaged
- // 888 888 T88b 8888888888 8888888888 d88P 888 88888888 "Y8888P88 "Y88888P" 88888P' into one
- //
- // FAQ
- //
- // Why?
- // I want you to see what you are willing to pay hundereds of dollars a month
- // Has the code been leaked/hacked?
- // No, this code has been created from scratch only using common sense and public information from the internet
- // What's the accuracy I can expect from this version of the indicator?
- // I'd say it's about 95% the same as the one you would pay
- // The indicator needs to be updated?
- // Write me a private message on TradingView (Nick42_for_win)
- // Can I suggest an indicator to get a FREE ALGOs version?
- // Write me a private message on TradingView (Nick42_for_win)
- // Do you get any monetary return from this project?
- // Nope, 0$
- // Enjoy ;)
- //@version=5
- indicator("FREE ALGOs [EasyAlgo V2]", overlay=true, precision=0, max_labels_count=500)
- //----------------- EasyAlgo V2 | https://www.easyalgo.io --------------------//
- // Get user input
- emaCloud = input.bool(true, "EMA Cloud?")
- volCloud = input.bool(false, "Volatility Cloud?")
- volBands = input.bool(false, "Volatility Bands?")
- volSen = input.int(3, "Volatility Sensitivity (1-3 Hi to Lo)", 1, 3)
- signals = input.bool(true, "BUY/SELL Signals?")
- levels = input.bool(false, "TP/SL Levels?")
- atrLen = input.int(14, "ATR Length", 1)
- atrRisk = input.int(2, "ATR/ Risk", 1)
- volBandsSen = input.int(5, "Vol Bands Sensitivity (Default: 5.0)", 1)
- useEma = input.bool(true, "Use Exponential MA?")
- // Get Components
- ema1 = ta.ema(ohlc4, 5*volSen)
- ema2 = ta.ema(ohlc4, 9*volSen)
- ema3 = ta.ema(ohlc4, 13*volSen)
- ema4 = ta.ema(ohlc4, 34*volSen)
- ema5 = ta.ema(ohlc4, 50*volSen)
- f_kc(src, len, mult) =>
- float basis = useEma ? ta.ema(src, len) : ta.sma(src, len)
- float span = useEma ? ta.ema(ta.tr, len) : ta.sma(ta.tr, len)
- [basis + span * mult, basis - span * mult]
- [upperKC1, lowerKC1] = f_kc(close, 35, 0.5236 * volBandsSen)
- [upperKC2, lowerKC2] = f_kc(close, 35, 0.6854 * volBandsSen)
- [upperKC3, lowerKC3] = f_kc(close, 35, 0.8472 * volBandsSen)
- bull = ema3 >= ema3[1] and ema1 >= ema2 and ema1[1] < ema2[1]
- bear = ema3 <= ema3[1] and ema1 <= ema2 and ema1[1] > ema2[1]
- trigger = bull ? 1 : 0
- atrBand = ta.atr(atrLen) * atrRisk
- atrStop = trigger == 1 ? low - atrBand : high + atrBand
- // Colors
- green = emaCloud ? #00CC00 : na, green5 = volCloud ? color.new(#00CC00, 95) : na, green12_5 = volCloud ? color.new(#00CC00, 87.5) : na, green20 = volCloud ? color.new(#00CC00, 80) : na
- red = emaCloud ? #CC0000 : na, red5 = volCloud ? color.new(#CC0000, 95) : na, red12_5 = volCloud ? color.new(#CC0000, 87.5) : na, red20 = volCloud ? color.new(#CC0000, 80) : na
- gray = volBands ? #787B86 : na, gray40 = volBands ? color.new(gray, 60) : na, gray5 = volBands ? color.new(gray, 95) : na, gray20 = volBands ? color.new(gray, 80) : na
- // Plots
- p1 = plot(ema1, "", na, editable=false)
- p2 = plot(ema2, "", na, editable=false)
- p3 = plot(ema3, "", na, editable=false)
- p4 = plot(ema4, "", na, editable=false)
- p5 = plot(ema5, "", na, editable=false)
- fill(p4, p5, ema4 >= ema5 ? green5 : red5)
- fill(p3, p4, ema3 >= ema4 ? green12_5 : red12_5)
- fill(p2, p3, ema3 >= ema3[1] ? green : red)
- fill(p1, p2, ema1 >= ema3 ? green20 : red20)
- barcolor(ema3 >= ema3[1] ? green : red)
- b1 = plot(upperKC1, "", gray40, editable=false)
- b2 = plot(upperKC2, "", gray40, editable=false)
- b3 = plot(upperKC3, "", gray40, editable=false)
- b4 = plot(lowerKC1, "", gray40, editable=false)
- b5 = plot(lowerKC2, "", gray40, editable=false)
- b6 = plot(lowerKC3, "", gray40, editable=false)
- fill(b1, b2, gray5)
- fill(b2, b3, gray20)
- fill(b4, b5, gray5)
- fill(b5, b6, gray20)
- y1 = low - (ta.atr(30) * 1.6)
- y2 = high + (ta.atr(30) * 1.6)
- buy = signals and bull ? label.new(bar_index, y1, "BUY", xloc.bar_index, yloc.price, #00CC00, label.style_label_up, color.white, size.normal) : na
- sell = signals and bear ? label.new(bar_index, y2, "SELL", xloc.bar_index, yloc.price, #CC0000, label.style_label_down, color.white, size.normal) : na
- lastTrade(src) => ta.valuewhen((ema3 >= ema3[1] and ema1 >= ema2 and ema1[1] < ema2[1]) or (ema3 <= ema3[1] and ema1 <= ema2 and ema1[1] > ema2[1]), src, 0)
- entry = levels ? label.new(time, close, "ENTRY " + str.tostring(lastTrade(close), "#.##"), xloc.bar_time, yloc.price, color.gray, label.style_label_left, color.white, size.normal) : na
- label.set_y(entry, lastTrade(close))
- label.delete(entry[1])
- stop_y = lastTrade(atrStop)
- stop = levels ? label.new(time, close, "SL " + str.tostring(stop_y, "#.##"), xloc.bar_time, yloc.price, #CC0000, label.style_label_left, color.white, size.normal) : na
- label.set_y(stop, stop_y)
- label.delete(stop[1])
- tp1_y = (lastTrade(close)-lastTrade(atrStop))*1 + lastTrade(close)
- tp1 = levels ? label.new(time, close, "1:1 TP " + str.tostring(tp1_y, "#.##"), xloc.bar_time, yloc.price, #00CC00, label.style_label_left, color.white, size.normal) : na
- label.set_y(tp1, tp1_y)
- label.delete(tp1[1])
- tp2_y = (lastTrade(close)-lastTrade(atrStop))*2 + lastTrade(close)
- tp2 = levels ? label.new(time, close, "2:1 TP " + str.tostring(tp2_y, "#.##"), xloc.bar_time, yloc.price, #00CC00, label.style_label_left, color.white, size.normal) : na
- label.set_y(tp2, tp2_y)
- label.delete(tp2[1])
- tp3_y = (lastTrade(close)-lastTrade(atrStop))*3 + lastTrade(close)
- tp3 = levels ? label.new(time, close, "3:1 TP " + str.tostring(tp3_y, "#.##"), xloc.bar_time, yloc.price, #00CC00, label.style_label_left, color.white, size.normal) : na
- label.set_y(tp3, tp3_y)
- label.delete(tp3[1])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement