No Code Signals
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © SamRecio

//@version=5
indicator("No Code Signals",shorttitle = "[NCS]", overlay = true, max_bars_back = 5000, max_labels_count = 500)

src1 = input.source(open, title = "Indicator 1", group = "🔷 🔹  IMPORTS  🔹 🔷", inline = "1")
src2 = input.source(high, title = "Indicator 2  ", group = "🔷 🔹  IMPORTS  🔹 🔷", inline = "1")
src3 = input.source(low, title = "Indicator 3", group = "🔷 🔹  IMPORTS  🔹 🔷", inline = "2")
src4 = input.source(close, title = "Indicator 4  ", group = "🔷 🔹  IMPORTS  🔹 🔷", inline = "2")
src5 = input.source(hl2, title = "Indicator 5", group = "🔷 🔹  IMPORTS  🔹 🔷", inline = "3")
src6 = input.source(open, title = "Indicator 6  ", group = "🔷 🔹  IMPORTS  🔹 🔷", inline = "3")
src7 = input.source(high, title = "Indicator 7", group = "🔷 🔹  IMPORTS  🔹 🔷", inline = "4")
src8 = input.source(low, title = "Indicator 8  ", group = "🔷 🔹  IMPORTS  🔹 🔷", inline = "4")
src9 = input.source(close, title = "Indicator 9", group = "🔷 🔹  IMPORTS  🔹 🔷", inline = "5")
src0 = input.source(hl2, title = "Indicator 10", group = "🔷 🔹  IMPORTS  🔹 🔷", inline = "5")


srcid(_src,_lvl) =>
    _src == "high"? high:
     _src == "low"? low :
     _src == "open"? open:
     _src == "close"? close:
     _src == "hl2"? hl2:
     _src == "hlc3"? hlc3:
     _src == "ohlc4"? ohlc4:
     _src == "hlcc4"? hlcc4:
     _src == "Indi_1"?src1:
     _src == "Indi_2"?src2:
     _src == "Indi_3"?src3:
     _src == "Indi_4"?src4:
     _src == "Indi_5"?src5:
     _src == "Indi_6"?src6:
     _src == "Indi_7"?src7:
     _src == "Indi_8"?src8:
     _src == "Indi_9"?src9:
     _src == "Indi_10"?src0:
     _src == "Level"?_lvl:
     na

signal(v1, _type, v2) =>
    _type == ">" ? v1 > v2 :
     _type == ">=" ? v1 >= v2 :
     _type == "<" ? v1 < v2 :
     _type == "<=" ? v1 <= v2 :
     _type == "==" ? v1 == v2 :
     _type == "CrossOver" ? v1 > v2 and v1[1] <= v2[1] :
     _type == "CrossUnder" ? v1 < v2 and v1[1] >= v2[1]:
     na

////////////////////////////////
//User Defined Signal Settings//
////////////////////////////////
//Signal 1//
signal1_dir = input.string("Long", options = ["Long","Short","Disabled"], title = "Direction",   group = "🔶 Signal 1 🔶", inline = "0")
signal1_src1 = input.string("Indi_1", options =["Indi_1","Indi_2","Indi_3","Indi_4","Indi_5","Indi_6","Indi_7","Indi_8","Indi_9","Indi_10","open","high","low","close","hl2","hlc3","ohlc4","hlcc4"], title = "Signal ➡",   group = "🔶 Signal 1 🔶", inline = "1")
signal1_func = input.string("CrossOver", options =[">","<","==",">=","<=","CrossOver", "CrossUnder"], title="",  group = "🔶 Signal 1 🔶", inline = "1")
signal1_src2 = input.string("Level", options =["Level","Indi_1","Indi_2","Indi_3","Indi_4","Indi_5","Indi_6","Indi_7","Indi_8","Indi_9","Indi_10","open","high","low","close","hl2","hlc3","ohlc4","hlcc4"], title = "",   group = "🔶 Signal 1 🔶", inline = "1")
signal1_lvl = input.float(0.0, title = "                                                            Level",  group = "🔶 Signal 1 🔶", inline = "3")

