?Signals @fian_trader
?Signals @fian_trader
// =================================
// PLEASE SUPPORT THE TEAM
// =================================
//
// If this project has been helpful, consider making a donation:
// Biance UID: 263856481
// Telegram: https://t.me/enigmawaytrading
// =================================
//@version=5
strategy('📡Signals @fian_trader', overlay=true, default_qty_type=strategy.cash,
default_qty_value=10000, initial_capital=10000, currency='USD',
commission_type=strategy.commission.percent, commission_value=0.03,
max_bars_back=3000, max_lines_count=100, calc_on_every_tick=false,
max_labels_count=100)
//Truncate Function
truncate(number, decimals) =>
factor = math.pow(10, decimals)
int(number * factor) / factor
//
===================================================================================
====
// Trade Time
daysback = input(14, title='Backtest Days, For Defining Best TF, Max: 20 Days')
millisecondinxdays = 1000 * 60 * 60 * 24 * daysback
leftbar = timenow - time < millisecondinxdays
backtest = leftbar
dpa = 4
//
===================================================================================
====
et1 = 'Supertrend'
longside = input.bool(true, title='Long Side', group='Strategy Option')
shortside = input.bool(true, title='Short Side', group='Strategy Option')
filter1 = 'Filter with Atr'
filter2 = 'Filter with RSI'
filter3 = 'Atr or RSI'
filter4 = 'Atr and RSI'
filter5 = 'No Filtering'
filter6 = 'Entry Only in sideways market(By ATR or RSI)'
filter7 = 'Entry Only in sideways market(By ATR and RSI)'
typefilter = input.string(filter5, title='Sideways Filtering Input',
options=[filter1, filter2, filter3, filter4, filter5, filter6, filter7],
group='Strategy Options')
withsl = input.bool(false, title='Use Dynamic SL?', group='Strategy Options')
// TP SL Option
ex1 = 'TP & SL by Percentage Price'
ex2 = 'TP & SL by atr Value'
et = input.string(ex2, title='TP SL Type', options=[ex1, ex2], group='Strategy
Options')
//===================================================================
//===================================================================
//Timeframe
//Supertrend Indicator
src = hl2
atr2 = ta.sma(ta.tr, period)
atr = request.security(syminfo.ticker, '', ta.atr(period))
up = src - mult * atr
up1 = nz(up[1], up)
up := close[1] > up1 ? math.max(up, up1) : up
dn = src + mult * atr
dn1 = nz(dn[1], dn)
dn := close[1] < dn1 ? math.min(dn, dn1) : dn
trend = 1
trend := nz(trend[1], trend)
trend := trend == -1 and close > dn1 ? 1 : trend == 1 and close < up1 ? -1 : trend
st = trend == 1 ? up : dn
//filtering
atra = request.security(syminfo.tickerid, '', ta.atr(atrLen))
atrMa = atrMaType == 'EM' ? ta.ema(atra, atrMaLen) : ta.sma(atra, atrMaLen)
updm = ta.change(high)
downdm = -ta.change(low)
plusdm = na(updm) ? na : updm > downdm and updm > 0 ? updm : 0
minusdm = na(downdm) ? na : downdm > updm and downdm > 0 ? downdm : 0
//trur = rma(tr, diLen)
//plus = fixnan(100 * rma(plusdm, diLen) / trur)
//minus = fixnan(100 * rma(minusdm, diLen) / trur)
//sum = plus + minus
//adx = 100 * rma(abs(plus - minus) / (sum == 0 ? 1 : sum), adxLen)
// Entry FIX
buysignal1 = ta.crossover(close, st)
sellsignal1 = ta.crossunder(close, st)
cs = ta.valuewhen(sell, close, 0)
ratrs = ta.valuewhen(sell, ta.atr(14), 0)
tps1 = cs - ratrs * TP1
tps2 = cs - ratrs * TP2
tps3 = cs - ratrs * TP3
tps4 = cs - ratrs * TP4
sls = cs + ratrs * SL //withsl?dn:valuewhen(sell, dn, 0)
Ptpb1 = cb * (1 + ptp1)
Ptpb2 = cb * (1 + ptp2)
Ptpb3 = cb * (1 + ptp3)
Ptpb4 = et == ex1 ? cb * (1 + ptp4) : tpb4
Pslb = cb * (1 - psl)
Ptps1 = cs * (1 - ptp1)
Ptps2 = cs * (1 - ptp2)
Ptps3 = cs * (1 - ptp3)
Ptps4 = et == ex1 ? cs * (1 - ptp4) : tps4
Psls = cs * (1 + psl)
//Variable Fix TP SL
tpb1t = et == ex1 ? Ptpb1 : tpb1
tpb2t = et == ex1 ? Ptpb2 : tpb2
tpb3t = et == ex1 ? Ptpb3 : tpb3
tpb4t = Ptpb4
slbt = et == ex1 ? Pslb : slb
tps1t = et == ex1 ? Ptps1 : tps1
tps2t = et == ex1 ? Ptps2 : tps2
tps3t = et == ex1 ? Ptps3 : tps3
tps4t = Ptps4
slst = et == ex1 ? Psls : sls
//===================================================================
//Input Zignaly Settings
z1 = 'Copy trading / Profit Sharing'
z2 = 'Signal Providing'
z3 = 'Telegram Notification'
ZZ = input.string(z3, title='BOT Type', options=[z1, z2, z3], group='Zignaly
Settings')
P1 = 'Pair 1'
P2 = 'Pair 2'
P3 = 'Pair 3'
pair = input.string(defval=P1, title='Pair Trade', options=[P1, P2, P3],
group='Zignaly Settings')
apikey = input.string('xxx', title='Api Key', group='Zignaly Settings')
margin = input.int(10, title='Margin % (Use it Only if you use copytrading or
profit sharing)', group='Zignaly Settings')
lev = input.int(30, group='Zignaly Settings')
qty = margin / close
// Zignaly Settings
pair1 = input.string('btcusdt', group='Pair & Signalid, Gunakan Huruf Kecil')
signal1 = input.string('btc', group='Pair & Signalid, Gunakan Huruf Kecil')
pair2 = input.string('ethusdt', group='Pair & Signalid, Gunakan Huruf Kecil')
signal2 = input.string('eth', group='Pair & Signalid, Gunakan Huruf Kecil')
pair3 = input.string('xxxusdt', group='Pair & Signalid, Gunakan Huruf Kecil')
signal3 = input.string('xxx', group='Pair & Signalid, Gunakan Huruf Kecil')
//===================================================================
//MTF Analysis
//===================================================================
//===================================================================
//Source MTF
tf1 = input.timeframe('15', group='MTF Analysis')
tf2 = input.timeframe('30', group='MTF Analysis')
tf3 = input.timeframe('45', group='MTF Analysis')
tf4 = input.timeframe('60', group='MTF Analysis')
//===================================================================
//===================================================================
//Timeframe A
//Supertrend Indicator
srcA = hl2A
atr2A = ta.sma(trA, period)
atrA = request.security(syminfo.tickerid, tf1, ta.atr(period))
upA = srcA - mult * atrA
up1A = nz(upA[1], upA)
upA := closeA[1] > up1A ? math.max(upA, up1A) : upA
dnA = srcA + mult * atrA
dn1A = nz(dnA[1], dnA)
dnA := closeA[1] < dn1A ? math.min(dnA, dn1A) : dnA
trendA = 1
trendA := nz(trendA[1], trendA)
trendA := trendA == -1 and closeA > dn1A ? 1 : trendA == 1 and closeA < up1A ? -1 :
trendA
stA = trendA == 1 ? upA : dnA
//filtering
atraA = request.security(syminfo.tickerid, tf1, ta.atr(atrLen))
atrMaA = atrMaType == 'EMA' ? ta.ema(atraA, atrMaLen) : ta.sma(atraA, atrMaLen)
updmA = ta.change(highA)
downdmA = -ta.change(lowA)
plusdmA = na(updmA) ? na : updmA > downdmA and updmA > 0 ? updmA : 0
minusdmA = na(downdmA) ? na : downdmA > updmA and downdmA > 0 ? downdmA : 0
//trurA = rma(trA, diLen)
//plusA = fixnan(100 * rma(plusdmA, diLen) / trurA)
//minusA = fixnan(100 * rma(minusdmA, diLen) / trurA)
//sumA = plusA + minusA
//adxA = 100 * rma(abs(plusA - minusA) / (sumA == 0 ? 1 : sumA), adxLen)
// Entry FIX
buysignal1A = ta.crossover(closeA, stA) and backtest and trendTypeA
sellsignal1A = ta.crossunder(closeA, stA) and backtest and trendTypeA
buyA = buysignal1A and longside
sellA = sellsignal1A and shortside
//Variable Fix TP SL
tpb1tA = et == ex1 ? Ptpb1A : tpb1A
tpb2tA = et == ex1 ? Ptpb2A : tpb2A
tpb3tA = et == ex1 ? Ptpb3A : tpb3A
tpb4tA = Ptpb4A
slbtA = et == ex1 ? PslbA : slbA
tps1tA = et == ex1 ? Ptps1A : tps1A
tps2tA = et == ex1 ? Ptps2A : tps2A
tps3tA = et == ex1 ? Ptps3A : tps3A
tps4tA = Ptps4A
slstA = et == ex1 ? PslsA : slsA
//============================================
cumbuyA = ta.cum(buyA ? 1 : 0)
cumsellA = ta.cum(sellA ? 1 : 0)
cumsignalA = cumbuyA + cumsellA
//net profit
sisaqtybA = stillopenb1A ? 1 : stillopenb2A ? 1 - Qtytp1 : stillopenb3A ? 1 -
(Qtytp1 + Qtytp2) : 1 - (Qtytp1 + Qtytp2 + Qtytp3)
sisaqtysA = stillopens1A ? 1 : stillopens2A ? 1 - Qtytp1 : stillopens3A ? 1 -
(Qtytp1 + Qtytp2) : 1 - (Qtytp1 + Qtytp2 + Qtytp3)
///winrate
wintpb1A = ta.cum(hittpb1A ? 1 : 0)
wintpb2A = ta.cum(hittpb2A ? 1 : 0)
wintpb3A = ta.cum(hittpb3A ? 1 : 0)
wintpb4A = ta.cum(hittpb4A ? 1 : 0)
wrslbA = ta.cum(hitslbA ? 1 : 0)
wintps1A = ta.cum(hittps1A ? 1 : 0)
wintps2A = ta.cum(hittps2A ? 1 : 0)
wintps3A = ta.cum(hittps3A ? 1 : 0)
wintps4A = ta.cum(hittps4A ? 1 : 0)
wrslsA = ta.cum(hitslsA ? 1 : 0)
//===================================================================
//===================================================================
//===================================================================
//===================================================================
//Timeframe B
//Supertrend Indicator
srcB = hl2B
atr2B = ta.sma(trB, period)
atrB = request.security(syminfo.tickerid, tf2, ta.atr(period))
upB = srcB - mult * atrB
up1B = nz(upB[1], upB)
upB := closeB[1] > up1B ? math.max(upB, up1B) : upB
dnB = srcB + mult * atrB
dn1B = nz(dnB[1], dnB)
dnB := closeB[1] < dn1B ? math.min(dnB, dn1B) : dnB
trendB = 1
trendB := nz(trendB[1], trendB)
trendB := trendB == -1 and closeB > dn1B ? 1 : trendB == 1 and closeB < up1B ? -1 :
trendB
stB = trendB == 1 ? upB : dnB
//filtering
atraB = request.security(syminfo.tickerid, tf2, ta.atr(atrLen))
atrMaB = atrMaType == 'EMB' ? ta.ema(atraB, atrMaLen) : ta.sma(atraB, atrMaLen)
updmB = ta.change(highB)
downdmB = -ta.change(lowB)
plusdmB = na(updmB) ? na : updmB > downdmB and updmB > 0 ? updmB : 0
minusdmB = na(downdmB) ? na : downdmB > updmB and downdmB > 0 ? downdmB : 0
//trurB = rma(trB, diLen)
//plusB = fixnan(100 * rma(plusdmB, diLen) / trurB)
//minusB = fixnan(100 * rma(minusdmB, diLen) / trurB)
//sumB = plusB + minusB
//adxB = 100 * rma(abs(plusB - minusB) / (sumB == 0 ? 1 : sumB), adxLen)
// Entry FIX
buysignal1B = ta.crossover(closeB, stB) and backtest and trendTypeB
sellsignal1B = ta.crossunder(closeB, stB) and backtest and trendTypeB
//Variable Fix TP SL
tpb1tB = et == ex1 ? Ptpb1B : tpb1B
tpb2tB = et == ex1 ? Ptpb2B : tpb2B
tpb3tB = et == ex1 ? Ptpb3B : tpb3B
tpb4tB = Ptpb4B
slbtB = et == ex1 ? PslbB : slbB
tps1tB = et == ex1 ? Ptps1B : tps1B
tps2tB = et == ex1 ? Ptps2B : tps2B
tps3tB = et == ex1 ? Ptps3B : tps3B
tps4tB = Ptps4B
slstB = et == ex1 ? PslsB : slsB
//============================================
cumbuyB = ta.cum(buyB ? 1 : 0)
cumsellB = ta.cum(sellB ? 1 : 0)
cumsignalB = cumbuyB + cumsellB
//net profit
sisaqtybB = stillopenb1B ? 1 : stillopenb2B ? 1 - Qtytp1 : stillopenb3B ? 1 -
(Qtytp1 + Qtytp2) : 1 - (Qtytp1 + Qtytp2 + Qtytp3)
sisaqtysB = stillopens1B ? 1 : stillopens2B ? 1 - Qtytp1 : stillopens3B ? 1 -
(Qtytp1 + Qtytp2) : 1 - (Qtytp1 + Qtytp2 + Qtytp3)
///winrate
wintpb1B = ta.cum(hittpb1B ? 1 : 0)
wintpb2B = ta.cum(hittpb2B ? 1 : 0)
wintpb3B = ta.cum(hittpb3B ? 1 : 0)
wintpb4B = ta.cum(hittpb4B ? 1 : 0)
wrslbB = ta.cum(hitslbB ? 1 : 0)
wintps1B = ta.cum(hittps1B ? 1 : 0)
wintps2B = ta.cum(hittps2B ? 1 : 0)
wintps3B = ta.cum(hittps3B ? 1 : 0)
wintps4B = ta.cum(hittps4B ? 1 : 0)
wrslsB = ta.cum(hitslsB ? 1 : 0)
//===================================================================
//===================================================================
//===================================================================
//===================================================================
//Timeframe C
//Supertrend Indicator
srcC = hl2C
atr2C = ta.sma(trC, period)
atrC = request.security(syminfo.tickerid, tf3, ta.atr(period))
upC = srcC - mult * atrC
up1C = nz(upC[1], upC)
upC := closeC[1] > up1C ? math.max(upC, up1C) : upC
dnC = srcC + mult * atrC
dn1C = nz(dnC[1], dnC)
dnC := closeC[1] < dn1C ? math.min(dnC, dn1C) : dnC
trendC = 1
trendC := nz(trendC[1], trendC)
trendC := trendC == -1 and closeC > dn1C ? 1 : trendC == 1 and closeC < up1C ? -1 :
trendC
stC = trendC == 1 ? upC : dnC
//filtering
atraC = request.security(syminfo.tickerid, tf3, ta.atr(atrLen))
atrMaC = atrMaType == 'EMC' ? ta.ema(atraC, atrMaLen) : ta.sma(atraC, atrMaLen)
updmC = ta.change(highC)
downdmC = -ta.change(lowC)
plusdmC = na(updmC) ? na : updmC > downdmC and updmC > 0 ? updmC : 0
minusdmC = na(downdmC) ? na : downdmC > updmC and downdmC > 0 ? downdmC : 0
//trurC = rma(trC, diLen)
//plusC = fixnan(100 * rma(plusdmC, diLen) / trurC)
//minusC = fixnan(100 * rma(minusdmC, diLen) / trurC)
//sumC = plusC + minusC
//adxC = 100 * rma(abs(plusC - minusC) / (sumC == 0 ? 1 : sumC), adxLen)
// Entry FIX
buysignal1C = ta.crossover(closeC, stC) and backtest and trendTypeC
sellsignal1C = ta.crossunder(closeC, stC) and backtest and trendTypeC
//Variable Fix TP SL
tpb1tC = et == ex1 ? Ptpb1C : tpb1C
tpb2tC = et == ex1 ? Ptpb2C : tpb2C
tpb3tC = et == ex1 ? Ptpb3C : tpb3C
tpb4tC = Ptpb4C
slbtC = et == ex1 ? PslbC : slbC
tps1tC = et == ex1 ? Ptps1C : tps1C
tps2tC = et == ex1 ? Ptps2C : tps2C
tps3tC = et == ex1 ? Ptps3C : tps3C
tps4tC = Ptps4C
slstC = et == ex1 ? PslsC : slsC
//============================================
cumbuyC = ta.cum(buyC ? 1 : 0)
cumsellC = ta.cum(sellC ? 1 : 0)
cumsignalC = cumbuyC + cumsellC
//net profit
sisaqtybC = stillopenb1C ? 1 : stillopenb2C ? 1 - Qtytp1 : stillopenb3C ? 1 -
(Qtytp1 + Qtytp2) : 1 - (Qtytp1 + Qtytp2 + Qtytp3)
sisaqtysC = stillopens1C ? 1 : stillopens2C ? 1 - Qtytp1 : stillopens3C ? 1 -
(Qtytp1 + Qtytp2) : 1 - (Qtytp1 + Qtytp2 + Qtytp3)
///winrate
wintpb1C = ta.cum(hittpb1C ? 1 : 0)
wintpb2C = ta.cum(hittpb2C ? 1 : 0)
wintpb3C = ta.cum(hittpb3C ? 1 : 0)
wintpb4C = ta.cum(hittpb4C ? 1 : 0)
wrslbC = ta.cum(hitslbC ? 1 : 0)
wintps1C = ta.cum(hittps1C ? 1 : 0)
wintps2C = ta.cum(hittps2C ? 1 : 0)
wintps3C = ta.cum(hittps3C ? 1 : 0)
wintps4C = ta.cum(hittps4C ? 1 : 0)
wrslsC = ta.cum(hitslsC ? 1 : 0)
//===================================================================
//===================================================================
//===================================================================
//===================================================================
//Timeframe D
//Supertrend Indicator
srcD = hl2D
atr2D = ta.sma(trD, period)
atrD = request.security(syminfo.tickerid, tf4, ta.atr(period))
upD = srcD - mult * atrD
up1D = nz(upD[1], upD)
upD := closeD[1] > up1D ? math.max(upD, up1D) : upD
dnD = srcD + mult * atrD
dn1D = nz(dnD[1], dnD)
dnD := closeD[1] < dn1D ? math.min(dnD, dn1D) : dnD
trendD = 1
trendD := nz(trendD[1], trendD)
trendD := trendD == -1 and closeD > dn1D ? 1 : trendD == 1 and closeD < up1D ? -1 :
trendD
stD = trendD == 1 ? upD : dnD
//filtering
atraD = request.security(syminfo.tickerid, tf4, ta.atr(atrLen))
atrMaD = atrMaType == 'EMD' ? ta.ema(atraD, atrMaLen) : ta.sma(atraD, atrMaLen)
updmD = ta.change(highD)
downdmD = -ta.change(lowD)
plusdmD = na(updmD) ? na : updmD > downdmD and updmD > 0 ? updmD : 0
minusdmD = na(downdmD) ? na : downdmD > updmD and downdmD > 0 ? downdmD : 0
//trurD = rma(trD, diLen)
//plusD = fixnan(100 * rma(plusdmD, diLen) / trurD)
//minusD = fixnan(100 * rma(minusdmD, diLen) / trurD)
//sumD = plusD + minusD
//adxD = 100 * rma(abs(plusD - minusD) / (sumD == 0 ? 1 : sumD), adxLen)
// Entry FIX
buysignal1D = ta.crossover(closeD, stD) and backtest and trendTypeD
sellsignal1D = ta.crossunder(closeD, stD) and backtest and trendTypeD
//Variable Fix TP SL
tpb1tD = et == ex1 ? Ptpb1D : tpb1D
tpb2tD = et == ex1 ? Ptpb2D : tpb2D
tpb3tD = et == ex1 ? Ptpb3D : tpb3D
tpb4tD = Ptpb4D
slbtD = et == ex1 ? PslbD : slbD
tps1tD = et == ex1 ? Ptps1D : tps1D
tps2tD = et == ex1 ? Ptps2D : tps2D
tps3tD = et == ex1 ? Ptps3D : tps3D
tps4tD = Ptps4D
slstD = et == ex1 ? PslsD : slsD
//============================================
cumbuyD = ta.cum(buyD ? 1 : 0)
cumsellD = ta.cum(sellD ? 1 : 0)
cumsignalD = cumbuyD + cumsellD
//net profit
sisaqtybD = stillopenb1D ? 1 : stillopenb2D ? 1 - Qtytp1 : stillopenb3D ? 1 -
(Qtytp1 + Qtytp2) : 1 - (Qtytp1 + Qtytp2 + Qtytp3)
sisaqtysD = stillopens1D ? 1 : stillopens2D ? 1 - Qtytp1 : stillopens3D ? 1 -
(Qtytp1 + Qtytp2) : 1 - (Qtytp1 + Qtytp2 + Qtytp3)
///winrate
wintpb1D = ta.cum(hittpb1D ? 1 : 0)
wintpb2D = ta.cum(hittpb2D ? 1 : 0)
wintpb3D = ta.cum(hittpb3D ? 1 : 0)
wintpb4D = ta.cum(hittpb4D ? 1 : 0)
wrslbD = ta.cum(hitslbD ? 1 : 0)
wintps1D = ta.cum(hittps1D ? 1 : 0)
wintps2D = ta.cum(hittps2D ? 1 : 0)
wintps3D = ta.cum(hittps3D ? 1 : 0)
wintps4D = ta.cum(hittps4D ? 1 : 0)
wrslsD = ta.cum(hitslsD ? 1 : 0)
//===================================================================
//===================================================================
//
===================================================================================
====
//Trend Panel
//Tele Notif
ep = trend == 1 ? cb : cs
winrate = truncate(strategy.wintrades / strategy.closedtrades * 100, 0)
capitalgain = 100 * strategy.netprofit / initialcapital
closedtrades = strategy.closedtrades
//Gathers User Inputs
//Dashboard
sideentry = strategy.position_size > 0 ? 'LONG' : strategy.position_size < 0 ?
'SHORT' : 'No Position'
epp = strategy.position_size > 0 ? cb : strategy.position_size < 0 ? cs : na
tp1p = truncate(strategy.position_size > 0 ? tpb1t : strategy.position_size < 0 ?
tps1t : na, dpa)
tp2p = truncate(strategy.position_size > 0 ? tpb2t : strategy.position_size < 0 ?
tps2t : na, dpa)
tp3p = truncate(strategy.position_size > 0 ? tpb3t : strategy.position_size < 0 ?
tps3t : na, dpa)
tp4p = truncate(strategy.position_size > 0 ? tpb4t : strategy.position_size < 0 ?
tps4t : na, dpa)
slp = truncate(strategy.position_size > 0 ? slbt : strategy.position_size < 0 ?
slst : na, dpa)
dashDist = input.int(5, 'Dashboard Distance', group='Dashboard Settings')
dashColor = input.color(color.new(#000000, 0), 'Dashboard Color', inline='Dash
Line', group='Dashboard Settings')
dashTextColor = input.color(color.new(#ffffff, 0), 'Text Color', inline='Dash
Line', group='Dashboard Settings')
//
if buy and backtest and trendType and longside
strategy.entry('Buy', direction=strategy.long, comment='LONG',
alert_message=longbotcommand)
//
besttf = math.max(netcapitalgainA, netcapitalgainB, netcapitalgainC,
netcapitalgainD)
besttft = besttf == netcapitalgainA ? tf1 : besttf == netcapitalgainB ? tf2 :
besttf == netcapitalgainC ? tf3 : besttf == netcapitalgainD ? tf4 : na
accesstf = timeframe.period
wrtp1 = accesstf == str.tostring(3) ? besttf == netcapitalgainA ? wrtp1A : besttf
== netcapitalgainB ? wrtp1B : besttf == netcapitalgainC ? wrtp1C : besttf ==
netcapitalgainD ? wrtp1D : na : na
wrtp2 = accesstf == str.tostring(3) ? besttf == netcapitalgainA ? wrtp2A : besttf
== netcapitalgainB ? wrtp2B : besttf == netcapitalgainC ? wrtp2C : besttf ==
netcapitalgainD ? wrtp2D : na : na
wrtp3 = accesstf == str.tostring(3) ? besttf == netcapitalgainA ? wrtp3A : besttf
== netcapitalgainB ? wrtp3B : besttf == netcapitalgainC ? wrtp3C : besttf ==
netcapitalgainD ? wrtp3D : na : na
wrtp4 = accesstf == str.tostring(3) ? besttf == netcapitalgainA ? wrtp4A : besttf
== netcapitalgainB ? wrtp4B : besttf == netcapitalgainC ? wrtp4C : besttf ==
netcapitalgainD ? wrtp4D : na : na
wrsl = accesstf == str.tostring(3) ? besttf == netcapitalgainA ? wrslA : besttf ==
netcapitalgainB ? wrslB : besttf == netcapitalgainC ? wrslC : besttf ==
netcapitalgainD ? wrslD : na : na
Besttf = accesstf == str.tostring(3) ? besttft : 'NaN'
// + '\n' + tostring(netcapitalgainA)
// + '\n' + tostring(netcapitalgainB)
// + '\n' + tostring(netcapitalgainC)
// + '\n' + tostring(netcapitalgainD)
//if strategy.position_size>0?strategy.position_size>0:strategy.position_size<0
label lemonLabel = label.new(time, close, text=dashboardtext, color=dashColor,
xloc=xloc.bar_time, style=label.style_label_left, textcolor=dashTextColor,
textalign=text.align_center)
label.set_x(lemonLabel, label.get_x(lemonLabel) + math.round(ta.change(time) *
dashDist))
label.delete(lemonLabel[1])
//PLOTTING
bodyMiddle = plot(ST ? (open + close) / 2 : na, display=display.none)
uptrend = plot(ST ? trend < 0 ? na : up : na, 'Up trend',
color=color.new(color.green, 0), style=plot.style_linebr, linewidth=2)
downtrend = plot(ST ? trend < 0 ? dn : na : na, 'Down trend',
color=color.new(color.red, 0), style=plot.style_linebr, linewidth=2)