0% found this document useful (0 votes)
7 views

MA_Table

The document is a TradingView Pine Script code for a custom indicator that calculates multiple Exponential Moving Averages (EMAs) and other technical indicators such as RSI and Stochastic. It allows users to configure various parameters including lengths, sources, and types of moving averages, as well as the display settings for the indicator. The script is designed to assist traders in analyzing price movements across different timeframes.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views

MA_Table

The document is a TradingView Pine Script code for a custom indicator that calculates multiple Exponential Moving Averages (EMAs) and other technical indicators such as RSI and Stochastic. It allows users to configure various parameters including lengths, sources, and types of moving averages, as well as the display settings for the indicator. The script is designed to assist traders in analyzing price movements across different timeframes.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 11

//@version=5

indicator(title="[AzMoh]_multiple_emas", format=format.price, precision=4, overlay


= true)

//==============================================

//////////////////////////////////

MAFun(source, length, type) =>


type == "SMA" ? ta.sma(source, length) : type == "DSMA" ? 2 * ta.sma(source,
length) - ta.sma(ta.sma(source, length), length) : type == "TSMA" ? 3 *
ta.sma(source, length) - 3 * ta.sma(ta.sma(source, length), length) +
ta.sma(ta.sma(ta.sma(source, length), length), length) : type == "EMA" ?
ta.ema(source, length) : type == "DEMA" ? 2 * ta.ema(source, length) -
ta.emartretre(ta.ema(source, length), length) : type == "TEMA" ? 3 * ta.ema(source,
length) - 3 * ta.ema(ta.ema(source, length), length) + ta.ema(ta.ema(ta.ema(source,
length), length), length) : type == "SMMA (RMA)" ? ta.rma(source, length) : type ==
"WMA" ? ta.wma(source, length) : type == "VWMA" ? ta.vwma(source, length) : type ==
"HULL" ? ta.hma(source, length) : type == "LSMA" ? ta.linreg(source, length, 0) :
type == "ALMA" ? ta.alma(source, length, 0.85, 6) : na

// TIMEFRAMES OPTIONS

ma9 = input.bool(true, "9 ", inline = "0", group="MA")


ma9len = input.int(9, "", inline = "0", group="MA")
ma9src = input.source(close,"", inline = "0", group="MA")
ma9type = input.string("EMA" , "" , options=["SMA","DSMA","TSMA",
"EMA","DEMA","TEMA", "SMMA (RMA)", "WMA", "VWMA", "HULL", "LSMA", "ALMA"] , inline
= "0", group="MA")

ma21 = input.bool(true, "21 ", inline = "1", group="MA")


ma21len = input.int(21, "", inline = "1", group="MA")
ma21src = input.source(close,"", inline = "1", group="MA")
ma21type = input.string("EMA" , "" , options=["SMA","DSMA","TSMA",
"EMA","DEMA","TEMA", "SMMA (RMA)", "WMA", "VWMA", "HULL", "LSMA", "ALMA"] , inline
= "1", group="MA")

ma35 = input.bool(true, "35 ", inline = "2", group="MA")


ma35len = input.int(35, "", inline = "2", group="MA")
ma35src = input.source(close,"", inline = "2", group="MA")
ma35type = input.string("EMA" , "" , options=["SMA","DSMA","TSMA",
"EMA","DEMA","TEMA", "SMMA (RMA)", "WMA", "VWMA", "HULL", "LSMA", "ALMA"] , inline
= "2", group="MA")

ma55 = input.bool(true, "55 ", inline = "3", group="MA")


ma55len = input.int(55, "", inline = "3", group="MA")
ma55src = input.source(close,"", inline = "3", group="MA")
ma55type = input.string("EMA" , "" , options=["SMA","DSMA","TSMA",
"EMA","DEMA","TEMA", "SMMA (RMA)", "WMA", "VWMA", "HULL", "LSMA", "ALMA"] , inline
= "3", group="MA")

ma100 = input.bool(true, "100", inline = "4", group="MA")