signal1_fire = signal(srcid(signal1_src1,0),signal1_func,srcid(signal1_src2,signal1_lvl)) and (signal1_dir != "Disabled")
signal1_long = signal1_fire and signal1_dir == "Long"
signal1_short = signal1_fire and signal1_dir == "Short"
alertcondition(signal1_fire, title = "Signal 1")

//Signal 2//
signal2_dir = input.string("Short", options = ["Long","Short","Disabled"], title = "Direction",   group = "🔶 Signal 2 🔶", inline = "0")
signal2_src1 = input.string("Indi_1", options =["Indi_1","Indi_2","Indi_3","Indi_4","Indi_5","Indi_6","Indi_7","Indi_8","Indi_9","Indi_10","open","high","low","close","hl2","hlc3","ohlc4","hlcc4"], title = "Signal ➡",   group = "🔶 Signal 2 🔶", inline = "1")
signal2_func = input.string("CrossUnder", options =[">","<","==",">=","<=","CrossOver", "CrossUnder"], title="",  group = "🔶 Signal 2 🔶", inline = "1")
signal2_src2 = input.string("Level", options =["Level","Indi_1","Indi_2","Indi_3","Indi_4","Indi_5","Indi_6","Indi_7","Indi_8","Indi_9","Indi_10","open","high","low","close","hl2","hlc3","ohlc4","hlcc4"], title = "",   group = "🔶 Signal 2 🔶", inline = "1")
signal2_lvl = input.float(0.0, title = "                                                            Level",  group = "🔶 Signal 2 🔶", inline = "3")

signal2_fire = signal(srcid(signal2_src1,0),signal2_func,srcid(signal2_src2,signal2_lvl)) and (signal2_dir != "Disabled")
signal2_long = signal2_fire and signal2_dir == "Long"
signal2_short = signal2_fire and signal2_dir == "Short"
alertcondition(signal2_fire, title = "Signal 2")

//Signal 3//
signal3_dir = input.string("Disabled", options = ["Long","Short","Disabled"], title = "Direction",   group = "🔶 Signal 3 🔶", inline = "0")
signal3_src1 = input.string("Indi_5", options =["Indi_1","Indi_2","Indi_3","Indi_4","Indi_5","Indi_6","Indi_7","Indi_8","Indi_9","Indi_10","open","high","low","close","hl2","hlc3","ohlc4","hlcc4"], title = "Signal ➡",   group = "🔶 Signal 3 🔶", inline = "1")
signal3_func = input.string("CrossOver", options =[">","<","==",">=","<=","CrossOver", "CrossUnder"], title="",  group = "🔶 Signal 3 🔶", inline = "1")
signal3_src2 = input.string("Indi_6", options =["Level","Indi_1","Indi_2","Indi_3","Indi_4","Indi_5","Indi_6","Indi_7","Indi_8","Indi_9","Indi_10","open","high","low","close","hl2","hlc3","ohlc4","hlcc4"], title = "",   group = "🔶 Signal 3 🔶", inline = "1")
signal3_lvl = input.float(0.0, title = "                                                            Level",  group = "🔶 Signal 3 🔶", inline = "3")

signal3_fire = signal(srcid(signal3_src1,0),signal3_func,srcid(signal3_src2,signal3_lvl)) and (signal3_dir != "Disabled")
signal3_long = signal3_fire and signal3_dir == "Long"
signal3_short = signal3_fire and signal3_dir == "Short"
alertcondition(signal3_fire, title = "Signal 3")

