// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © goodgains
// JL
//@version=5
indicator('Faith JL', shorttitle='Faith JL', format=format.volume, overlay=false, explicit_plot_zorder=true, precision=0)
// @keywords: faith-jl, faith-indicator, faith-grade, market-sentiment, buyer-seller-dominance, volume-expansion, hull-moving-average, hull-ma-agreement, aroon, aroon-crossover, buy-volume, sell-volume, volume-split, green-red-percent, atr-stop-loss, multi-symbol-scanner, buy-sell-signals, entry-exit-signals, volume-filter, volume-histogram
// My Indicator AROON START ===========
LengthIndAroon = input.int(title='AROON Ind Length', defval=9, minval=1)
upper = 100 * (ta.highestbars(high, LengthIndAroon) + LengthIndAroon) / LengthIndAroon
lower = 100 * (ta.lowestbars(low, LengthIndAroon) + LengthIndAroon) / LengthIndAroon
buyAroon = ta.crossover(upper, lower)
sellAroon = ta.crossover(lower, upper)
BuyVolume = high == low ? 0 : volume * (close - low) / (high - low)
SellVolume = high == low ? 0 : volume * (high - close) / (high - low)
// My Indicator AROON END ===========
//==============================================================================
// ATR SL INDICATOR START
//==============================================================================
length = input.int(title='ATR Length', defval=14, minval=1, group='--- ATR SL Indicator ---')
smoothing = input.string(title='ATR Smoothing', defval='RMA', options=['RMA', 'SMA', 'EMA', 'WMA'], group='--- ATR SL Indicator ---')
m = input(0.35, 'ATR Multiplier', group='--- ATR SL Indicator ---')
src1 = input(high)
src2 = input(low)
pline = input(false, 'Show Price Lines')
ma_function(source, length) =>
if smoothing == 'RMA'
ta.rma(source, length)
else
if smoothing == 'SMA'
ta.sma(source, length)
else
if smoothing == 'EMA'
ta.ema(source, length)
else
ta.wma(source, length)
a = ma_function(ta.tr(true), length) * m
x = ma_function(ta.tr(true), length) * m + src1
x2 = src2 - ma_function(ta.tr(true), length) * m
//===============================================================
//----- Buy Condition Controls
cl_green = input(true,"Green",group="Buy Condition Controls",inline="a")
cl_vol = input(true,"Volume",group="Buy Condition Controls",inline="a")
cl_minPerc = input(true,"minPerc",group="Buy Condition Controls",inline="a")
cl_maxPerc = input(true,"maxPerc",group="Buy Condition Controls",inline="a")
cl_faith = input(true,"Faith",group="Buy Condition Controls",inline="a")
cl_aroon = input(true,"Aroon",group="Buy Condition Controls",inline="a")
//----- Sell Condition Controls
cs_red = input(true,"Red",group="Sell Condition Controls",inline="a")
cs_vol = input(true,"Volume",group="Sell Condition Controls",inline="a")
cs_minPerc = input(true,"minPerc",group="Sell Condition Controls",inline="a")
cs_maxPerc = input(true,"maxPerc",group="Sell Condition Controls",inline="a")
cs_faith = input(true,"Faith",group="Sell Condition Controls",inline="a")
cs_aroon = input(true,"Aroon",group="Sell Condition Controls",inline="a")
//==============================================================================
//----- getting volume limit parameter inputs
volumeLimit = input.int(999999, 'Volume Limit for chart',group='--- volume limit parameter ---')
volumeLimit1 = input.int(100, 'Volume Limit for symbol 1',group='--- volume limit parameter ---')
volumeLimit2 = input.int(100, 'Volume Limit for symbol 2',group='--- volume limit parameter ---')
volumeLimit3 = input.int(100, 'Volume Limit for symbol 3',group='--- volume limit parameter ---')
volumeLimit4 = input.int(100, 'Volume Limit for symbol 4',group='--- volume limit parameter ---')
volumeLimit5 = input.int(100, 'Volume Limit for symbol 5',group='--- volume limit parameter ---')
volumeLimit6 = input.int(100, 'Volume Limit for symbol 6',group='--- volume limit parameter ---')
volumeLimit7 = input.int(100, 'Volume Limit for symbol 7',group='--- volume limit parameter ---')
volumeLimit8 = input.int(100, 'Volume Limit for symbol 8',group='--- volume limit parameter ---')
volumeLimit9 = input.int(100, 'Volume Limit for symbol 9',group='--- volume limit parameter ---')
volumeLimit10 = input.int(100, 'Volume Limit for symbol 10',group='--- volume limit parameter ---')
//----- getting MIN % limit parameter inputs
MinPerc = input.int(100, 'Min Limit for chart',group='--- MIN % limit parameter ---')
MinPerc1 = input.int(1, 'Min Limit for symbol 1',group='--- MIN % limit parameter ---')
MinPerc2 = input.int(1, 'Min Limit for symbol 2',group='--- MIN % limit parameter ---')
MinPerc3 = input.int(1, 'Min Limit for symbol 3',group='--- MIN % limit parameter ---')
MinPerc4 = input.int(1, 'Min Limit for symbol 4',group='--- MIN % limit parameter ---')
MinPerc5 = input.int(1, 'Min Limit for symbol 5',group='--- MIN % limit parameter ---')
MinPerc6 = input.int(1, 'Min Limit for symbol 5',group='--- MIN % limit parameter ---')
MinPerc7 = input.int(1, 'Min Limit for symbol 7',group='--- MIN % limit parameter ---')
MinPerc8 = input.int(1, 'Min Limit for symbol 8',group='--- MIN % limit parameter ---')
MinPerc9 = input.int(1, 'Min Limit for symbol 9',group='--- MIN % limit parameter ---')
MinPerc10 = input.int(1, 'Min Limit for symbol 10',group='--- MIN % limit parameter ---')
//----- getting MAX % limit parameter inputs
MaxPerc = input.int(0, 'Max Limit for chart',group='--- MAX % limit parameter ---')
MaxPerc1 = input.int(100, 'Max Limit for symbol 1',group='--- MAX % limit parameter ---')
MaxPerc2 = input.int(100, 'Max Limit for symbol 2',group='--- MAX % limit parameter ---')
MaxPerc3 = input.int(100, 'Max Limit for symbol 3',group='--- MAX % limit parameter ---')
MaxPerc4 = input.int(100, 'Max Limit for symbol 4',group='--- MAX % limit parameter ---')
MaxPerc5 = input.int(100, 'Max Limit for symbol 5',group='--- MAX % limit parameter ---')
MaxPerc6 = input.int(100, 'Max Limit for symbol 6',group='--- MAX % limit parameter ---')
MaxPerc7 = input.int(100, 'Max Limit for symbol 7',group='--- MAX % limit parameter ---')
MaxPerc8 = input.int(100, 'Max Limit for symbol 8',group='--- MAX % limit parameter ---')
MaxPerc9 = input.int(100, 'Max Limit for symbol 9',group='--- MAX % limit parameter ---')
MaxPerc10 = input.int(100, 'Max Limit for symbol 10',group='--- MAX % limit parameter ---')
//==============================================================================
// FAITH INDICATOR START
//==============================================================================
per = input(title='Faith Periods for Averaging', defval=10, group='--- FAITH Indicator ---')
fm = input(200, 'Faith Multiplier', group='--- FAITH Indicator ---')
fd= input(30, 'Faith LookBack Days', group='--- FAITH Indicator ---')
//Backgroud colors taken from Hull Moving Average Agreement Indicator (Hullag)
fa = input(20, 'Faith Number of periods for fast HullMA', group='--- FAITH Indicator ---')
fb = input(25, 'Faith Number of periods for slow HullMA', group='--- FAITH Indicator ---')
fc = input(0.1, 'Faith Min ATR difference required to call the MA a trend', group='--- FAITH Indicator ---')
ft = input(30, 'Faith Calculate min ATR as a kind of tangent', group='--- FAITH Indicator ---')
up = high > high[1] and volume > volume[1] //Buyers volume when both higher high and more volume
down = low < low[1] and volume > volume[1] //Sellers volume when both lower low and more volume
vproc = volume / ta.highest(volume, fd) * fm //Used for calculation of volume expansion in a kind of percentage
volup = up ? vproc : 0 //Entered in the series of Buyers volume
voldown = down ? vproc : 0 //Entered in the series of Sellers volume
maup = ta.sma(volup, per) //Average Buyers volume, sma and 10 periods seem to work best
madown = ta.sma(voldown, per) //Average Sellers volume
difvol = maup - madown //Faith of the market, i.e. buyers dominate the volume or sellers dominate it
u1 = difvol > 60 ? 8 : 0 //Very high faith graduated as 8
u2 = difvol > 40 and difvol <= 60 ? 6 : 0 //High faith as 6
u3 = difvol > 20 and difvol <= 40 ? 4 : 0 //Good faith as 4
u4 = difvol > 10 and difvol <= 20 ? 2 : 0 //Some Faith as 2
u5 = difvol > 0 and difvol <= 10 ? 1 : 0 //Little Faith as 1
d1 = difvol < -60 ? -8 : 0 //Very High mistrust graduated as -8
d2 = difvol < -40 and difvol >= -60 ? -6 : 0 //High Mistrust as -6
d3 = difvol < -20 and difvol >= -40 ? -4 : 0 //Bad Mistrust as -4
d4 = difvol < -10 and difvol >= -20 ? -2 : 0 //Some Mistrust as -2
d5 = difvol < 0 and difvol >= -10 ? -1 : 0 //Little Mistrust as -1
dif = u1 + u2 + u3 + u4 + u5 + d1 + d2 + d3 + d4 + d5 //Grades are either zero or something, adding them all up gives the grade in this instance
fhl = fa //number of periods for fast Hull ma
shl = fb //number of periods for slow Hull ma
trnd = fc //minimum ATR difference required to call the ma a trend
istrend = trnd * ta.atr(ft) //Calculate minimum ATR as a kind of tangent
fh = ta.hma(close, fhl) //fast Hull Moving Average
fangle = fh[0] - fh[1] //angle of fast hull slope calculated as a kind of tangent
var ftrend = 0 //initialise fast trend graduation
ftrend := fangle > istrend ? 1 : fangle < -istrend ? -1 : 0 //fast trend either 1, 0 or -1 meaning uptrend, no trend, down trend
sh = ta.hma(close, shl) //slow Hull Moving Average
sangle = sh[0] - sh[1] //angle of slow hull slope as a kind of tangent
var strend = 0 // initialise slow trend graduation
strend := sangle > istrend ? 1 : sangle < -istrend ? -1 : 0 //slow trend either 1, 0 or -1 meaning uptrend, no trend, down trend
hullag = ftrend + strend //possible graduations are 2, 1, 0, -1, -2
bg2 = color.new(color.blue, 65) //color when both hma agree on up trend, i.e. grade 2
bg1 = color.new(color.green, 75) //color when one hma has up trend, one no trend, i.e. grade 1
bg0 = color.new(color.silver, 85) //color when either both hma have no trend or have opposite trend, i.e. grad zero
bgm1 = color.new(color.maroon, 80) //color when one hma has down trend, one no trend, i.e. grade -1
bgm2 = color.new(color.red, 65) // color when both hma agree on down trend, i.e. grade -2
bgcolor(hullag == 2 ? bg2 : hullag == 1 ? bg1 : hullag == 0 ? bg0 : hullag == -1 ? bgm1 : bgm2, transp=90)
// PLOT Faith Histogram
plot(dif, 'FAITH Grade of Faith', dif > 0 ? color.blue : color.red, style=plot.style_circles, linewidth=5, transp=0)
// FAITH INDICATOR END
//==============================================================================
//----------------------------------------
//----- getting symbols input
symbol1 = input.symbol("BINANCE:ADAUSDT",'symbol 1', group = '--- symbols to scan ---')
symbol2 = input.symbol("BINANCE:ANKRUSDT",'symbol 2', group = '--- symbols to scan ---')
symbol3 = input.symbol("BINANCE:BTCUSDT",'symbol 3', group = '--- symbols to scan ---')
symbol4 = input.symbol("BINANCE:CHZUSDT",'symbol 4', group = '--- symbols to scan ---')
symbol5 = input.symbol("BINANCE:ETHUSDT",'symbol 5', group = '--- symbols to scan ---')
symbol6 = input.symbol("BINANCE:SHIBUSDT",'symbol 6', group = '--- symbols to scan ---')
symbol7 = input.symbol("BINANCE:TRXUSDT",'symbol 7', group = '--- symbols to scan ---')
symbol8 = input.symbol("BINANCE:XLMUSDT",'symbol 8', group = '--- symbols to scan ---')
symbol9 = input.symbol("BINANCE:XMRUSDT",'symbol 9', group = '--- symbols to scan ---')
symbol10 = input.symbol("BINANCE:XRPUSDT",'symbol 10', group = '--- symbols to scan ---')
// Contains the script logic for buy and sell => returns 4 alert signals
get_Sig(volumeLimit,minPerc,maxPerc) =>
// START CALC Percent calculation G/R over R/G and AROON indicator and Faith indicator
tv = volume == 0 ? 1 : volume
BuyVolume = high == low ? 0 : volume * (close - low) / (high - low)
SellVolume = high == low ? 0 : volume * (high - close) / (high - low)
PercG = BuyVolume * 100 / (BuyVolume + SellVolume)
PercR = SellVolume * 100 / (BuyVolume + SellVolume)
RozdielPercGminR = PercG - PercR
RozdielPercRminG = PercR - PercG
// END CALC percent
/// Aroon Data
upper = 100 * (ta.highestbars(high, LengthIndAroon) + LengthIndAroon) / LengthIndAroon
lower = 100 * (ta.lowestbars(low, LengthIndAroon) + LengthIndAroon) / LengthIndAroon
buyAroon = ta.crossover(upper, lower)
sellAroon = ta.crossover(lower, upper)
/// Faith Data
up = high > high[1] and volume > volume[1] //Buyers volume when both higher high and more volume
down = low < low[1] and volume > volume[1] //Sellers volume when both lower low and more volume
vproc = volume / ta.highest(volume, fd) * fm //Used for calculation of volume expansion in a kind of percentage
volup = up ? vproc : 0 //Entered in the series of Buyers volume
voldown = down ? vproc : 0 //Entered in the series of Sellers volume
maup = ta.sma(volup, per) //Average Buyers volume, sma and 10 periods seem to work best
madown = ta.sma(voldown, per) //Average Sellers volume
difvol = maup - madown //Faith of the market, i.e. buyers dominate the volume or sellers dominate it
u1 = difvol > 60 ? 8 : 0 //Very high faith graduated as 8
u2 = difvol > 40 and difvol <= 60 ? 6 : 0 //High faith as 6
u3 = difvol > 20 and difvol <= 40 ? 4 : 0 //Good faith as 4
u4 = difvol > 10 and difvol <= 20 ? 2 : 0 //Some Faith as 2
u5 = difvol > 0 and difvol <= 10 ? 1 : 0 //Little Faith as 1
d1 = difvol < -60 ? -8 : 0 //Very High mistrust graduated as -8
d2 = difvol < -40 and difvol >= -60 ? -6 : 0 //High Mistrust as -6
d3 = difvol < -20 and difvol >= -40 ? -4 : 0 //Bad Mistrust as -4
d4 = difvol < -10 and difvol >= -20 ? -2 : 0 //Some Mistrust as -2
d5 = difvol < 0 and difvol >= -10 ? -1 : 0 //Little Mistrust as -1
dif = u1 + u2 + u3 + u4 + u5 + d1 + d2 + d3 + d4 + d5 //Grades are either zero or something, adding them all up gives the grade in this instance
fhl = fa //number of periods for fast Hull ma
shl = fb //number of periods for slow Hull ma
trnd = fc //minimum ATR difference required to call the ma a trend
istrend = trnd * ta.atr(ft) //Calculate minimum ATR as a kind of tangent
fh = ta.hma(close, fhl) //fast Hull Moving Average
fangle = fh[0] - fh[1] //angle of fast hull slope calculated as a kind of tangent
var ftrend = 0 //initialise fast trend graduation
ftrend := fangle > istrend ? 1 : fangle < -istrend ? -1 : 0 //fast trend either 1, 0 or -1 meaning uptrend, no trend, down trend
sh = ta.hma(close, shl) //slow Hull Moving Average
sangle = sh[0] - sh[1] //angle of slow hull slope as a kind of tangent
var strend = 0 // initialise slow trend graduation
strend := sangle > istrend ? 1 : sangle < -istrend ? -1 : 0 //slow trend either 1, 0 or -1 meaning uptrend, no trend, down trend
hullag = ftrend + strend //possible graduations are 2, 1, 0, -1, -2
buyFaith = (difvol > 10) and (hullag == 2)
sellFaith = (difvol < -10) and (hullag == -2)
////
var pos = 0
var sl = 0.0
buySig = false
sellSig = false
exitBuySig = false
exitSellSig = false
a = ma_function(ta.tr(true), length) * m
x = ma_function(ta.tr(true), length) * m + src1
x2 = src2 - ma_function(ta.tr(true), length) * m
longSl = x2
shortSl = x
//Buy Conditions
lGreen = cl_green? close > open : true
lVolume = cl_vol? volume > volumeLimit : true
lPercRange = (cl_minPerc ?(RozdielPercGminR >= minPerc) : true) and (cl_maxPerc? (RozdielPercGminR <= maxPerc) : true)
lFaith = cl_faith? buyFaith : true
lAroon = cl_aroon? buyAroon : true
allLDisabled = not cl_green and not cl_vol and not cl_minPerc and not maxPerc and not cl_faith and not cl_aroon
// ======= MY BUY CONDITIONS =========
buy = lGreen and lVolume and lPercRange and lFaith and lAroon and not allLDisabled
if buy //and pos!=1
pos := 1
sl := longSl
buySig := true
//Sell Conditions
sRed = cs_red? (close < open) : true
sVolume = cs_vol? (volume > volumeLimit) : true
sPercRange = (cs_minPerc ?(RozdielPercRminG >= minPerc) : true) and (cs_maxPerc? (RozdielPercRminG <= maxPerc) : true)
sFaith = cs_faith? sellFaith : true
sAroon = cs_aroon? sellAroon : true
allSDisabled = not cs_red and not cs_vol and not cs_minPerc and not cs_maxPerc and not cs_faith and not cs_aroon
// ======= MY SELL CONDITIONS =========
sell = sRed and sVolume and sPercRange and sFaith and sAroon and not allSDisabled
if sell //and pos != -1 //Replace "false" with your short position
pos := -1
sl := shortSl
sellSig := true
if pos == 1
if low < sl
pos := 0
exitBuySig := true
if pos == -1
if high > sl
pos := 0
exitSellSig := true
[buySig,sellSig,exitBuySig,exitSellSig]
/////////////// Calculating get_Sig() for current chart
volL = volumeLimit
mnPerc = MinPerc
mxPerc = MaxPerc
// Line symbol 1
if ((syminfo.tickerid == symbol1) or (syminfo.tickerid == ticker.heikinashi(symbol1))) // Check if current ticker is whatever selected in symbol 1
volL := volumeLimit1
mnPerc := MinPerc1
mxPerc := MaxPerc1
// Line symbol 2
if ((syminfo.tickerid == symbol2) or (syminfo.tickerid == ticker.heikinashi(symbol2)))
volL := volumeLimit2
mnPerc := MinPerc2
mxPerc := MaxPerc2
// Line symbol 3
if ((syminfo.tickerid == symbol3) or (syminfo.tickerid == ticker.heikinashi(symbol3)))
volL := volumeLimit3
mnPerc := MinPerc3
mxPerc := MaxPerc3
// Line symbol 4
if ((syminfo.tickerid == symbol4) or (syminfo.tickerid == ticker.heikinashi(symbol4)))
volL := volumeLimit4
mnPerc := MinPerc4
mxPerc := MaxPerc4
// Line symbol 5
if ((syminfo.tickerid == symbol5) or (syminfo.tickerid == ticker.heikinashi(symbol5)))
volL := volumeLimit5
mnPerc := MinPerc5
mxPerc := MaxPerc5
// Line symbol 6
if ((syminfo.tickerid == symbol6) or (syminfo.tickerid == ticker.heikinashi(symbol6)))
volL := volumeLimit6
mnPerc := MinPerc6
mxPerc := MaxPerc6
// Line symbol 7
if ((syminfo.tickerid == symbol7) or (syminfo.tickerid == ticker.heikinashi(symbol7)))
volL := volumeLimit7
mnPerc := MinPerc7
mxPerc := MaxPerc7
// Line symbol 8
if ((syminfo.tickerid == symbol8) or (syminfo.tickerid == ticker.heikinashi(symbol8)))
volL := volumeLimit8
mnPerc := MinPerc8
mxPerc := MaxPerc8
// Line symbol 9
if ((syminfo.tickerid == symbol9) or (syminfo.tickerid == ticker.heikinashi(symbol9)))
volL := volumeLimit9
mnPerc := MinPerc9
mxPerc := MaxPerc9
// Line symbol 10
if ((syminfo.tickerid == symbol10) or (syminfo.tickerid == ticker.heikinashi(symbol10)))
volL := volumeLimit10
mnPerc := MinPerc10
mxPerc := MaxPerc10
plot(volL)
[buyS,sellS,exitBuyS,exitSellS] = get_Sig(volL,mnPerc,mxPerc)
// FINAL indicator START SIGNS
plotshape(buyS, location=location.top, title='BUY', style=shape.triangleup, size=size.tiny, color=color.new(color.green, 0))
plotshape(sellS, location=location.top, title='SELL', style=shape.triangledown, size=size.tiny, color=color.new(color.red, 0))
plotshape(exitBuyS, location=location.top, title='Exit BUY', style=shape.xcross, size=size.tiny, color=color.new(color.green, 0))
plotshape(exitSellS, location=location.top, title='Exit SELL', style=shape.xcross, size=size.tiny, color=color.new(color.red, 0))
// FINAL indicator END SIGNS
//----------------------------------------
barmergeGapsI = input.bool(false, "Gaps") ? barmerge.gaps_on : barmerge.gaps_off
barmergeLookaheadI = input.bool(true, "Lookahead") ? barmerge.lookahead_on : barmerge.lookahead_off
//////////////// calculating get_sig() for all selected symbols to be notified when there is an alert NOT SURE IF BUYFAITH SHOULD BE HERE
[buySignal1,sellSignal1,buyExitSignal1,sellExitSignal1] = request.security(symbol1, timeframe.period, get_Sig(volumeLimit1,MinPerc1,MaxPerc1), gaps=barmergeGapsI, lookahead=barmergeLookaheadI)
[buySignal2,sellSignal2,buyExitSignal2,sellExitSignal2] = request.security(symbol2, timeframe.period, get_Sig(volumeLimit2,MinPerc2,MaxPerc2), gaps=barmergeGapsI, lookahead=barmergeLookaheadI)
[buySignal3,sellSignal3,buyExitSignal3,sellExitSignal3] = request.security(symbol3, timeframe.period, get_Sig(volumeLimit3,MinPerc3,MaxPerc3), gaps=barmergeGapsI, lookahead=barmergeLookaheadI)
[buySignal4,sellSignal4,buyExitSignal4,sellExitSignal4] = request.security(symbol4, timeframe.period, get_Sig(volumeLimit4,MinPerc4,MaxPerc4), gaps=barmergeGapsI, lookahead=barmergeLookaheadI)
[buySignal5,sellSignal5,buyExitSignal5,sellExitSignal5] = request.security(symbol5, timeframe.period, get_Sig(volumeLimit5,MinPerc5,MaxPerc5), gaps=barmergeGapsI, lookahead=barmergeLookaheadI)
[buySignal6,sellSignal6,buyExitSignal6,sellExitSignal6] = request.security(symbol6, timeframe.period, get_Sig(volumeLimit6,MinPerc6,MaxPerc6), gaps=barmergeGapsI, lookahead=barmergeLookaheadI)
[buySignal7,sellSignal7,buyExitSignal7,sellExitSignal7] = request.security(symbol7, timeframe.period, get_Sig(volumeLimit7,MinPerc7,MaxPerc7), gaps=barmergeGapsI, lookahead=barmergeLookaheadI)
[buySignal8,sellSignal8,buyExitSignal8,sellExitSignal8] = request.security(symbol8, timeframe.period, get_Sig(volumeLimit8,MinPerc8,MaxPerc8), gaps=barmergeGapsI, lookahead=barmergeLookaheadI)
[buySignal9,sellSignal9,buyExitSignal9,sellExitSignal9] = request.security(symbol9, timeframe.period, get_Sig(volumeLimit9,MinPerc9,MaxPerc9), gaps=barmergeGapsI, lookahead=barmergeLookaheadI)
[buySignal10,sellSignal10,buyExitSignal10,sellExitSignal10] = request.security(symbol10, timeframe.period, get_Sig(volumeLimit10,MinPerc10,MaxPerc10), gaps=barmergeGapsI, lookahead=barmergeLookaheadI)
// // AROON indicator START signs
plotshape(buyAroon, location=location.top, title='Aroon Buy', style=shape.diamond, size=size.tiny, color=color.new(color.yellow, 0 ))
plotshape(sellAroon, location=location.top, title='Aroon Sell', style=shape.diamond, size=size.tiny, color=color.new(color.orange, 0))
// // AROON indicator END signs
//------------------------------------------
//----- to store the list of symbols as per their entries
entrySignalsLabel = "Entry Signals \n"
exitSignalsLabel = "Exit Signals \n"
//-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/- // symbol 1
//symbol wise checking of posiiton
//entering the trade
if buySignal1 and symbol1 != ""
entrySignalsLabel := entrySignalsLabel + symbol1 + "\n"
// exiting the trade
if buyExitSignal1 and symbol1 != ""
exitSignalsLabel := exitSignalsLabel + symbol1 + "\n"
//-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/- // symbol 2
if buySignal2 and symbol2 != ""
entrySignalsLabel := entrySignalsLabel + symbol2 + "\n"
if buyExitSignal2 and symbol2 != ""
exitSignalsLabel := exitSignalsLabel + symbol2 + "\n"
//-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/- // symbol 3
if buySignal3 and symbol3 != ""
entrySignalsLabel := entrySignalsLabel + symbol3 + "\n"
if buyExitSignal3 and symbol3 != ""
exitSignalsLabel := exitSignalsLabel + symbol3 + "\n"
//-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/- // symbol 4
if buySignal4 and symbol4 != ""
entrySignalsLabel := entrySignalsLabel + symbol4 + "\n"
if buyExitSignal4 and symbol4 != ""
exitSignalsLabel := exitSignalsLabel + symbol4 + "\n"
//-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/- // symbol 5
if buySignal5 and symbol5 != ""
entrySignalsLabel := entrySignalsLabel + symbol5 + "\n"
if buyExitSignal5 and symbol5 != ""
exitSignalsLabel := exitSignalsLabel + symbol5 + "\n"
//-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/- // symbol 6
if buySignal6 and symbol6 != ""
entrySignalsLabel := entrySignalsLabel + symbol6 + "\n"
if buyExitSignal6 and symbol6 != ""
exitSignalsLabel := exitSignalsLabel + symbol6 + "\n"
//-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/- // symbol 7
if buySignal7 and symbol7 != ""
entrySignalsLabel := entrySignalsLabel + symbol7 + "\n"
if buyExitSignal7 and symbol7 != ""
exitSignalsLabel := exitSignalsLabel + symbol7 + "\n"
//-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/- // symbol 8
if buySignal8 and symbol8 != ""
entrySignalsLabel := entrySignalsLabel + symbol8 + "\n"
if buyExitSignal8 and symbol8 != ""
exitSignalsLabel := exitSignalsLabel + symbol8 + "\n"
//-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/- // symbol 9
if buySignal9 and symbol9 != ""
entrySignalsLabel := entrySignalsLabel + symbol9 + "\n"
if buyExitSignal9 and symbol9 != ""
exitSignalsLabel := exitSignalsLabel + symbol9 + "\n"
//-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/- // symbol 10
if buySignal10 and symbol10 != ""
entrySignalsLabel := entrySignalsLabel + symbol10 + "\n"
if buyExitSignal10 and symbol10 != ""
exitSignalsLabel := exitSignalsLabel + symbol10 + "\n"
// PLOTS Volume
plot(volume, title='ALL ORDERS', style=plot.style_histogram, color=close > open ? #00ffaa : #FF5252, trackprice=true)
plot(BuyVolume, title='BUYERS', style=plot.style_columns, color=color.new(#74cb61, 0))
plot(SellVolume, title='SELLERS', style=plot.style_columns, color=color.new(#f33d4f, 12))
// ====================== VOLUME LINES START ======================
float line_value = na
can_draw_line = false
// Line symbol 1
if ((syminfo.tickerid == symbol1) or (syminfo.tickerid == ticker.heikinashi(symbol1))) // Check if current ticker is whatever selected in symbol 1
can_draw_line := true
line_value := volumeLimit1
// Draw the only once
if barstate.isfirst and can_draw_line
line.new(bar_index, line_value, bar_index+1, line_value, extend=extend.both, color=color.blue, style=line.style_dotted, width=1)
// Line symbol 2
if ((syminfo.tickerid == symbol2) or (syminfo.tickerid == ticker.heikinashi(symbol2)))
can_draw_line := true
line_value := volumeLimit2
if barstate.isfirst and can_draw_line
line.new(bar_index, line_value, bar_index+1, line_value, extend=extend.both, color=color.blue, style=line.style_dotted, width=1)
// Line symbol 3
if ((syminfo.tickerid == symbol3) or (syminfo.tickerid == ticker.heikinashi(symbol3)))
can_draw_line := true
line_value := volumeLimit3
if barstate.isfirst and can_draw_line
line.new(bar_index, line_value, bar_index+1, line_value, extend=extend.both, color=color.blue, style=line.style_dotted, width=1)
// Line symbol 4
if ((syminfo.tickerid == symbol4) or (syminfo.tickerid == ticker.heikinashi(symbol4)))
can_draw_line := true
line_value := volumeLimit4
if barstate.isfirst and can_draw_line
line.new(bar_index, line_value, bar_index+1, line_value, extend=extend.both, color=color.blue, style=line.style_dotted, width=1)
// Line symbol 5
if ((syminfo.tickerid == symbol5) or (syminfo.tickerid == ticker.heikinashi(symbol5)))
can_draw_line := true
line_value := volumeLimit5
if barstate.isfirst and can_draw_line
line.new(bar_index, line_value, bar_index+1, line_value, extend=extend.both, color=color.blue, style=line.style_dotted, width=1)
// Line symbol 6
if ((syminfo.tickerid == symbol6) or (syminfo.tickerid == ticker.heikinashi(symbol6)))
can_draw_line := true
line_value := volumeLimit6
if barstate.isfirst and can_draw_line
line.new(bar_index, line_value, bar_index+1, line_value, extend=extend.both, color=color.blue, style=line.style_dotted, width=1)
// Line symbol 7
if ((syminfo.tickerid == symbol7) or (syminfo.tickerid == ticker.heikinashi(symbol7)))
can_draw_line := true
line_value := volumeLimit7
if barstate.isfirst and can_draw_line
line.new(bar_index, line_value, bar_index+1, line_value, extend=extend.both, color=color.blue, style=line.style_dotted, width=1)
// Line symbol 8
if ((syminfo.tickerid == symbol8) or (syminfo.tickerid == ticker.heikinashi(symbol8)))
can_draw_line := true
line_value := volumeLimit8
if barstate.isfirst and can_draw_line
line.new(bar_index, line_value, bar_index+1, line_value, extend=extend.both, color=color.blue, style=line.style_dotted, width=1)
// Line symbol 9
if ((syminfo.tickerid == symbol9) or (syminfo.tickerid == ticker.heikinashi(symbol9)))
can_draw_line := true
line_value := volumeLimit9
if barstate.isfirst and can_draw_line
line.new(bar_index, line_value, bar_index+1, line_value, extend=extend.both, color=color.blue, style=line.style_dotted, width=1)
// Line symbol 10
if ((syminfo.tickerid == symbol10) or (syminfo.tickerid == ticker.heikinashi(symbol10)))
can_draw_line := true
line_value := volumeLimit10
if barstate.isfirst and can_draw_line
line.new(bar_index, line_value, bar_index+1, line_value, extend=extend.both, color=color.blue, style=line.style_dotted, width=1)
alertDrop = input.string("Chart","Alert For",options=["Chart","S1","S2","S3","S4","S5","S6","S7","S8","S9","S10"],group="Alerts")
closure = input.string("Once Per Bar","Alert Type",options=["Once Per Bar","Once Per Close"],group="Alerts")
alert_chart = alertDrop == "Chart"
alert_s1 = alertDrop == "S1"
alert_s2 = alertDrop == "S2"
alert_s3 = alertDrop == "S3"
alert_s4 = alertDrop == "S4"
alert_s5 = alertDrop == "S5"
alert_s6 = alertDrop == "S6"
alert_s7 = alertDrop == "S7"
alert_s8 = alertDrop == "S8"
alert_s9 = alertDrop == "S9"
alert_s10 = alertDrop == "S10"
// Long Entry Messages
chartLongEntry=input.string(""," Chart",group='Long Entry Messages',inline="a")
Long1Entry = input.string('{ "message_type": "bot", "bot_id": 1, "email_token": "c41bcb3c-e364-4c37-974b-f6f62607d4ec", "delay_seconds": 0}'," S1", group='Long Entry Messages',inline="a")
Long2Entry = input.string('{ "message_type": "bot", "bot_id": 2, "email_token": "c41bcb3c-e364-4c37-974b-f6f62607d4ec", "delay_seconds": 0}'," S2", group='Long Entry Messages',inline="a")
Long3Entry = input.string('{ "message_type": "bot", "bot_id": 3, "email_token": "c41bcb3c-e364-4c37-974b-f6f62607d4ec", "delay_seconds": 0}'," S3", group='Long Entry Messages',inline="a")
Long4Entry = input.string('{ "message_type": "bot", "bot_id": 4, "email_token": "c41bcb3c-e364-4c37-974b-f6f62607d4ec", "delay_seconds": 0}'," S4", group='Long Entry Messages',inline="a")
Long5Entry = input.string('{ "message_type": "bot", "bot_id": 5, "email_token": "c41bcb3c-e364-4c37-974b-f6f62607d4ec", "delay_seconds": 0}'," S5", group='Long Entry Messages',inline="a")
Long6Entry = input.string('{ "message_type": "bot", "bot_id": 6, "email_token": "c41bcb3c-e364-4c37-974b-f6f62607d4ec", "delay_seconds": 0}'," S6", group='Long Entry Messages',inline="a")
Long7Entry = input.string('{ "message_type": "bot", "bot_id": 7, "email_token": "c41bcb3c-e364-4c37-974b-f6f62607d4ec", "delay_seconds": 0}'," S7", group='Long Entry Messages',inline="a")
Long8Entry = input.string('{ "message_type": "bot", "bot_id": 8, "email_token": "c41bcb3c-e364-4c37-974b-f6f62607d4ec", "delay_seconds": 0}'," S8", group='Long Entry Messages',inline="a")
Long9Entry= input.string('{ "message_type": "bot", "bot_id": 9, "email_token": "c41bcb3c-e364-4c37-974b-f6f62607d4ec", "delay_seconds": 0}'," S9", group='Long Entry Messages',inline="a")
Long10Entry= input.string('{ "message_type": "bot", "bot_id": 10, "email_token": "c41bcb3c-e364-4c37-974b-f6f62607d4ec", "delay_seconds": 0}'," S10", group='Long Entry Messages',inline="a")
// Long Exit Messages
chartLongExit = input.string("","Chart", group='Long Exit Messages',inline="a")
Long1Exit = input.string('{ "action": "close_at_market_price", "message_type": "bot", "bot_id": 1, "email_token": "c41bcb3c-e364-4c37-974b-f6f62607d4ec", "delay_seconds": 0}',"S1", group='Long Exit Messages',inline="a")
Long2Exit = input.string('{ "action": "close_at_market_price", "message_type": "bot", "bot_id": 2, "email_token": "c41bcb3c-e364-4c37-974b-f6f62607d4ec", "delay_seconds": 0}',"S2", group='Long Exit Messages',inline="a")
Long3Exit = input.string('{ "action": "close_at_market_price", "message_type": "bot", "bot_id": 3, "email_token": "c41bcb3c-e364-4c37-974b-f6f62607d4ec", "delay_seconds": 0}',"S3", group='Long Exit Messages',inline="a")
Long4Exit = input.string('{ "action": "close_at_market_price", "message_type": "bot", "bot_id": 4, "email_token": "c41bcb3c-e364-4c37-974b-f6f62607d4ec", "delay_seconds": 0}',"S4", group='Long Exit Messages',inline="a")
Long5Exit = input.string('{ "action": "close_at_market_price", "message_type": "bot", "bot_id": 5, "email_token": "c41bcb3c-e364-4c37-974b-f6f62607d4ec", "delay_seconds": 0}',"S5", group='Long Exit Messages',inline="a")
Long6Exit = input.string('{ "action": "close_at_market_price", "message_type": "bot", "bot_id": 6, "email_token": "c41bcb3c-e364-4c37-974b-f6f62607d4ec", "delay_seconds": 0}',"S6", group='Long Exit Messages',inline="a")
Long7Exit = input.string('{ "action": "close_at_market_price", "message_type": "bot", "bot_id": 7, "email_token": "c41bcb3c-e364-4c37-974b-f6f62607d4ec", "delay_seconds": 0}',"S7", group='Long Exit Messages',inline="a")
Long8Exit = input.string('{ "action": "close_at_market_price", "message_type": "bot", "bot_id": 8, "email_token": "c41bcb3c-e364-4c37-974b-f6f62607d4ec", "delay_seconds": 0}',"S8", group='Long Exit Messages',inline="a")
Long9Exit = input.string('{ "action": "close_at_market_price", "message_type": "bot", "bot_id": 9, "email_token": "c41bcb3c-e364-4c37-974b-f6f62607d4ec", "delay_seconds": 0}',"S9", group='Long Exit Messages',inline="a")
Long10Exit = input.string('{ "action": "close_at_market_price", "message_type": "bot", "bot_id": 10, "email_token": "c41bcb3c-e364-4c37-974b-f6f62607d4ec", "delay_seconds": 0}',"S10", group='Long Exit Messages',inline="a")
//Short Entry Messages
chartShortEntry=input.string(""," Chart",group='Short Entry Messages',inline="a")
Short1Entry = input.string(""," S1", group='Short Entry Messages',inline="a")
Short2Entry = input.string(""," S2", group='Short Entry Messages',inline="a")
Short3Entry = input.string(""," S3", group='Short Entry Messages',inline="a")
Short4Entry = input.string(""," S4", group='Short Entry Messages',inline="a")
Short5Entry = input.string(""," S5", group='Short Entry Messages',inline="a")
Short6Entry = input.string(""," S6", group='Short Entry Messages',inline="a")
Short7Entry = input.string(""," S7", group='Short Entry Messages',inline="a")
Short8Entry = input.string(""," S8", group='Short Entry Messages',inline="a")
Short9Entry= input.string(""," S9", group='Short Entry Messages',inline="a")
Short10Entry= input.string(""," S10", group='Short Entry Messages',inline="a")
//Short Exit Messages
chartShortExit=input.string(""," Chart",group='Short Exit Messages',inline="a")
Short1Exit = input.string(""," S1", group='Short Exit Messages',inline="a")
Short2Exit = input.string(""," S2", group='Short Exit Messages',inline="a")
Short3Exit = input.string(""," S3", group='Short Exit Messages',inline="a")
Short4Exit = input.string(""," S4", group='Short Exit Messages',inline="a")
Short5Exit = input.string(""," S5", group='Short Exit Messages',inline="a")
Short6Exit = input.string(""," S6", group='Short Exit Messages',inline="a")
Short7Exit = input.string(""," S7", group='Short Exit Messages',inline="a")
Short8Exit = input.string(""," S8", group='Short Exit Messages',inline="a")
Short9Exit= input.string(""," S9", group='Short Exit Messages',inline="a")
Short10Exit= input.string(""," S10", group='Short Exit Messages',inline="a")
BuySig = (alert_chart and buyS) or (alert_s1 and buySignal1) or (alert_s2 and buySignal2) or (alert_s3 and buySignal3) or (alert_s4 and buySignal4) or (alert_s5 and buySignal5) or (alert_s6 and buySignal6) or (alert_s7 and buySignal7) or (alert_s8 and buySignal8) or (alert_s9 and buySignal9) or (alert_s10 and buySignal10)
ExitBuy = (alert_chart and exitBuyS) or (alert_s1 and buyExitSignal1) or (alert_s2 and buyExitSignal2) or (alert_s3 and buyExitSignal3) or (alert_s4 and buyExitSignal4) or (alert_s5 and buyExitSignal5) or (alert_s6 and buyExitSignal6) or (alert_s7 and buyExitSignal7) or (alert_s8 and buyExitSignal8) or (alert_s9 and buyExitSignal9) or (alert_s10 and buyExitSignal10)
SellSig = (alert_chart and sellS) or (alert_s1 and sellSignal1) or (alert_s2 and sellSignal2) or (alert_s3 and sellSignal3) or (alert_s4 and sellSignal4) or (alert_s5 and sellSignal5) or (alert_s6 and sellSignal6) or (alert_s7 and sellSignal7) or (alert_s8 and sellSignal8) or (alert_s9 and sellSignal9) or (alert_s10 and sellSignal10)
ExitSell = (alert_chart and exitSellS) or (alert_s1 and sellExitSignal1) or (alert_s2 and sellExitSignal2) or (alert_s3 and sellExitSignal3) or (alert_s4 and sellExitSignal4) or (alert_s5 and sellExitSignal5) or (alert_s6 and sellExitSignal6) or (alert_s7 and sellExitSignal7) or (alert_s8 and sellExitSignal8) or (alert_s9 and sellExitSignal9) or (alert_s10 and sellExitSignal10)
longEntryMsg = (alert_chart and buyS)? chartLongEntry : (alert_s1 and buySignal1)? Long1Entry : (alert_s2 and buySignal2)? Long2Entry : (alert_s3 and buySignal3)? Long3Entry : (alert_s4 and buySignal4)? Long4Entry : (alert_s5 and buySignal5)? Long5Entry : (alert_s6 and buySignal6)? Long6Entry : (alert_s7 and buySignal7) ? Long7Entry : (alert_s8 and buySignal8)? Long8Entry : (alert_s9 and buySignal9)? Long9Entry : (alert_s10 and buySignal10)? Long10Entry : ""
longExitMsg = (alert_chart and exitBuyS)? chartLongExit : (alert_s1 and buyExitSignal1)? Long1Exit : (alert_s2 and buyExitSignal2) ? Long2Exit : (alert_s3 and buyExitSignal3)? Long3Exit : (alert_s4 and buyExitSignal4) ? Long4Exit : (alert_s5 and buyExitSignal5)? Long5Exit : (alert_s6 and buyExitSignal6)? Long6Exit : (alert_s7 and buyExitSignal7)? Long7Exit : (alert_s8 and buyExitSignal8)? Long8Exit : (alert_s9 and buyExitSignal9)?Long9Exit : (alert_s10 and buyExitSignal10)?Long10Exit : ""
shortEntryMsg = (alert_chart and sellS)? chartShortEntry : (alert_s1 and sellSignal1)? Short1Entry : (alert_s2 and sellSignal2)? Short2Entry : (alert_s3 and sellSignal3)? Short3Entry : (alert_s4 and sellSignal4)? Short4Entry : (alert_s5 and sellSignal5)? Short5Entry :(alert_s6 and sellSignal6)? Short6Entry : (alert_s7 and sellSignal7)? Short7Entry : (alert_s8 and sellSignal8)? Short8Entry : (alert_s9 and sellSignal9)? Short9Entry : (alert_s10 and sellSignal10)? Short10Entry : ""
shortExitMsg = (alert_chart and exitSellS)? chartShortExit : (alert_s1 and sellExitSignal1)? Short1Exit : (alert_s2 and sellExitSignal2)? Short2Exit : (alert_s3 and sellExitSignal3)? Short3Exit : (alert_s4 and sellExitSignal4)? Short4Exit : (alert_s5 and sellExitSignal5)? Short5Exit : (alert_s6 and sellExitSignal6)? Short6Exit : (alert_s7 and sellExitSignal7)? Short7Exit : (alert_s8 and sellExitSignal8)? Short8Exit :(alert_s9 and sellExitSignal9)? Short9Exit : (alert_s10 and sellExitSignal10)? Short10Exit : ""
alert_type = closure == "Once Per Close" ? alert.freq_once_per_bar_close : alert.freq_once_per_bar
if BuySig
alert(longEntryMsg,alert_type)
if SellSig
alert(shortEntryMsg,alert_type)
if ExitBuy
alert(longExitMsg,alert_type)
if ExitSell
alert(shortExitMsg,alert_type)
//==============================================================================
// END OF CODE
//==============================================================================
Show all 672 lines