VIVIDLY MIX Scalper With Signal DMI Trend
VIVIDLY MIX Scalper With Signal DMI Trend
//@version=6
indicator('VIVIDLY MIX Scalper with signal & DMI Trend', shorttitle =
'VMS V3', overlay = true, max_lines_count = 500, max_boxes_count
= 250, max_bars_back = 500)
// CM_SlingShotSystem
//Created by ChrisMoody on 10-05-2014
//Known as SlingShot Method that keeps Traders on Trending Side of
Market.
sae_CSS = input(true, title = 'Show Aggressive Entry?, Or Use as
Alert To Potential Conservative Entry? (CM_SlingShotSystem)', group
= 'CM_SlingShotSystem')
sce_CSS = input(true, title = 'Show Conservative Entry?
(CM_SlingShotSystem)', group = 'CM_SlingShotSystem')
st_CSS = input(true, title = 'Show Trend Arrows at Top and Bottom
of Screen? (CM_SlingShotSystem)', group = 'CM_SlingShotSystem')
def_CSS = input(false, title = 'Only Choose 1 - Either Conservative
Entry Arrows or \'B\'-\'S\' Letters (CM_SlingShotSystem)', group =
'CM_SlingShotSystem')
pa_CSS = input(true, title = 'Show Conservative Entry Arrows?
(CM_SlingShotSystem)', group = 'CM_SlingShotSystem')
sl_CSS = input(false, title = 'Show \'B\'-\'S\' Letters?
(CM_SlingShotSystem)', group = 'CM_SlingShotSystem')
//EMA Definitions
emaSlow_CSS = ta.ema(close, ema_slow_period_CSS)
emaFast_CSS = ta.ema(close, ema_fast_period_CSS)
//Define Up and Down Trend for Trend Arrows at Top and Bottom of
Screen
upTrend_CSS = emaFast_CSS >= emaSlow_CSS
downTrend_CSS = emaFast_CSS < emaSlow_CSS
// © Saleh_Toodarvari
// indicator(title="Parabolic SAR + EMA 200 + MACD Signals",
shorttitle="SAR EMA MACD", overlay=true, timeframe="",
timeframe_gaps=true)
// Inputs
sar_start = input(0.02)
sar_increment = input(0.02)
sar_maximum = input(0.2, 'Max Value')
ema_len = input.int(200, minval = 1, title = 'Length')
ema_src = input(close, title = 'Source')
ema_offset = input.int(title = 'Offset', defval = 0, minval = -500,
maxval = 500)
macd_fast_length = input(title = 'Fast Length', defval = 12)
macd_slow_length = input(title = 'Slow Length', defval = 26)
macd_src = input(title = 'Source', defval = close)
signal_length = input.int(title = 'Signal Smoothing', minval = 1,
maxval = 50, defval = 9)
sma_source = input.string(title = 'Oscillator MA Type', defval =
'EMA', options = ['SMA', 'EMA'])
sma_signal = input.string(title = 'Signal Line MA Type', defval =
'EMA', options = ['SMA', 'EMA'])
// Colors
col_macd = input(#2962FF, 'MACD Line ', group = 'Color Settings',
inline = 'MACD')
col_signal = input(#FF6D00, 'Signal Line ', group = 'Color
Settings', inline = 'Signal')
col_grow_above = input(#26A69A, 'Above Grow', group =
'Histogram', inline = 'Above')
col_fall_above = input(#B2DFDB, 'Fall', group = 'Histogram', inline =
'Above')
col_grow_below = input(#FFCDD2, 'Below Grow', group =
'Histogram', inline = 'Below')
col_fall_below = input(#FF5252, 'Fall', group = 'Histogram', inline =
'Below')
// Parabolic SAR
SAR = ta.sar(sar_start, sar_increment, sar_maximum)
plot(SAR, 'ParabolicSAR', style = plot.style_circles, color = #2962FF)
// EMA 200
EMA_200 = ta.ema(ema_src, ema_len)
plot(EMA_200, title = 'EMA', color = #e7eb10, linewidth = 2, offset
= ema_offset)
// MACD
fast_ma = sma_source == 'SMA' ? ta.sma(macd_src,
macd_fast_length) : ta.ema(macd_src, macd_fast_length)
slow_ma = sma_source == 'SMA' ? ta.sma(macd_src,
macd_slow_length) : ta.ema(macd_src, macd_slow_length)
macd = fast_ma - slow_ma
signal = sma_signal == 'SMA' ? ta.sma(macd, signal_length) :
ta.ema(macd, signal_length)
delta = macd - signal
// Conditions
main_trend = if ohlc4 < EMA_200
'Bearish'
else
'Bullish'
macd_long = if ta.crossover(delta, 0)
true
else
false
macd_short = if ta.crossunder(delta, 0)
true
else
false
// Long
buy_signal = sar_long and macd_long and main_trend == 'Bullish'
// Short
sell_signal = sar_short and macd_short and main_trend == 'Bearish'
// Plots
// plotshape(buy_signal, title = 'Buy Label', text = 'Buy', location =
location.belowbar, style = shape.labelup, size = size.tiny, color =
color.green, textcolor = color.white)
// plotshape(sell_signal, title = 'Sell Label', text = 'Sell', location =
location.abovebar, style = shape.labeldown, size = size.tiny, color =
color.red, textcolor = color.white)
//_________________alerts_________________
alertcondition(buy_signal, title = 'SAR EMA200 MACD Buy signal!',
message = 'Buy signal')
alertcondition(sell_signal, title = 'SAR EMA200 MACD Sell signal!',
message = 'Sell signal')
// © LonesomeTheBlue
// iindicator("Double Zig Zag with HHLL", overlay=true,
max_bars_back=500)
prd1 = input.int(defval = 8, title = 'ZigZag Period 1', minval = 2,
maxval = 20)
prd2 = input.int(defval = 20, title = 'ZigZag Period 2', minval = 2,
maxval = 50)
showzz = input.string(defval = 'Show Both', title = 'Show Zig Zags',
options = ['Show Zig Zag 1', 'Show Zig Zag 2', 'Show Both', 'Show
None'])
showhhll = input.string(defval = 'Show Both', title = 'Show HHLL',
options = ['Show HHLL 1', 'Show HHLL 2', 'Show Both', 'Show None'])
upcol1 = input(defval = color.lime, title = 'Zig Zag 1 Up Color')
dncol1 = input(defval = color.red, title = 'Zig Zag 1 Down Color')
upcol2 = input(defval = color.blue, title = 'Zig Zag 2 Up Color')
dncol2 = input(defval = color.purple, title = 'Zig Zag 2 Down Color')
txtcol = input(defval = color.black, title = 'Text Color')
zz1style = input.string(defval = 'Dashed', title = 'Zig Zag 1 Line
Style', options = ['Dashed', 'Dotted'])
zz1width = input.int(defval = 2, title = 'Zig zag 1 Line Width', minval
= 1, maxval = 4)
zz2width = input.int(defval = 3, title = 'Zig zag 2 Line Width', minval
= 1, maxval = 6)
var dir1 = 0
var dir2 = 0
dir1 := bool(ph1) and na(pl1) ? 1 : bool(pl1) and na(ph1) ? -1 : dir1
dir2 := bool(ph2) and na(pl2) ? 1 : bool(pl2) and na(ph2) ? -1 : dir2
dir1changed = ta.change(dir1)
if bool(ph1) or bool(pl1)
if bool(dir1changed)
add_to_zigzag(zigzag1, dir1 == 1 ? ph1 : pl1, bar_index)
else
update_zigzag(zigzag1, dir1 == 1 ? ph1 : pl1, bar_index,
dir1)
dir2changed = ta.change(dir2)
if bool(ph2) or bool(pl2)
if bool(dir2changed)
add_to_zigzag(zigzag2, dir2 == 1 ? ph2 : pl2, bar_index)
else
update_zigzag(zigzag2, dir2 == 1 ? ph2 : pl2, bar_index,
dir2)
if array.size(zigzag1) >= 6
var line zzline1 = na
var label zzlabel1 = na
if array.get(zigzag1, 0) != array.get(oldzigzag1, 0) or
array.get(zigzag1, 1) != array.get(oldzigzag1, 1)
if array.get(zigzag1, 2) == array.get(oldzigzag1, 2) and
array.get(zigzag1, 3) == array.get(oldzigzag1, 3)
line.delete(zzline1)
label.delete(zzlabel1)
if showzz == 'Show Zig Zag 1' or showzz == 'Show Both'
zzline1 := line.new(x1 = math.round(array.get(zigzag1,
1)), y1 = array.get(zigzag1, 0), x2 = math.round(array.get(zigzag1,
3)), y2 = array.get(zigzag1, 2), color = dir1 == 1 ? upcol1 : dncol1,
width = zz1width, style = zz1style == 'Dashed' ? line.style_dashed :
line.style_dotted)
zzline1
if showhhll == 'Show HHLL 1' or showhhll == 'Show Both'
hhlltxt = dir1 == 1 ? array.get(zigzag1, 0) >
array.get(zigzag1, 4) ? 'HH' : 'LH' : array.get(zigzag1, 0) <
array.get(zigzag1, 4) ? 'LL' : 'HL'
labelcol = dir1 == 1 ? array.get(zigzag1, 0) >
array.get(zigzag1, 4) ? upcol1 : dncol1 : array.get(zigzag1, 0) <
array.get(zigzag1, 4) ? dncol1 : upcol1
zzlabel1 := label.new(x = math.round(array.get(zigzag1,
1)), y = array.get(zigzag1, 0), text = hhlltxt, color = labelcol,
textcolor = txtcol, style = dir1 == 1 ? label.style_label_down :
label.style_label_up)
zzlabel1
if array.size(zigzag2) >= 6
var line zzline2 = na
var label zzlabel2 = na
if array.get(zigzag2, 0) != array.get(oldzigzag2, 0) or
array.get(zigzag2, 1) != array.get(oldzigzag2, 1)
if array.get(zigzag2, 2) == array.get(oldzigzag2, 2) and
array.get(zigzag2, 3) == array.get(oldzigzag2, 3)
line.delete(zzline2)
label.delete(zzlabel2)
if showzz == 'Show Zig Zag 2' or showzz == 'Show Both'
zzline2 := line.new(x1 = math.round(array.get(zigzag2,
1)), y1 = array.get(zigzag2, 0), x2 = math.round(array.get(zigzag2,
3)), y2 = array.get(zigzag2, 2), color = dir2 == 1 ? upcol2 : dncol2,
width = zz2width)
zzline2
if showhhll == 'Show HHLL 2' or showhhll == 'Show Both'
hhlltxt = dir2 == 1 ? array.get(zigzag2, 0) >
array.get(zigzag2, 4) ? 'HH' : 'LH' : array.get(zigzag2, 0) <
array.get(zigzag2, 4) ? 'LL' : 'HL'
labelcol = dir2 == 1 ? array.get(zigzag2, 0) >
array.get(zigzag2, 4) ? upcol2 : dncol2 : array.get(zigzag2, 0) <
array.get(zigzag2, 4) ? dncol2 : upcol2
zzlabel2 := label.new(x = math.round(array.get(zigzag2,
1)), y = array.get(zigzag2, 0), text = hhlltxt, color = labelcol,
textcolor = txtcol, style = dir2 == 1 ? label.style_label_down :
label.style_label_up)
zzlabel2
// © LeviathanCapital
// indicator("Swing Points and Liquidity - By Leviathan",
overlay=true, max_boxes_count=500, max_lines_count=500,
max_labels_count = 500)
// Inputs
swingSizeR = input.int(10, 'Bars Right-Left', inline = 'brl')
swingSizeL = input.int(15, '-', inline = 'brl')
showBoxes = input.bool(true, 'Show Boxes ', inline = 'aa')
showSwingLines = input.bool(true, 'Show Lines', inline = 'aa')
showBubbles = input.bool(true, 'Show Labels ', inline = 'bb')
showVol = input.bool(false, 'Show Volume', inline = 'bb')
showOId = input.bool(false, 'Show OI Δ ', inline = 'cc')
extendtilfilled = input.bool(true, 'Extend Until Fill', inline = 'cc')
// Conditions
hidefilled = input.bool(false, 'Hide Filled', group = 'Conditions')
voltresh = input.int(0, 'Volume >', group = 'Conditions')
oitresh = input.int(0, 'OI Δ (abs.) >', group = 'Conditions')
pnoid = input.string('/', 'Only Swings With', options = ['Positive OI
Delta', 'Negative OI Delta', '/'], group = 'Conditions')
// Appearance inputs
showhighs = input.bool(true, '', inline = 'sh', group = 'Appearance')
showlows = input.bool(true, '', inline = 'sl', group = 'Appearance')
sellcol = input.color(#aa2430, 'Lows (Line - Label - Box)', inline =
'sh', group = 'Appearance')
buycol = input.color(#66bb6a, 'Highs (Line - Label - Box)', inline =
'sl', group = 'Appearance')
sellcolB = input.color(#aa2430, '', inline = 'sh', group =
'Appearance')
buycolB = input.color(#66bb6a, '', inline = 'sl', group =
'Appearance')
sellboxCol = input.color(#80192231, '', inline = 'sh', group =
'Appearance')
buyboxCol = input.color(#66bb6a31, '', inline = 'sl', group =
'Appearance')
lineStyle = input.string('Dotted', 'Line Style + Width', ['Solid',
'Dashed', 'Dotted'], inline = 'l', group = 'Appearance')
lineWid = input.int(1, '', inline = 'l', group = 'Appearance')
boxWid = input.float(0.7, 'Box Width + Type ', step = 0.1, inline =
'xx', group = 'Appearance')
boxStyle = input.string('TYPE 1', '', options = ['TYPE 1', 'TYPE 2'],
inline = 'xx', group = 'Appearance')
labelsize = input.string('Size: Tiny', 'Text Style ', options =
['Size: Normal', 'Size: Large', 'Size: Small', 'Size: Tiny', 'Size: Auto'],
inline = 'txt', group = 'Appearance')
texthalign = input.string('Right', '', options = ['Middle', 'Right',
'Left'], inline = 'txt', group = 'Appearance')
lookback = input.bool(false, '', inline = 'lb')
daysBack = input.float(150, 'Lookback (D) ', inline =
'lb')
// OI Data
binance = input.bool(true, 'Binance USDT.P', inline = 'src', group =
'Open Interest')
binance2 = input.bool(true, 'Binance USD.P', inline = 'src', group =
'Open Interest')
binance3 = input.bool(true, 'Binance BUSD.P', inline = 'src2', group
= 'Open Interest')
bitmex = input.bool(true, 'BitMEX USD.P', inline = 'src2', group =
'Open Interest')
bitmex2 = input.bool(true, 'BitMEX USDT.P ', inline = 'src3', group =
'Open Interest')
kraken = input.bool(true, 'Kraken USD.P', inline = 'src3', group =
'Open Interest')
//Pivot calculations
int prevHighIndex = na
int prevLowIndex = na
bool highActive = false
bool lowActive = false
bool h = false
bool l = false
pivHi = ta.pivothigh(high, swingSizeL, swingSizeR)
pivLo = ta.pivotlow(low, swingSizeL, swingSizeR)
if not na(pivHi)
h := true
prevHighIndex := bar_index - swingSizeR
prevHighIndex
if not na(pivLo)
l := true
prevLowIndex := bar_index - swingSizeR
prevLowIndex
// Getting OI data
mex = syminfo.basecurrency == 'BTC' ? 'XBT' :
string(syminfo.basecurrency)
oid1 = nz(request.security('BINANCE' + ':' +
string(syminfo.basecurrency) + 'USDT.P_OI', timeframe.period, close
- close[1], ignore_invalid_symbol = true), 0)
oid2 = nz(request.security('BINANCE' + ':' +
string(syminfo.basecurrency) + 'USD.P_OI', timeframe.period, close -
close[1], ignore_invalid_symbol = true), 0)
oid3 = nz(request.security('BINANCE' + ':' +
string(syminfo.basecurrency) + 'BUSD.P_OI', timeframe.period, close
- close[1], ignore_invalid_symbol = true), 0)
oid4 = nz(request.security('BITMEX' + ':' + mex + 'USD.P_OI',
timeframe.period, close - close[1], ignore_invalid_symbol = true), 0)
oid5 = nz(request.security('BITMEX' + ':' + mex + 'USDT.P_OI',
timeframe.period, close - close[1], ignore_invalid_symbol = true), 0)
oid6 = nz(request.security('KRAKEN' + ':' +
string(syminfo.basecurrency) + 'USD.P_OI', timeframe.period, close -
close[1], ignore_invalid_symbol = true), 0)
// Looping over the full array of lines and updating them, and
deleting them if they have been touched
size = array.size(levelBoxes)
if size > 0
for i = 0 to size - 1 by 1
j = size - 1 - i
box = array.get(levelBoxes, j)
line = array.get(levelLines, j)
level = line.get_y2(line)
filled = high >= level and low <= level
box.set_right(box, bar_index + 1)
line.set_x2(line, bar_index + 1)
if filled and hidefilled
array.remove(levelLines, j)
array.remove(levelBoxes, j)
line.delete(line)
box.delete(box)
change = ta.change(rsiSourceInput)
up = ta.rma(math.max(change, 0), rsiLengthInput)
down = ta.rma(-math.min(change, 0), rsiLengthInput)
rsi = down == 0 ? 100 : up == 0 ? 0 : 100 - (100 / (1 + up / down))
// Smoothing MA inputs
GRP = "Moving Average"
TT_BB = "Only applies when 'SMA + Bollinger Bands' is selected.
Determines the distance between the SMA and the bands."
maTypeInput = input.string("SMA", "Type", options = ["None",
"SMA", "SMA + Bollinger Bands", "EMA", "SMMA (RMA)", "WMA",
"VWMA"], group = GRP, display = display.data_window)
maLengthInput = input.int(14, "Length", group = GRP, display =
display.data_window)
bbMultInput = input.float(2.0, "BB StdDev", minval = 0.001, maxval
= 50, step = 0.5, tooltip = TT_BB, group = GRP, display =
display.data_window)
var enableMA = maTypeInput != "None"
var isBB = maTypeInput == "SMA + Bollinger Bands"
// Smoothing MA Calculation
ma(source, length, MAtype) =>
switch MAtype
"SMA" => ta.sma(source, length)
"SMA + 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)
// Smoothing MA plots
smoothingMA = enableMA ? ma(rsi, maLengthInput, maTypeInput) :
na
smoothingStDev = isBB ? ta.stdev(rsi, maLengthInput) * bbMultInput
: na
// plot(smoothingMA, "RSI-based MA", color=color.yellow, display =
enableMA ? display.all : display.none)
// bbUpperBand = plot(smoothingMA + smoothingStDev, title =
"Upper Bollinger Band", color=color.green, display = isBB ?
display.all : display.none)
// bbLowerBand = plot(smoothingMA - smoothingStDev, title =
"Lower Bollinger Band", color=color.green, display = isBB ?
display.all : display.none)
// fill(bbUpperBand, bbLowerBand, color= isBB ?
color.new(color.green, 90) : na, title="Bollinger Bands Background
Fill", display = isBB ? display.all : display.none)
// Divergence
lookbackRight = 5
lookbackLeft = 5
rangeUpper = 60
rangeLower = 5
bearColor = color.red
bullColor = color.green
textColor = color.white
noneColor = color.new(color.white, 100)
plFound = false
phFound = false
bullCond = false
bearCond = false
rsiLBR = rsi[lookbackRight]
if calculateDivergence
//------------------------------------------------------------------------------
// Regular Bullish
// rsi: Higher Low
plFound := not na(ta.pivotlow(rsi, lookbackLeft, lookbackRight))
rsiHL = rsiLBR > ta.valuewhen(plFound, rsiLBR, 1) and
_inRange(plFound[1])
// Price: Lower Low
lowLBR = low[lookbackRight]
priceLL = lowLBR < ta.valuewhen(plFound, lowLBR, 1)
bullCond := priceLL and rsiHL and plFound
//------------------------------------------------------------------------------
// Regular Bearish
// rsi: Lower High
phFound := not na(ta.pivothigh(rsi, lookbackLeft,
lookbackRight))
rsiLH = rsiLBR < ta.valuewhen(phFound, rsiLBR, 1) and
_inRange(phFound[1])
// Price: Higher High
highLBR = high[lookbackRight]
priceHH = highLBR > ta.valuewhen(phFound, highLBR, 1)
bearCond := priceHH and rsiLH and phFound
//DMI
diLength = input.int(14, title="DI Length", minval=1, group="Trend
Detection")
adxSmoothing = input.int(14, title="ADX Smoothing", minval=1,
group="Trend Detection")
adxThreshold = input.float(20, title="ADX Threshold for Trend",
group="Trend Detection")
// © vikmillion
table_size_input = input.string("Normal", "Table Size",
options=["Tiny", "Small", "Normal", "Large", "Huge"])
// Function to determine text size based on input
get_text_size(size) =>
switch size
"Tiny" => size.tiny
"Small" => size.small
"Normal" => size.normal
"Large" => size.large
"Huge" => size.huge
=> size.small
if barstate.isfirst
table.cell_set_text(signalsTable, 0, 0, '\nCHECK')
table.cell_set_text_size(signalsTable, 0, 0, textSize)
table.cell_set_text(signalsTable, 1, 0, '\nLONG')
table.cell_set_text_size(signalsTable, 1, 0, textSize)
table.cell_set_text(signalsTable, 2, 0, '\nSHORT')
table.cell_set_text_size(signalsTable, 2, 0, textSize)
table.cell_set_text_color(signalsTable, 2, 0, color.red)
/// 1. RSI vs MA
table.cell_set_text(signalsTable, 0, 1, "RSI vs MA")
table.cell_set_text_size(signalsTable, 0, 1, textSize)
if rsi_cross_above_ma
rsiCrossState := 1
if rsi_cross_below_ma
rsiCrossState := -1
if rsiCrossState == 1
table.cell_set_text(signalsTable, 1, 1, "✔️")
table.cell_set_bgcolor(signalsTable, 1, 1, color.lime)
table.cell_set_text_color(signalsTable, 1, 1, color.black)
table.cell_set_text_size(signalsTable, 1, 1, textSize)
table.cell_set_text(signalsTable, 2, 1, "➖")
table.cell_set_bgcolor(signalsTable, 2, 1, color.white)
table.cell_set_text_color(signalsTable, 2, 1, color.black)
table.cell_set_text_size(signalsTable, 2, 1, textSize)
else if rsiCrossState == -1
table.cell_set_text(signalsTable, 1, 1, "➖")
table.cell_set_bgcolor(signalsTable, 1, 1, color.white)
table.cell_set_text_color(signalsTable, 1, 1, color.black)
table.cell_set_text_size(signalsTable, 1, 1, textSize)
table.cell_set_text(signalsTable, 2, 1, "✔️")
table.cell_set_bgcolor(signalsTable, 2, 1, color.red)
table.cell_set_text_color(signalsTable, 2, 1, color.white)
table.cell_set_text_size(signalsTable, 2, 1, textSize)
else
table.cell_set_text(signalsTable, 1, 1, "➖")
table.cell_set_bgcolor(signalsTable, 1, 1, color.white)
table.cell_set_text_color(signalsTable, 1, 1, color.black)
table.cell_set_text_size(signalsTable, 1, 1, textSize)
table.cell_set_text(signalsTable, 2, 1, "➖")
table.cell_set_bgcolor(signalsTable, 2, 1, color.white)
table.cell_set_text_color(signalsTable, 2, 1, color.black)
table.cell_set_text_size(signalsTable, 2, 1, textSize)
// 2. MACD: cross
bool macd_signal_below = signal < macd
bool macd_signal_above = signal > macd
table.cell_set_text(signalsTable, 0, 2, "MACD CROSS")
table.cell_set_text_size(signalsTable, 0, 2, textSize)
// 3. MACD: hist
bool macd_hist_above_zero = delta > 0
bool macd_hist_below_zero = delta < 0
table.cell_set_text(signalsTable, 0, 3, "MACD HIST")
table.cell_set_text_size(signalsTable, 0, 3, textSize)
// 4. AO: Bar
table.cell_set_text(signalsTable, 0, 4, "AO BAR")
table.cell_set_text_size(signalsTable, 0, 4, textSize)
// AO-текущее и AO-предыдущее
bool barIsGreen = ao > ao[1]
bool barIsRed = ao <= ao[1]
if barIsGreen
table.cell_set_text(signalsTable, 1, 4, "✔️")
table.cell_set_bgcolor(signalsTable, 1, 4, color.lime)
table.cell_set_text_color(signalsTable, 1, 4, color.black)
table.cell_set_text_size(signalsTable, 1, 4, textSize)
else
table.cell_set_text(signalsTable, 1, 4, "➖")
table.cell_set_bgcolor(signalsTable, 1, 4, color.white)
table.cell_set_text_color(signalsTable, 1, 4, color.black)
table.cell_set_text_size(signalsTable, 1, 4, textSize)
if barIsRed
table.cell_set_text(signalsTable, 2, 4, "✔️")
table.cell_set_bgcolor(signalsTable, 2, 4, color.red)
table.cell_set_text_color(signalsTable, 2, 4, color.white)
table.cell_set_text_size(signalsTable, 2, 4, textSize)
else
table.cell_set_text(signalsTable, 2, 4, "➖")
table.cell_set_bgcolor(signalsTable, 2, 4, color.white)
table.cell_set_text_color(signalsTable, 2, 4, color.black)
table.cell_set_text_size(signalsTable, 2, 4, textSize)
// 5. SAR
table.cell_set_text(signalsTable, 0, 5, "SAR")
table.cell_set_text_size(signalsTable, 0, 5, textSize)
// 6. RSI 50
table.cell_set_text(signalsTable, 0, 6, "RSI 50")
table.cell_set_text_size(signalsTable, 0, 6, textSize)
// 7. Awesome Oscillator 0
table.cell_set_text(signalsTable, 0, 7, "AO")
table.cell_set_text_size(signalsTable, 0, 7, textSize)
// 8. 200MA
bool trend_above_ma = close > EMA_200
bool trend_below_ma = close < EMA_200
table.cell_set_text(signalsTable, 0, 8, "200MA")
table.cell_set_text_size(signalsTable, 0, 8, textSize)
// 11. DMI
table.cell_set_text(signalsTable, 0, 11, "DMI:Trend/Flat ")
table.cell_set_text_size(signalsTable, 0, 11, textSize)
if isFlat
table.cell_set_text(signalsTable, 1, 11, "✔️")
table.cell_set_bgcolor(signalsTable, 1, 11, color.gray)
table.cell_set_text_color(signalsTable, 1, 11, color.white)
table.cell_set_text_size(signalsTable, 1, 11, textSize)
if buySignal
inLong := true
if sellSignal
inLong := false