//Signal 4//
signal4_dir = input.string("Disabled", options = ["Long","Short","Disabled"], title = "Direction",   group = "🔶 Signal 4 🔶", inline = "0")
signal4_src1 = input.string("Indi_7", options =["Indi_1","Indi_2","Indi_3","Indi_4","Indi_5","Indi_6","Indi_7","Indi_8","Indi_9","Indi_10","open","high","low","close","hl2","hlc3","ohlc4","hlcc4"], title = "Signal ➡",   group = "🔶 Signal 4 🔶", inline = "1")
signal4_func = input.string("CrossUnder", options =[">","<","==",">=","<=","CrossOver", "CrossUnder"], title="",  group = "🔶 Signal 4 🔶", inline = "1")
signal4_src2 = input.string("Indi_8", options =["Level","Indi_1","Indi_2","Indi_3","Indi_4","Indi_5","Indi_6","Indi_7","Indi_8","Indi_9","Indi_10","open","high","low","close","hl2","hlc3","ohlc4","hlcc4"], title = "",   group = "🔶 Signal 4 🔶", inline = "1")
signal4_lvl = input.float(0.0, title = "                                                            Level",  group = "🔶 Signal 4 🔶", inline = "3")

signal4_fire = signal(srcid(signal4_src1,0),signal4_func,srcid(signal4_src2,signal4_lvl)) and (signal4_dir != "Disabled")
signal4_long = signal4_fire and signal4_dir == "Long"
signal4_short = signal4_fire and signal4_dir == "Short"
alertcondition(signal4_fire, title = "Signal 4")

//Signal 5//
signal5_dir = input.string("Disabled", options = ["Long","Short","Disabled"], title = "Direction",   group = "🔶 Signal 5 🔶", inline = "0")
signal5_src1 = input.string("Indi_9", options =["Indi_1","Indi_2","Indi_3","Indi_4","Indi_5","Indi_6","Indi_7","Indi_8","Indi_9","Indi_10","open","high","low","close","hl2","hlc3","ohlc4","hlcc4"], title = "Signal ➡",   group = "🔶 Signal 5 🔶", inline = "1")
signal5_func = input.string("CrossOver", options =[">","<","==",">=","<=","CrossOver", "CrossUnder"], title="",  group = "🔶 Signal 5 🔶", inline = "1")
signal5_src2 = input.string("Indi_10", options =["Level","Indi_1","Indi_2","Indi_3","Indi_4","Indi_5","Indi_6","Indi_7","Indi_8","Indi_9","Indi_10","open","high","low","close","hl2","hlc3","ohlc4","hlcc4"], title = "",   group = "🔶 Signal 5 🔶", inline = "1")
signal5_lvl = input.float(0.0, title = "                                                            Level",  group = "🔶 Signal 5 🔶", inline = "3")

signal5_fire = signal(srcid(signal5_src1,0),signal5_func,srcid(signal5_src2,signal5_lvl)) and (signal5_dir != "Disabled")
signal5_long = signal5_fire and signal5_dir == "Long"
signal5_short = signal5_fire and signal5_dir == "Short"
alertcondition(signal5_fire, title = "Signal 5")
/////////////////////
//Signal Automation//
/////////////////////
color1 = input.color(color.lime, title = "Long Color", group = "Signal Settings", inline = "1")
color2 = input.color(color.red, title = "Short Color", group = "Signal Settings", inline = "1")
sz = input.string("tiny", title = "Signal Size", options = ["auto","tiny","small","normal","large","huge"], group = "Signal Settings", inline = "2")
txt_color = input.color(color.rgb(0,0,0,100), title = "Text Color", group = "Signal Settings", inline = "2")

fire_long = signal1_long or signal2_long or signal3_long or signal4_long or signal5_long
fire_short = signal1_short or signal2_short or signal3_short or signal4_short or signal5_short

disp_signal(_signal,_dir,_name) =>
    if _signal and _dir == "Long"
        label.new(bar_index,high, yloc = yloc.abovebar, style = label.style_triangleup, text = _name, color = color1, size = sz, textcolor = txt_color)
    if _signal and _dir == "Short"
        label.new(bar_index,low, yloc = yloc.belowbar, style = label.style_triangledown, text = _name, color = color2, size = sz, textcolor = txt_color)

disp_signal(signal1_fire,signal1_dir,"Signal 1")
disp_signal(signal2_fire,signal2_dir,"Signal 2")
disp_signal(signal3_fire,signal3_dir,"Signal 3")
disp_signal(signal4_fire,signal4_dir,"Signal 4")
disp_signal(signal5_fire,signal5_dir,"Signal 5")