I am not an expert in coding so I tried to create an indicator to find some opportunities for Long Entries. So far all good and nice but when I tested it I noticed that when I am changing the assets even this asset is included in my table symbol’s list or it is from another market. It is something wrong with the main signal (Long Spot column), and rarely even with the signal for Trend General column has some differences but I am not so interesting about it.
I will attached some pictures here, from randomly assets, which I took at few minutes differences one which other to show you my issue. All are on TF 4H !!! So please check the pictures and also run your own test with this indicator to see exactly what happens with the table’s signals.
enter image description here
enter image description here
If do you need more details about indicator please don’t hesitate to drop me a comment here and I will come back to you as soon as I see can.
Many thanks in advance.
//@version=5
indicator('Multiple Indicators Screener Coinbase/USD <<ONLY>> copy 11111 test', overlay=true)
import TradingView/ta/7
////////////
// INPUTS //
col_width = input.float(7, title = "Column Width (%)", group = "Tabel inputs")
PositionTabel= input.string(title = "Position Tabel", defval = "position.middle_left", options=["position.top_left", "position.top_center", "position.top_right", "position.middle_left", "position.middle_center", "position.middle_right", "position.bottom_left", "position.bottom_center", "position.bottom_right"], tooltip = "Aici setam pozitia tabelului pe chart. Daca Entry price, SL price si TP sunt verzi vom intra in LONG, iar daca sunt rosi vom intra in SHORT", group = "Tabel inputs")
PositionTabel_num = PositionTabel == "position.top_right" ? position.top_right : PositionTabel == "position.top_left" ? position.top_left : PositionTabel == "position.top_center" ? position.top_center : PositionTabel == "position.middle_left" ? position.middle_left : PositionTabel == "position.middle_center" ? position.middle_center : PositionTabel == "position.middle_right" ? position.middle_right : PositionTabel == "position.bottom_left" ? position.bottom_left : PositionTabel == "position.bottom_right" ? position.bottom_right : PositionTabel == "position.bottom_center" ? position.bottom_center :na
var g_onOFF="ON / OFF"
// timePeriod= input.timeframe(defval = "240", title = "TF option", options = ["240", "D", "W", "M",""], tooltip = "De aici selectam TF pe care dorim sa analizam Marketul. De ex putem alege un TF mai mare sau mai mic fata de TF pe care suntem noi in prezent", confirm = true, group = g_onOFF)
Table_OnOff= input.bool(false,title = "Table On/Off",group = g_onOFF)
//B/b Harami & Engulfing{
// Bullish Harami
aBH = (open[1] > close[1])
bBH = close > open
cBH = close <= open[1]
dBH = close[1] <= open
eBH = ((close - open) < (open[1] - close[1]))
BH= aBH and bBH and cBH and dBH and eBH
// Bullish Engulfing
aBE = (open[1] > close[1])
bBE = close > open
cBE = close >= open[1]
dBE = close[1] >= open
eBE = ((close - open) > (open[1] - close[1]))
BE= aBE and bBE and cBE and dBE and eBE
BEE= (open<open[1] or open==close[1]) and close>open[1] and open[1]>=close[1] and close>open
// Bearish Harami
abH = (close[1] > open[1])
bbH = open > close
cbH = open <= close[1]
dbH = open[1] <= close
ebH = ((open - close) < (close[1] - open[1]))
bH= abH and bbH and cbH and dbH and ebH
// Bearish Engulfing
abE = (close[1] > open[1])
bbE = open > close
cbE = open >= close[1]
dbE = open[1] >= close
ebE = ((open - close) > (close[1] - open[1]))
bE= abE and bbE and cbE and dbE and ebE
// On/Off Check Box BE/bE sau BH/bH
barcolor(bE ? color.rgb(255, 0, 0) : na ,title = "Bearish Engulfing")
barcolor(bH ? color.rgb(255, 235, 0) : na ,title = "Bearish Harami")
barcolor(BH ? color.rgb(0, 0, 0) : na ,title = "Bullish Harami")
barcolor(BE ? color.rgb(0, 255, 8) : na ,title = "Bullish Engulfing")
//}
// H1
var g_MACD_4strategy="Macd x4 strategy settings"
i_fast_length3 = input.int(title="Fast Length MACD Hist1", defval=5, group=g_MACD_4strategy)
i_slow_length3 = input.int(title="Slow Length MACD Hist1", defval=8, group=g_MACD_4strategy)
i_signal_length = input.int(title="Signal Smoothing", minval=1, maxval=50, defval=7, group=g_MACD_4strategy)
i_sma_source= input.string(title="Oscillator MA Type", defval="EMA", options=["SMA", "EMA"], group=g_MACD_4strategy)
i_sma_signal= input.string(title="Signal Line MA Type", defval="EMA", options=["SMA", "EMA"], group=g_MACD_4strategy)
i_macd_src = input.source (title="Price Source", defval=close, group=g_MACD_4strategy)
// SMA si EMA
var g_system= "EMAs Inputs"
var SMMAsInputs= "SMMAs inputs"
i_ema_filter6 = input.int(title="EMA 200", defval=200, group=g_system)
i_ema_filter2= input.int(title="EMA 9", defval = 9, group=g_system)
i_ema_src = input.source(title="Source", defval = close, group = g_system)
len1TMA21 = input.int(21, minval=1, title="Length SMMA1",group =SMMAsInputs )
len1TMA50 = input.int(50, minval=1, title="Length SMMA2",group = SMMAsInputs)
len1TMA200 = input.int(200, minval=1, title="Length SMMA3",group = SMMAsInputs)
src1TMA = input.source(close, title="Source SMMA",group = SMMAsInputs)
// VWAP {
wtChannelLen = input(9, title='WT Channel Length')
wtAverageLen = input(12, title='WT Average Length')
wtMASource = input(hlc3, title='WT MA Source')
wtMALen = input(3, title='WT MA Length')
// WaveTrend
f_wavetrend(src, chlen, avg, malen, tf) =>
tfsrc = request.security(syminfo.tickerid, tf, src)
esa = ta.ema(tfsrc, chlen)
de = ta.ema(math.abs(tfsrc - esa), chlen)
ci = (tfsrc - esa) / (0.015 * de)
wt1 = request.security(syminfo.tickerid, tf, ta.ema(ci, avg))
wt2 = request.security(syminfo.tickerid, tf, ta.sma(wt1, malen))
wtVwap = wt1 - wt2
wtOversold = wt2 <= 53
wtOverbought = wt2 >= 53
wtCross = ta.cross(wt1, wt2)
wtCrossUp = wt2 - wt1 <= 0
wtCrossDown = wt2 - wt1 >= 0
wtCrosslast = ta.cross(wt1[2], wt2[2])
wtCrossUplast = wt2[2] - wt1[2] <= 0
wtCrossDownlast = wt2[2] - wt1[2] >= 0
[wt1, wt2, wtOversold, wtOverbought, wtCross, wtCrossUp, wtCrossDown, wtCrosslast, wtCrossUplast, wtCrossDownlast, wtVwap]
ma(source, length, type) =>
switch type
"SMA" => ta.sma(source, length)
"Bollinger Bands" => ta.sma(source, length)
"EMA" => ta.ema(source, length)
"SMMA (RMA)" => ta.rma(source, length)
"WMA" => ta.wma(source, length)
"VWMA" => ta.vwma(source, length)
//---------------------------------------------
rsiLengthInput = input.int(9, minval=1, title="RSI Length", group="RSI Settings")
rsiSourceInput = input.source(close, "Source", group="RSI Settings")
maTypeInput = input.string("SMA", title="MA Type", options=["SMA", "Bollinger Bands", "EMA", "SMMA (RMA)", "WMA", "VWMA"], group="MA Settings")
maLengthInput = input.int(11, title="MA Length", group="MA Settings")
up = ta.rma(math.max(ta.change(rsiSourceInput), 0), rsiLengthInput)
down = ta.rma(-math.min(ta.change(rsiSourceInput), 0), rsiLengthInput)
rsi9 = down == 0 ? 100 : up == 0 ? 0 : 100 - (100 / (1 + up / down))
rsi9_SMA11 = ma(rsi9, maLengthInput, maTypeInput)
//---------------------------------------------
/////////////
// SYMBOLS //
u01 = input.bool(true, title = "", group = 'Symbols', inline = 's01')
u02 = input.bool(true, title = "", group = 'Symbols', inline = 's02')
u03 = input.bool(true, title = "", group = 'Symbols', inline = 's03')
u04 = input.bool(true, title = "", group = 'Symbols', inline = 's04')
u05 = input.bool(true, title = "", group = 'Symbols', inline = 's05')
u06 = input.bool(true, title = "", group = 'Symbols', inline = 's06')
u07 = input.bool(true, title = "", group = 'Symbols', inline = 's07')
u08 = input.bool(true, title = "", group = 'Symbols', inline = 's08')
u09 = input.bool(true, title = "", group = 'Symbols', inline = 's09')
u10 = input.bool(true, title = "", group = 'Symbols', inline = 's10')
u11 = input.bool(true, title = "", group = 'Symbols', inline = 's11')
u12 = input.bool(true, title = "", group = 'Symbols', inline = 's12')
u13 = input.bool(true, title = "", group = 'Symbols', inline = 's13')
u14 = input.bool(true, title = "", group = 'Symbols', inline = 's14')
u15 = input.bool(true, title = "", group = 'Symbols', inline = 's15')
u16 = input.bool(true, title = "", group = 'Symbols', inline = 's16')
u17 = input.bool(true, title = "", group = 'Symbols', inline = 's17')
u18 = input.bool(true, title = "", group = 'Symbols', inline = 's18')
u19 = input.bool(true, title = "", group = 'Symbols', inline = 's19')
u20 = input.bool(true, title = "", group = 'Symbols', inline = 's20')
u21 = input.bool(true, title = "", group = 'Symbols', inline = 's21')
u22 = input.bool(true, title = "", group = 'Symbols', inline = 's22')
u23 = input.bool(true, title = "", group = 'Symbols', inline = 's23')
u24 = input.bool(true, title = "", group = 'Symbols', inline = 's24')
u25 = input.bool(true, title = "", group = 'Symbols', inline = 's25')
u26 = input.bool(true, title = "", group = 'Symbols', inline = 's26')
u27 = input.bool(true, title = "", group = 'Symbols', inline = 's27')
u28 = input.bool(true, title = "", group = 'Symbols', inline = 's28')
u29 = input.bool(true, title = "", group = 'Symbols', inline = 's29')
u30 = input.bool(true, title = "", group = 'Symbols', inline = 's30')
u31 = input.bool(true, title = "", group = 'Symbols', inline = 's31')
s01 = input.symbol("COINBASE:BONKUSD", group = 'Symbols', inline = 's01')
s02 = input.symbol('COINBASE:PONDUSD', group = 'Symbols', inline = 's02')
s03 = input.symbol('COINBASE:DOGEUSD', group = 'Symbols', inline = 's03')
s04 = input.symbol('COINBASE:ASMUSD', group = 'Symbols', inline = 's04')
s05 = input.symbol('COINBASE:ONDOUSD', group = 'Symbols', inline = 's05')
s06 = input.symbol('COINBASE:LCXUSD', group = 'Symbols', inline = 's06')
s07 = input.symbol('COINBASE:ADAUSD', group = 'Symbols', inline = 's07')
s08 = input.symbol('COINBASE:XRPUSD', group = 'Symbols', inline = 's08')
s09 = input.symbol('COINBASE:FETUSD', group = 'Symbols', inline = 's09')
s10 = input.symbol('COINBASE:SEIUSD', group = 'Symbols', inline = 's10')
s11 = input.symbol('COINBASE:MATICUSD', group = 'Symbols', inline = 's11')
s12 = input.symbol('COINBASE:ZETAUSD', group = 'Symbols', inline = 's12')
s13 = input.symbol('COINBASE:SUIUSD', group = 'Symbols', inline = 's13')
s14 = input.symbol('COINBASE:ARBUSD', group = 'Symbols', inline = 's14')
s15 = input.symbol('COINBASE:JTOUSD', group = 'Symbols', inline = 's15')
s16 = input.symbol('COINBASE:NEARUSD', group = 'Symbols', inline = 's16')
s17 = input.symbol('COINBASE:OPUSD', group = 'Symbols', inline = 's17')
s18 = input.symbol('COINBASE:SHIBUSD', group = 'Symbols', inline = 's18')
s19 = input.symbol('COINBASE:UMAUSD', group = 'Symbols', inline = 's19')
s20 = input.symbol('COINBASE:RNDRUSD', group = 'Symbols', inline = 's20')
s21 = input.symbol('COINBASE:ATOMUSD', group = 'Symbols', inline = 's21')
s22 = input.symbol('COINBASE:ICPUSD', group = 'Symbols', inline = 's22')
s23 = input.symbol('COINBASE:TIAUSD', group = 'Symbols', inline = 's23')
s24 = input.symbol('COINBASE:LINKUSD', group = 'Symbols', inline = 's24')
s25 = input.symbol('COINBASE:ETCUSD', group = 'Symbols', inline = 's25')
s26 = input.symbol('COINBASE:INJUSD', group = 'Symbols', inline = 's26')
s27 = input.symbol('COINBASE:AVAXUSD', group = 'Symbols', inline = 's27')
s28 = input.symbol('COINBASE:AAVEUSD', group = 'Symbols', inline = 's28')
s29 = input.symbol('COINBASE:SOLUSD', group = 'Symbols', inline = 's29')
s30 = input.symbol('COINBASE:ETHUSD', group = 'Symbols', inline = 's30')
s31 = input.symbol('COINBASE:LTCUSD', group = 'Symbols', inline = 's31')
//////////////////
// CALCULATIONS //
// Get only symbol
only_symbol(s) =>
array.get(str.split(s, ":"), 1)
id_symbol(s)=>
switch s
1 => only_symbol(s01)
2 => only_symbol(s02)
3 => only_symbol(s03)
4 => only_symbol(s04)
5 => only_symbol(s05)
6 => only_symbol(s06)
7 => only_symbol(s07)
8 => only_symbol(s08)
9 => only_symbol(s09)
10 => only_symbol(s10)
11 => only_symbol(s11)
12 => only_symbol(s12)
13 => only_symbol(s13)
14 => only_symbol(s14)
15 => only_symbol(s15)
16 => only_symbol(s16)
17 => only_symbol(s17)
18 => only_symbol(s18)
19 => only_symbol(s19)
20 => only_symbol(s20)
21 => only_symbol(s21)
22 => only_symbol(s22)
23 => only_symbol(s23)
24 => only_symbol(s24)
25 => only_symbol(s25)
26 => only_symbol(s26)
27 => only_symbol(s27)
28 => only_symbol(s28)
29 => only_symbol(s29)
30 => only_symbol(s30)
31 => only_symbol(s31)
=> na
// for H1
fast_ma3 = i_sma_source == "SMA" ? ta.sma(i_macd_src, i_fast_length3) : ta.ema(i_macd_src, i_fast_length3)
slow_ma3 = i_sma_source == "SMA" ? ta.sma(i_macd_src, i_slow_length3) : ta.ema(i_macd_src, i_slow_length3)
macd3 = fast_ma3 - slow_ma3
signal3 = i_sma_signal == "SMA" ? ta.sma(macd3, i_signal_length) : ta.ema(macd3, i_signal_length)
screener_func() =>
// Calculates WaveTrend
[wt1, wt2, wtOversold, wtOverbought, wtCross, wtCrossUp, wtCrossDown, wtCross_last, wtCrossUp_last, wtCrossDown_last, wtVwap] = f_wavetrend(wtMASource, wtChannelLen, wtAverageLen, wtMALen, timeframe.period)
// Last RD si GD
LastRD= wt1<wt2
LastGD= wt1>wt2
// Green Dot
BullDot=ta.crossover(wt1,wt2) and (barstate.islast or barstate.isconfirmed)
// Red Dot
BearDot= ta.crossunder(wt1,wt2) and (barstate.islast or barstate.isconfirmed)
// H1
hist1 = macd3 - signal3
//Extra {
// H1
H1instMU1= hist1[1]<hist1 and hist1[1]<hist1[2]
H1instMD1= hist1[1]>hist1 and hist1[1]>hist1[2]
H1mu1= hist1[1]<hist1
H1md1= hist1[1]>hist1
H1mu2= hist1[2]<hist1[1] and hist1[1]<hist1
H1md2= hist1[2]>hist1[1] and hist1[1]>hist1
H1mu3= hist1[3]<hist1[2] and hist1[2]<hist1[1] and hist1[1]<hist1
H1md3= hist1[3]>hist1[2] and hist1[2]>hist1[1] and hist1[1]>hist1
H1p0= hist1>0 and hist1[1]>0 and hist1[2]>0
H1p05b= hist1>0 and hist1[1]>0 and hist1[2]>0 and hist1[3]>0 and hist1[4]>0
H1s0= hist1<0 and hist1[1]<0
H1s05b= hist1<0 and hist1[1]<0 and hist1[2]<0 and hist1[3]<0 and hist1[4]<0
H1instp0= hist1[1]<0 and hist1>0
H1insts0= hist1[1]>0 and hist1<0
H1sacadatLong= hist1[2]>0 and hist1[2]>hist1[3] and hist1[1]<0 and hist1>0
H1sacadatShort= hist1[2]<0 and hist1[2]<hist1[3] and hist1[1]>0 and hist1<0
H1_Last2s0= hist1[1]<0 and hist1<0
H1_Last2p0= hist1[1]>0 and hist1>0
// SMA11 si 100
SMA11= rsi9_SMA11
// SMA si EMA
smma1 = 0.0
smma2 = 0.0
smma3 = 0.0
i1= ta.sma(src1TMA, len1TMA21)
i2= ta.sma(src1TMA, len1TMA50)
i3= ta.sma(src1TMA, len1TMA200)
smma1 := na(smma1[1]) ? i1 : (smma1[1] * (len1TMA21 - 1) + src1TMA) / len1TMA21
smma2 := na(smma2[1]) ? i2 : (smma2[1] * (len1TMA50 - 1) + src1TMA) / len1TMA50
smma3 := na(smma3[1]) ? i3 : (smma3[1] * (len1TMA200 - 1) + src1TMA) / len1TMA200
// DDPL
DPPL_SMA11= ta.lowest(SMA11,2)>ta.lowest(SMA11,25)[2]
DPPL_H1= ta.lowest(hist1,2)>ta.lowest(hist1,25)[2]
DPPL_VWAP= ta.lowest(wtVwap,2)>ta.lowest(wtVwap,25)[2]
DNPL_SMA11= ta.highest(SMA11,2)<ta.highest(SMA11,25)[2]
DNPL_H1= hist1[1]<ta.highest(hist1,25)[2]
DNPL_VWAP= ta.highest(wtVwap,2)<ta.highest(wtVwap,25)[2]
//Divergenta Ascunsa
//DPA (pozitiva)
DPA_SMA11= ta.lowest(SMA11,2)<ta.lowest(SMA11,25)[2]
DPA_H1= hist1[1]<ta.lowest(hist1,25)[2]
DPA_VWAP= ta.lowest(wtVwap,2)<ta.lowest(wtVwap,25)[2]
//DNA (negativa)
DNA_SMA11= ta.highest(SMA11,2)>ta.highest(SMA11,25)[2]
DNA_H1= hist1[1]>ta.highest(hist1,25)[2]
DNA_VWAP= ta.highest(wtVwap,2)>ta.highest(wtVwap,25)[2]
// DPPL_local
DPPL_vwap_local= ta.lowest(wtVwap,2)>ta.lowest(wtVwap,20)[2]
DPPL_h1_local= ta.lowest(hist1,2)>ta.lowest(hist1,12)[2]
ema9 = ta.ema(i_ema_src,i_ema_filter2)
ema200 = ta.ema(i_ema_src, i_ema_filter6)
Filters= not na(ema9) and not na(hist1) and (barstate.isconfirmed or barstate.islast)
//////////////////////////////////////////////////////
//Vwap
VwapMDinst= wtVwap[1]>wtVwap and wtVwap[1]>wtVwap[2]
VwapMUinst= wtVwap[1]<wtVwap and wtVwap[1]<wtVwap[2]
VwapMD1= wtVwap[1]>wtVwap
VwapMU1= wtVwap[1]<wtVwap
Vwapinst_s0= wtVwap[1]>0 and wtVwap<0
Vwapinst_p0= wtVwap[1]<0 and wtVwap>0
//----------------------------------
SMA11instMU= SMA11[1]<SMA11 and SMA11[1]<SMA11[2]
SMA11instMD= SMA11[1]>SMA11 and SMA11[1]>SMA11[2]
//}
//////////////
/////// de aici numaram de la ce BearDot<0 sa inceapa numaratoarea, in acest moment este de la primul care respecta conditiile
CrossBellow= ta.crossunder(wt1,wt2)
CrossBellow_C=0
for i= 0 to 10
if CrossBellow[i]
continue
CrossBellow_C += 1
yyy= ta.highest(wt1,3)<0
Short_L= CrossBellow_C<11 and wt1<0 and wt2<0 and CrossBellow
Short_LL= 0
for iii= 0 to 40
if Short_L[iii] and wt1<0 and wt2<0 and yyy
Short_LL +=1
if (wt1[iii]>0 or wt2[iii]>0) and CrossBellow[iii]
break
Short_LL
Short_RD= Short_LL>0 and CrossBellow and (barstate.isconfirmed or barstate.islast)
///////////// de aici selectam de cate ori VWAPul sa fie numarat de cand am avut ultimul BearDot
VWAPinstMU= wtVwap[1]<wtVwap and wtVwap[1]<wtVwap[2]
var testVWAPmuA2oara= 0
var trtrt= 0
bool ryry1= wt1
for i= 0 to 0
if ryry1[i]
trtrt += 1
if BullDot or wt1>wt2
trtrt := 0
if trtrt>0 and VWAPinstMU
testVWAPmuA2oara +=1
if ((BullDot and wtVwap[1]<wtVwap and wtVwap[1]>wtVwap[2]) or (wt1>wt2 and wt1>0)) and testVWAPmuA2oara[1]>0
testVWAPmuA2oara := 0
if testVWAPmuA2oara>0 and BullDot and VWAPinstMU
testVWAPmuA2oara +=1
if BullDot[2] and wtVwap[1]>wtVwap and testVWAPmuA2oara>1
testVWAPmuA2oara := 0
/////////// aici selectam minimul de H1instMU </> 0 vrem sa fie activat
speciala= ta.barssince(H1instp0)>0 and ta.barssince(H1mu1[1])>1 and H1insts0
var testH1instMUa2oara= 0
var tr2= 0
var testH1instMUPrimaOara= 0
bool ryry= not na(hist1)
for i= 0 to 0
if ryry[i] and hist1>0 and H1instMU1 and H1p0
tr2 += 1
if ryry[i] and hist1<0 and ((H1instMU1 and H1_Last2s0) or H1sacadatLong or speciala or H1md1)
tr2:= 0
if (tr2>0 or (H1instMD1 and H1_Last2p0)) and ryry[i]
testH1instMUa2oara := 0
if tr2<1 and ryry[i] and (H1instMU1 or H1sacadatLong)
testH1instMUa2oara += 1
if hist1>0
testH1instMUPrimaOara:= 0
if hist1<0 and H1instMU1 and H1_Last2s0
testH1instMUPrimaOara += 1
/////////
DPPL_combinate= ((DPPL_H1 and DPPL_VWAP) or (DPPL_H1 and DPPL_SMA11) or (DPPL_VWAP and DPPL_SMA11))
DPPL_necombinate= (DPPL_H1 or DPPL_VWAP or DPPL_SMA11)
doarCloseSubTB= ta.lowest(close,2)<=ta.lowest(close,30)[2]
CloseSubTB_combinate_cu_Low= ((low<ta.lowest(low,26)[1] and close<=ta.lowest(close,30)[1])
or (low[1]<ta.lowest(low,26)[2] and close[1]<=ta.lowest(close,30)[2] and H1instMU1)
or(low[2]<ta.lowest(low,26)[3] and close[2]<=ta.lowest(close,30)[3] and H1instMU1)
or ((low[1]<ta.lowest(low,26)[2] or low<ta.lowest(low,8)[1]) and close[1]<=ta.lowest(close,30)[2] and (H1p0 or (H1md2 and hist1[2]>0)) and DPPL_H1 and H1md1 and wt1<wt2))
x1= (ema9>smma2 or (smma1[1]<smma1 and ema9>smma1))
Full_BearM= ema200<smma3 and not x1 and Filters ? -15:0
END_BearM= ema200<smma3 and x1 and Filters ? -16:0
y1= ta.highest(smma2,5)<ta.highest(smma3,5)
Full_BullM= ema200>smma3 and not y1 and Filters ? -17:0
END_BullM= ema200>smma3 and y1 and Filters ? -18:0
LongSpot= Filters
and (wt1<wt2 or BullDot or (H1mu3 and close<open) or (H1p0 and DPPL_H1 and DPPL_VWAP and (wt1>-62 or wt2>-60)))
and (
(DPPL_H1 and DPPL_necombinate)
or (Short_LL>0 and wt2<-60 and ta.highest(wt2,4)<-60 and ta.lowest(wt2,7)<ta.lowest(wt2,31)[7] and ((SMA11[1]>SMA11 and SMA11<ta.lowest(SMA11,39)[1]) or (SMA11instMU and SMA11[1]<ta.lowest(SMA11,28)[2])) and DPPL_VWAP and SMA11<32)
or (testH1instMUPrimaOara==1 and Short_LL>=2 and DPPL_h1_local and DPPL_VWAP and SMA11<ta.lowest(SMA11,40)[1] and SMA11<33)
or ((wt2<-60 or (wt1<-65 and wt2<-58)) and (DPPL_combinate or (wt2<-80 and H1instMU1 and DPPL_VWAP and wt1<wt2) or (wt2<-53 and wt1<-61 and wt2>-60 and H1instMU1 and H1_Last2s0 and testH1instMUPrimaOara==1 and DPPL_SMA11 and doarCloseSubTB and wt1<wt2 and SMA11>29)) and SMA11[1]>SMA11)
)
and wt2<0
and SMA11[1]<50 and SMA11<47
and close<high[1] and (close<ema9[1] or ta.crossover(close,ema9[1])) ? 11:0
//----------------------------------------------------------------------------------------------------------------------------------------
[Full_BearM, END_BearM, Full_BullM, END_BullM, LongSpot]
// Set Up Matrix
screenerMtx = matrix.new<float>(0, 6, na)
screenerFun(numSym, sym, flg) =>
[Full_BearM, END_BearM, Full_BullM, END_BullM, LongSpot] = request.security(sym, timeframe.period, screener_func())
arr = array.from(numSym, Full_BearM, END_BearM, Full_BullM, END_BullM, LongSpot)
if flg
matrix.add_row(screenerMtx, matrix.rows(screenerMtx), arr)
// Security call
screenerFun(1, s01, u01), screenerFun(2, s02, u02), screenerFun(3, s03, u03), screenerFun(4, s04, u04),
screenerFun(5, s05, u05), screenerFun(6, s06, u06), screenerFun(7, s07, u07), screenerFun(8, s08, u08),
screenerFun(9, s09, u09), screenerFun(10, s10, u10), screenerFun(11, s11, u11), screenerFun(12, s12, u12),
screenerFun(13, s13, u13), screenerFun(14, s14, u14), screenerFun(15, s15, u15), screenerFun(16, s16, u16),
screenerFun(17, s17, u17), screenerFun(18, s18, u18), screenerFun(19, s19, u19), screenerFun(20, s20, u20),
screenerFun(21, s21, u21), screenerFun(22, s22, u22), screenerFun(23, s23, u23), screenerFun(24, s24, u24),
screenerFun(25, s25, u25), screenerFun(26, s26, u26), screenerFun(27, s27, u27), screenerFun(28, s28, u28),
screenerFun(29, s29, u29), screenerFun(30, s30, u30), screenerFun(31, s31, u31),
///////////
// PLOTS //
var tbl = table.new(PositionTabel_num, 7, 22, frame_color=#151715, frame_width=1, border_width=2, border_color=color.new(color.white, 100))
if barstate.isconfirmed and Table_OnOff==true
table.clear(tbl, 0, 0, 6, 21)
table.cell(tbl, 0, 0, "Assets", width = col_width, text_halign = text.align_center, bgcolor = color.gray, text_color = color.white, text_size = size.small)
table.cell(tbl, 1, 0, 'Long Spot', width = col_width, text_halign = text.align_center, bgcolor = color.gray, text_color = color.white, text_size = size.small)
table.cell(tbl, 2, 0, 'Trend General', width = col_width, text_halign = text.align_center, bgcolor = color.gray, text_color = color.white, text_size = size.small)
table.cell(tbl, 3, 0, "Assets", width = col_width, text_halign = text.align_center, bgcolor = color.gray, text_color = color.white, text_size = size.small)
table.cell(tbl, 4, 0, 'Long Spot', width = col_width, text_halign = text.align_center, bgcolor = color.gray, text_color = color.white, text_size = size.small)
table.cell(tbl, 5, 0, 'Trend General', width = col_width, text_halign = text.align_center, bgcolor = color.gray, text_color = color.white, text_size = size.small)
if matrix.rows(screenerMtx) > 0
for i = 0 to 16
TrendGeneral_col = matrix.get(screenerMtx, i, 1) == -15? color.rgb(240, 35, 35) : matrix.get(screenerMtx, i, 2) == -16? color.rgb(223, 64, 251) : matrix.get(screenerMtx, i, 3) == -17? color.rgb(11, 134, 16) : matrix.get(screenerMtx, i, 4) == -18? color.rgb(169, 187, 3) : #aaaaaa
General_Signal_col= matrix.get(screenerMtx, i, 5) == 11 ? color.yellow : #aaaaaa
TrendGeneral_text = matrix.get(screenerMtx, i, 1) == -15? "Full bM" : matrix.get(screenerMtx, i, 2) == -16? "END bM" : matrix.get(screenerMtx, i, 3) == -17? "Full BM" : matrix.get(screenerMtx, i, 4) == -18? "END BullM" : na
General_Signal_text= matrix.get(screenerMtx, i, 5) == 11 ? "Long Spot" :na
table.cell(tbl, 0, i + 1, str.tostring(i+1) + " " + id_symbol(matrix.get(screenerMtx, i, 0)), text_halign = text.align_left, bgcolor = color.gray, text_color = color.white, text_size = size.small)
table.cell(tbl, 1, i + 1, General_Signal_text, text_halign = text.align_center, bgcolor = General_Signal_col, text_color = color.white, text_size = size.small)
table.cell(tbl, 2, i + 1, TrendGeneral_text, text_halign = text.align_center, bgcolor = TrendGeneral_col, text_color = color.white, text_size = size.small)
for i = 17 to 30
TrendGeneral_col = matrix.get(screenerMtx, i, 1) == -15? color.rgb(240, 35, 35) : matrix.get(screenerMtx, i, 2) == -16? color.rgb(223, 64, 251) : matrix.get(screenerMtx, i, 3) == -17? color.rgb(11, 134, 16) : matrix.get(screenerMtx, i, 4) == -18? color.rgb(169, 187, 3) : #aaaaaa
General_Signal_col= matrix.get(screenerMtx, i, 5) == 11 ? color.yellow : #aaaaaa
TrendGeneral_text = matrix.get(screenerMtx, i, 1) == -15? "Full bM" : matrix.get(screenerMtx, i, 2) == -16? "END bM" : matrix.get(screenerMtx, i, 3) == -17? "Full BM" : matrix.get(screenerMtx, i, 4) == -18? "END BullM" : na
General_Signal_text= matrix.get(screenerMtx, i, 5) == 11 ? "Long Spot" :na
table.cell(tbl, 3, i - 16, str.tostring(i+1) + " " + id_symbol(matrix.get(screenerMtx, i, 0)), text_halign = text.align_left, bgcolor = color.gray, text_color = color.white, text_size = size.small)
table.cell(tbl, 4, i - 16, General_Signal_text, text_halign = text.align_center, bgcolor = General_Signal_col, text_color = color.white, text_size = size.small)
table.cell(tbl, 5, i - 16, TrendGeneral_text, text_halign = text.align_center, bgcolor = TrendGeneral_col, text_color = color.white, text_size = size.small)
///////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////