ma100len = input.int(100, "", inline = "4", group="MA")
ma100src = input.source(close,"", inline = "4", group="MA")
ma100type = input.string("EMA" , "" , options=["SMA","DSMA","TSMA",
"EMA","DEMA","TEMA", "SMMA (RMA)", "WMA", "VWMA", "HULL", "LSMA", "ALMA"] , inline
= "4", group="MA")

ma144 = input.bool(true, "144", inline = "5", group="MA")


ma144len = input.int(144, "", inline = "5", group="MA")
ma144src = input.source(close,"", inline = "5", group="MA")
ma144type = input.string("EMA" , "" , options=["SMA","DSMA","TSMA",
"EMA","DEMA","TEMA", "SMMA (RMA)", "WMA", "VWMA", "HULL", "LSMA", "ALMA"] , inline
= "5", group="MA")

ma200 = input.bool(true, "200", inline = "6", group="MA")


ma200len = input.int(200, "", inline = "6", group="MA")
ma200src = input.source(close,"", inline = "6", group="MA")
ma200type = input.string("EMA" , "" , options=["SMA","DSMA","TSMA",
"EMA","DEMA","TEMA", "SMMA (RMA)", "WMA", "VWMA", "HULL", "LSMA", "ALMA"] , inline
= "6", group="MA")

ma252 = input.bool(true, "252", inline = "7", group="MA")


ma252len = input.int(252, "", inline = "7", group="MA")
ma252src = input.source(close,"", inline = "7", group="MA")
ma252type = input.string("EMA" , "" , options=["SMA","DSMA","TSMA",
"EMA","DEMA","TEMA", "SMMA (RMA)", "WMA", "VWMA", "HULL", "LSMA", "ALMA"] , inline
= "7", group="MA")

// POSITION AND SIZE


Ucol = input.color(defval=#0000FF, title='', inline = "1", group = "Table")
Dcol = input.color(defval=#FFAD00, title='Colors', inline = "1", group = "Table")

PosTable = input.string(defval="Bottom Right", title="Position", options=["Top


Right", "Middle Right", "Bottom Right", "Top Center", "Middle Center", "Bottom
Center", "Top Left", "Middle Left", "Bottom Left"], group="Table Location & Size",
inline="1")
SizTable = input.string(defval="Auto", title="Size", options=["Auto", "Huge",
"Large", "Normal", "Small", "Tiny"], group="Table Location & Size", inline="1")

Pos1Table = PosTable == "Top Right" ? position.top_right : PosTable == "Middle


Right" ? position.middle_right : PosTable == "Bottom Right" ? position.bottom_right
: PosTable == "Top Center" ? position.top_center : PosTable == "Middle Center" ?
position.middle_center : PosTable == "Bottom Center" ? position.bottom_center :
PosTable == "Top Left" ? position.top_left : PosTable == "Middle Left" ?
position.middle_left : position.bottom_left
Siz1Table = SizTable == "Auto" ? size.auto : SizTable == "Huge" ? size.huge :
SizTable == "Large" ? size.large : SizTable == "Normal" ? size.normal : SizTable ==
"Small" ? size.small : size.tiny

tbl = table.new(Pos1Table, 18, 30, frame_width=0, frame_color=#000000,


border_width=1, border_color=#000000)

// RSI CONFIGS
srcRSI = input.source(close, "Source ", inline="1", group="RSI configs")
lenRSI = input.int(14, "Length 100 ,1 ," , inline="1", group="RSI configs")
OB = input.int(70, "O.B", 0, 100, inline="1", group="RSI configs")
OS = input.int(30, "O.S", 0, 100, inline="1", group="RSI configs")
oscRSI = ta.rsi(srcRSI, lenRSI)

ema9_ = MAFun(ma9src,ma9len,ma9type) //ta.ema(close, 9)


ema9c_ = close
ema9H_ = high
ema9L_ = low
ema9I_ = high[1]<high[2] and low[1]>low[2]
ema21_ = MAFun(ma21src,ma21len,ma21type) // ta.ema(close, 21)
ema21c_ = close
ema21H_ = high
ema21L_ = low
ema21I_ = close[1]>ema9_ and close[1]>ema21_ and oscRSI>40? 1 : close[1]<ema9_ and
close[1]<ema21_ and oscRSI<60? -1 : 0

ema35_ = MAFun(ma35src,ma35len,ma35type) //ta.ema(close, 50)


ema35c_ = close
ema35H_ = high
ema35L_ = low
ema35I_ = high<high[1] and low>low[1]

ema55_ = MAFun(ma55src,ma55len,ma55type)//ta.ema(close, 55)


ema55c_ = close
ema55H_ = high
ema55L_ = low
ema55I_ = high<high[1] and low>low[1]

ema100_ = MAFun(ma100src,ma100len,ma100type)//ta.ema(close, 100)


ema100c_ = close
ema100H_ = high
ema100L_ = low
//ema100I_ = high<high[1] and low>low[1]

ema144_ = MAFun(ma144src,ma144len,ma144type) //ta.ema(close, 144)


ema144c_ = close
ema144H_ = high
ema144L_ = low
ema144I_ = high<high[1] and low>low[1]

ema200_ = MAFun(ma200src,ma200len,ma200type)//ta.ema(close, 200)


ema200c_ = close
ema200H_ = high
ema200L_ = low
ema200I_ = high<high[1] and low>low[1]

ema252_ = MAFun(ma252src,ma252len,ma252type) //ta.ema(close, 252)


ema252c_ = close
ema252H_ = high
ema252L_ = low
ema252I_ = high<high[1] and low>low[1]

lensig = 14
len = 14
up = ta.change(high)
down = -ta.change(low)
plusDM = na(up) ? na : (up > down and up > 0 ? up : 0)
minusDM = na(down) ? na : (down > up and down > 0 ? down : 0)
trur = ta.rma(ta.tr, len)
plus = fixnan(100 * ta.rma(plusDM, len) / trur)
minus = fixnan(100 * ta.rma(minusDM, len) / trur)
sum = plus + minus
adx = 100 * ta.rma(math.abs(plus - minus) / (sum == 0 ? 1 : sum), lensig)

ema100I_ = plus>minus?1:plus<minus?-1:0
//STOCHASTIC CONFIGS
lenK = input.int(14, "%K Lenght 1 ," , inline="1", group="STOCH configs")
smoothK = input.int(3, "%K Smoothing 1 ," , inline="1", group="STOCH configs")
lenD = input.int(3, "%D Smoothing 1 ," , inline="1", group="STOCH configs")
OB_1 = input.int(80, "O.B", 0, 100, inline="1", group="STOCH configs")
OS_1 = input.int(20, "O.S", 0, 100, inline="1", group="STOCH configs")

oscK = ta.sma(ta.stoch(close, high, low, lenK), smoothK)


oscD = ta.sma(oscK, lenD)

box01 = input.bool(true, "", inline = "0", group="Select Timeframe")


tf01 = input.timeframe("1", "", inline = "0", group="Select Timeframe")

box02 = input.bool(true, "", inline = "0", group="Select Timeframe")


tf02 = input.timeframe("5", "", inline = "0", group="Select Timeframe")

box03 = input.bool(true, "", inline = "0", group="Select Timeframe")


tf03 = input.timeframe("15", "", inline = "0", group="Select Timeframe")

box04 = input.bool(true, "", inline = "1", group="Select Timeframe")


tf04 = input.timeframe("30", "", inline = "1", group="Select Timeframe")

box05 = input.bool(true, "", inline = "1", group="Select Timeframe")


tf05 = input.timeframe("60", "", inline = "1", group="Select Timeframe")

box06 = input.bool(true, "", inline = "1", group="Select Timeframe")


tf06 = input.timeframe("75", "", inline = "1", group="Select Timeframe")

box07 = input.bool(true, "", inline = "2", group="Select Timeframe")


tf07 = input.timeframe("90", "", inline = "2", group="Select Timeframe")

box08 = input.bool(true, "", inline = "2", group="Select Timeframe")


tf08 = input.timeframe("120", "", inline = "2", group="Select Timeframe")

box09 = input.bool(true, "", inline = "2", group="Select Timeframe")


tf09 = input.timeframe("240", "", inline = "2", group="Select Timeframe")

box10 = input.bool(true, "", inline = "3", group="Select Timeframe")


tf10 = input.timeframe("360", "", inline = "3", group="Select Timeframe")

box11 = input.bool(true, "", inline = "3", group="Select Timeframe")


tf11 = input.timeframe("480", "", inline = "3", group="Select Timeframe")

box12 = input.bool(true, "", inline = "3", group="Select Timeframe")


tf12 = input.timeframe("720", "", inline = "3", group="Select Timeframe")

box13 = input.bool(true, "", inline = "4", group="Select Timeframe")


tf13 = input.timeframe("D", "", inline = "4", group="Select Timeframe")

box14 = input.bool(true, "", inline = "4", group="Select Timeframe")


tf14 = input.timeframe("W", "", inline = "4", group="Select Timeframe")

box15 = input.bool(true, "", inline = "4", group="Select Timeframe")


tf15 = input.timeframe("M", "", inline = "4", group="Select Timeframe")

// DEFINITION OF VALUES
symbol = ticker.modify(syminfo.tickerid, syminfo.session)
tfArr = array.new<string>(na)
rsiArr = array.new<float>(na)
ArrK = array.new<float>(na)
ArrD = array.new<float>(na)

Arr9 = array.new<float>(na)
Arr9c = array.new<float>(na)
Arr9H = array.new<float>(na)
Arr9L = array.new<float>(na)
Arr9I = array.new<bool>(na)

Arr21 = array.new<float>(na)
Arr21c = array.new<float>(na)
Arr21H = array.new<float>(na)
Arr21L = array.new<float>(na)
Arr21I = array.new<int>(na)

Arr35 = array.new<float>(na)
Arr35c = array.new<float>(na)
Arr35H = array.new<float>(na)
Arr35L = array.new<float>(na)
Arr35I = array.new<bool>(na)

Arr55 = array.new<float>(na)
Arr55c = array.new<float>(na)
Arr55H = array.new<float>(na)
Arr55L = array.new<float>(na)
Arr55I = array.new<bool>(na)

Arr100 = array.new<float>(na)
Arr100c = array.new<float>(na)
Arr100H = array.new<float>(na)
Arr100L = array.new<float>(na)
Arr100I = array.new<int>(na)

Arr144 = array.new<float>(na)
Arr144c = array.new<float>(na)
Arr144H = array.new<float>(na)
Arr144L = array.new<float>(na)
Arr144I = array.new<bool>(na)

Arr200 = array.new<float>(na)
Arr200c = array.new<float>(na)
Arr200H = array.new<float>(na)
Arr200L = array.new<float>(na)
Arr200I = array.new<bool>(na)

Arr252 = array.new<float>(na)
Arr252c = array.new<float>(na)
Arr252H = array.new<float>(na)
Arr252L = array.new<float>(na)
Arr252I = array.new<bool>(na)

// DEFINITIONS OF RSI & STOCH FUNCTIONS APPENDED IN THE TIMEFRAME OPTIONS


rsiNstochFun(tf, flg) =>
[rsi, stcK, stcD, ema9, ema9c, ema9H, ema9L, ema9I, ema21, ema21c, ema21H,
ema21L, ema21I, ema35, ema35c, ema35H, ema35L, ema35I, ema55, ema55c, ema55H,
ema55L, ema55I, ema100, ema100c, ema100H, ema100L, ema100I, ema144, ema144c,
ema144H, ema144L, ema144I, ema200, ema200c, ema200H, ema200L, ema200I, ema252,
ema252c, ema252H, ema252L, ema252I] = request.security(symbol, tf, [oscRSI, oscK,
oscD, ema9_, ema9c_, ema9H_, ema9L_, ema9I_, ema21_, ema21c_, ema21H_, ema21L_,
ema21I_,ema35_, ema35c_, ema35H_, ema35L_, ema35I_, ema55_, ema55c_, ema55H_,
ema55L_, ema55I_, ema100_, ema100c_, ema100H_, ema100L_, ema100I_, ema144_,
ema144c_, ema144H_, ema144L_, ema144I_,ema200_, ema200c_, ema200H_, ema200L_,
ema200I_,ema252_, ema252c_, ema252H_, ema252L_, ema252I_])

if flg and (barstate.isrealtime ? true : timeframe.in_seconds(timeframe.period)


<= timeframe.in_seconds(tf))
array.push(tfArr, na(tf) ? timeframe.period : tf)
array.push(rsiArr, rsi)
array.push(ArrK, stcK)
array.push(ArrD, stcD)

array.push(Arr9, ema9)
array.push(Arr9c, ema9c)
array.push(Arr9H, ema9H)
array.push(Arr9L, ema9L)
array.push(Arr9I, ema9I)

array.push(Arr21, ema21)
array.push(Arr21c, ema21c)
array.push(Arr21H, ema21H)
array.push(Arr21L, ema21L)
array.push(Arr21I, ema21I)

array.push(Arr35, ema35)
array.push(Arr35c, ema35c)
array.push(Arr35H, ema35H)
array.push(Arr35L, ema35L)
array.push(Arr35I, ema35I)

array.push(Arr55, ema55)
array.push(Arr55c, ema55c)
array.push(Arr55H, ema55H)
array.push(Arr55L, ema55L)
array.push(Arr55I, ema55I)

array.push(Arr100, ema100)
array.push(Arr100c, ema100c)
array.push(Arr100H, ema100H)
array.push(Arr100L, ema100L)
array.push(Arr100I, ema100I)

array.push(Arr144, ema144)
array.push(Arr144c, ema144c)
array.push(Arr144H, ema144H)
array.push(Arr144L, ema144L)
array.push(Arr144I, ema144I)

array.push(Arr200, ema200)
array.push(Arr200c, ema200c)
array.push(Arr200H, ema200H)
array.push(Arr200L, ema200L)
array.push(Arr200I, ema200I)

array.push(Arr252, ema252)
array.push(Arr252c, ema252c)
array.push(Arr252H, ema252H)
array.push(Arr252L, ema252L)
array.push(Arr252I, ema252I)

rsiNstochFun(tf01, box01), rsiNstochFun(tf02, box02), rsiNstochFun(tf03, box03),


rsiNstochFun(tf04, box04),
rsiNstochFun(tf05, box05), rsiNstochFun(tf06, box06), rsiNstochFun(tf07, box07),
rsiNstochFun(tf08, box08),
rsiNstochFun(tf09, box09), rsiNstochFun(tf10, box10), rsiNstochFun(tf11, box11),
rsiNstochFun(tf12, box12),
rsiNstochFun(tf13, box13), rsiNstochFun(tf14, box14), rsiNstochFun(tf15, box15)

// TABLE AND CELLS CONFIG


// Post Timeframe in format
tfTxt(x)=>
out = x
if not str.contains(x, "S") and not str.contains(x, "M") and
not str.contains(x, "W") and not str.contains(x, "D")
if str.tonumber(x)%60 == 0
out := str.tostring(str.tonumber(x)/60)+"H"
else
out := x + "m"
out

if barstate.islast
table.clear(tbl, 0, 0, 2, 16)

// TITLES
table.cell(tbl, 0, 0, str.tostring(syminfo.ticker) + " ( " +
str.tostring(close) + " )", text_color=open<close?color.new(Ucol,0):open>close?
color.new(Dcol,0):#000000, text_size=Siz1Table, bgcolor=#FFFFFF)
table.merge_cells(tbl, 0, 0, 10, 0)
table.cell(tbl, 0, 1, "⏱", text_color=#FFFFFF, text_size=Siz1Table,
bgcolor=#000000)

// table.cell(tbl, 2, 1, "%K ("+str.tostring(lenK)+")", text_color=#FFFFFF,


text_size=Siz1Table, bgcolor=#000000)

table.cell(tbl, 1, 1, "EMA9 ", text_color=#FFFFFF, text_size=Siz1Table,


bgcolor=#000000)
table.cell(tbl, 2, 1, "EMA21 ", text_color=#FFFFFF, text_size=Siz1Table,
bgcolor=#000000)
table.cell(tbl, 3, 1, "EMA35 ", text_color=#FFFFFF, text_size=Siz1Table,
bgcolor=#000000)
table.cell(tbl, 4, 1, "EMA55 ", text_color=#FFFFFF, text_size=Siz1Table,
bgcolor=#000000)
table.cell(tbl, 5, 1, "EMA100", text_color=#FFFFFF, text_size=Siz1Table,
bgcolor=#000000)
table.cell(tbl, 6, 1, "EMA144", text_color=#FFFFFF, text_size=Siz1Table,
bgcolor=#000000)
table.cell(tbl, 7, 1, "EMA200", text_color=#FFFFFF, text_size=Siz1Table,
bgcolor=#000000)
table.cell(tbl, 8, 1, "EMA252", text_color=#FFFFFF, text_size=Siz1Table,
bgcolor=#000000)
table.cell(tbl, 9, 1, "RSI("+str.tostring(lenRSI)+")", text_color=#FFFFFF,
text_size=Siz1Table, bgcolor=#000000)
table.cell(tbl, 10, 1, "I_Bar", text_color=#FFFFFF, text_size=Siz1Table,
bgcolor=#000000)

j = 2
if array.size(rsiArr) > 0
for i = 0 to array.size(rsiArr) - 1
if not na(array.get(rsiArr, i))

//config values in the cells


TF_VALUE = array.get(tfArr,i)
RSI_VALUE = array.get(rsiArr, i)
K_VALUE = array.get(ArrK, i)
D_VALUE = array.get(ArrD, i)

ema9_VALUE = array.get(Arr9, i)
ema9c_VALUE = array.get(Arr9c, i)
ema9H_VALUE = array.get(Arr9H, i)
ema9L_VALUE = array.get(Arr9L, i)
ema9I_VALUE = array.get(Arr9I, i)

ema21_VALUE = array.get(Arr21, i)
ema21c_VALUE = array.get(Arr21c, i)
ema21H_VALUE = array.get(Arr21H, i)
ema21L_VALUE = array.get(Arr21L, i)
ema21I_VALUE = array.get(Arr21I, i)

ema35_VALUE = array.get(Arr35, i)
ema35c_VALUE = array.get(Arr35c, i)
ema35H_VALUE = array.get(Arr35H, i)
ema35L_VALUE = array.get(Arr35L, i)
ema35I_VALUE = array.get(Arr35I, i)

ema55_VALUE = array.get(Arr55, i)
ema55c_VALUE = array.get(Arr55c, i)
ema55H_VALUE = array.get(Arr55H, i)
ema55L_VALUE = array.get(Arr55L, i)
ema55I_VALUE = array.get(Arr55I, i)

ema100_VALUE = array.get(Arr100, i)
ema100c_VALUE = array.get(Arr100c, i)
ema100H_VALUE = array.get(Arr100H, i)
ema100L_VALUE = array.get(Arr100L, i)
ema100I_VALUE = array.get(Arr100I, i)

ema144_VALUE = array.get(Arr144, i)
ema144c_VALUE = array.get(Arr144c, i)
ema144H_VALUE = array.get(Arr144H, i)
ema144L_VALUE = array.get(Arr144L, i)
ema144I_VALUE = array.get(Arr144I, i)

ema200_VALUE = array.get(Arr200, i)
ema200c_VALUE = array.get(Arr200c, i)
ema200H_VALUE = array.get(Arr200H, i)
ema200L_VALUE = array.get(Arr200L, i)
ema200I_VALUE = array.get(Arr200I, i)

ema252_VALUE = array.get(Arr252, i)
ema252c_VALUE = array.get(Arr252c, i)
ema252H_VALUE = array.get(Arr252H, i)
ema252L_VALUE = array.get(Arr252L, i)
ema252I_VALUE = array.get(Arr252I, i)

SIGNAL = K_VALUE > D_VALUE ? "▲" : K_VALUE < D_VALUE ? "▼" : na


SIGNAL0 = ema9I_VALUE?"IB" : na
SIGNAL1 = ema9c_VALUE > ema9_VALUE ? "▲" : ema9c_VALUE < ema9_VALUE
? "▼" : na
SIGNAL2 = ema21c_VALUE > ema21_VALUE ? "▲" : ema21c_VALUE <
ema21_VALUE ? "▼" : na
SIGNAL3 = ema35c_VALUE > ema35_VALUE ? "▲" : ema35c_VALUE <
ema35_VALUE ? "▼" : na
SIGNAL4 = ema55c_VALUE > ema55_VALUE ? "▲" : ema55c_VALUE <
ema55_VALUE ? "▼" : na
SIGNAL5 = ema100c_VALUE > ema100_VALUE ? "▲" : ema100c_VALUE <
ema100_VALUE ? "▼" : na
SIGNAL6 = ema144c_VALUE > ema144_VALUE ? "▲" : ema144c_VALUE <
ema144_VALUE ? "▼" : na
SIGNAL7 = ema200c_VALUE > ema200_VALUE ? "▲" : ema200c_VALUE <
ema200_VALUE ? "▼" : na
SIGNAL8 = ema252c_VALUE > ema252_VALUE ? "▲" : ema252c_VALUE <
ema252_VALUE ? "▼" : na

//config colors in the the cells


//rsi
cond0 = (array.get(rsiArr,i)) > 40 and ((array.get(Arr9c,i)) >
(array.get(Arr9,i))) and ((array.get(Arr9c,i)) > (array.get(Arr21,i)))
?color.new(Ucol, 0): (array.get(rsiArr,i)) < 60 and
((array.get(Arr9c,i)) < (array.get(Arr9,i))) and ((array.get(Arr9c,i)) <
(array.get(Arr21,i)))
?color.new(Dcol, 0):color.new(#808080, 0)
cond0x = (array.get(Arr100I,i))==1?color.new(Ucol, 50):
(array.get(Arr100I,i))==-1?color.new(Dcol, 50):color.new(#808080, 50)
cond1 = (array.get(rsiArr,i)) >= OB
cond2 = (array.get(rsiArr, i)) <= OS

cond9x = (array.get(Arr9c,i)) > (array.get(Arr9,i))


cond9y = (array.get(Arr9c,i)) < (array.get(Arr9,i))

cond9Ix = (array.get(Arr9I,i))
cond9Iy = not (array.get(Arr9I,i))

cond21x = (array.get(Arr21c,i)) > (array.get(Arr21,i))


cond21y = (array.get(Arr21c,i)) < (array.get(Arr21,i))

cond35x = (array.get(Arr35c,i)) > (array.get(Arr35,i))


cond35y = (array.get(Arr35c,i)) < (array.get(Arr35,i))

cond55x = (array.get(Arr55c,i)) > (array.get(Arr55,i))


cond55y = (array.get(Arr55c,i)) < (array.get(Arr55,i))

cond100x = (array.get(Arr100c,i)) > (array.get(Arr100,i))


cond100y = (array.get(Arr100c,i)) < (array.get(Arr100,i))

cond144x = (array.get(Arr144c,i)) > (array.get(Arr144,i))


cond144y = (array.get(Arr144c,i)) < (array.get(Arr144,i))

cond200x = (array.get(Arr200c,i)) > (array.get(Arr200,i))


cond200y = (array.get(Arr200c,i)) < (array.get(Arr200,i))

cond252x = (array.get(Arr252c,i)) > (array.get(Arr252,i))


cond252y = (array.get(Arr252c,i)) < (array.get(Arr252,i))

//stochastic
cond3 = (array.get(ArrK,i)) >= OB_1
cond4 = (array.get(ArrK,i)) <= OS_1

cellRSI = cond1 ? color.new(Dcol,80) : cond2 ?


color.new(Ucol,80) : not cond1 and not cond2 ? color.new(#808080,80) : na

cell9 = cond9y ? color.new(Dcol,80) : cond9x ?


color.new(Ucol,80) : not cond9x and not cond9y ? color.new(#808080,80): na
cell9I = cond9Ix ? color.yellow: #808080
cell21 = cond21y ? color.new(Dcol,80) : cond21x ?
color.new(Ucol,80) : not cond21x and not cond21y ? color.new(#808080,80) : na
cell35 = cond35y ? color.new(Dcol,80) : cond35x ?
color.new(Ucol,80) : not cond35x and not cond35y ? color.new(#808080,80) : na
cell55 = cond55y ? color.new(Dcol,80) : cond55x ?
color.new(Ucol,80) : not cond55x and not cond55y ? color.new(#808080,80) : na
cell100 = cond100y ? color.new(Dcol,80) : cond100x ?
color.new(Ucol,80) : not cond100x and not cond100y ? color.new(#808080,80) : na
cell144 = cond144y ? color.new(Dcol,80) : cond144x ?
color.new(Ucol,80) : not cond144x and not cond144y ? color.new(#808080,80) : na
cell200 = cond200y ? color.new(Dcol,80) : cond200x ?
color.new(Ucol,80) : not cond200x and not cond200y ? color.new(#808080,80) : na
cell252 = cond252y ? color.new(Dcol,80) : cond252x ?
color.new(Ucol,80) : not cond252x and not cond252y ? color.new(#808080,80) : na

txtRSI = cond1 ? Dcol : cond2 ? Ucol : not cond1 and not cond2 ?
#808080 : na

txt9 = cond9y ? Dcol : cond9x ? Ucol : not cond9x and not cond9y ?
#808080 : na
txt9I = cond9Ix ? color.yellow : na
txt21 = cond21y ? Dcol : cond21x ? Ucol : not cond21x and not
cond21y ? #808080 : na
txt35 = cond35y ? Dcol : cond35x ? Ucol : not cond35x and not
cond35y ? #808080 : na
txt55 = cond55y ? Dcol : cond55x ? Ucol : not cond55x and not
cond55y ? #808080 : na
txt100 = cond100y ? Dcol : cond100x ? Ucol : not cond100x and not
cond100y ? #808080 : na
txt144 = cond144y ? Dcol : cond144x ? Ucol : not cond144x and not
cond144y ? #808080 : na
txt200 = cond200y ? Dcol : cond200x ? Ucol : not cond200x and not
cond200y ? #808080 : na
txt252 = cond252y ? Dcol : cond252x ? Ucol : not cond252x and not
cond252y ? #808080 : na

table.cell(tbl, 0, j, tfTxt(TF_VALUE), text_color=#FFFFFF,


text_halign=text.align_left, bgcolor=cond0, text_size = Siz1Table)
table.cell(tbl, 1, j, str.tostring(ema9_VALUE, format.mintick) +
SIGNAL1, text_color=txt9, text_halign=text.align_right, bgcolor=cell9, text_size =
Siz1Table)
table.cell(tbl, 2, j, str.tostring(ema21_VALUE, format.mintick) +
SIGNAL2, text_color=txt21, text_halign=text.align_right, bgcolor=cell21, text_size
= Siz1Table)
table.cell(tbl, 3, j, str.tostring(ema35_VALUE, format.mintick) +
SIGNAL3, text_color=txt35, text_halign=text.align_right, bgcolor=cell35, text_size
= Siz1Table)
table.cell(tbl, 4, j, str.tostring(ema55_VALUE, format.mintick) +
SIGNAL4, text_color=txt55, text_halign=text.align_right, bgcolor=cell55, text_size
= Siz1Table)
table.cell(tbl, 5, j, str.tostring(ema100_VALUE, format.mintick) +
SIGNAL5, text_color=txt100, text_halign=text.align_right, bgcolor=cell100,
text_size = Siz1Table)
table.cell(tbl, 6, j, str.tostring(ema144_VALUE, format.mintick) +
SIGNAL6, text_color=txt144, text_halign=text.align_right, bgcolor=cell144,
text_size = Siz1Table)
table.cell(tbl, 7, j, str.tostring(ema200_VALUE, format.mintick) +
SIGNAL7, text_color=txt200, text_halign=text.align_right, bgcolor=cell200,
text_size = Siz1Table)
table.cell(tbl, 8, j, str.tostring(ema252_VALUE, format.mintick) +
SIGNAL8, text_color=txt252, text_halign=text.align_right, bgcolor=cell252,
text_size = Siz1Table)
table.cell(tbl, 9, j, str.tostring(RSI_VALUE,
format.mintick),text_color=txtRSI, text_halign=text.align_right, bgcolor=cellRSI,
text_size = Siz1Table)
table.cell(tbl, 10, j, SIGNAL0, text_color=color.black,
text_halign=text.align_center, bgcolor=cell9I, text_size = Siz1Table)
j += 1

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy