Zeal Terminal Open Zeal Terminal

Pine Script v4 · Strategy

HAERI 𝐍𝐄𝐓𝐖𝐎𝐑𝐊

A Pine Script v4 strategy built on EMA (src111, 200), Supertrend (factor, atrPeriod) and WMA (src6, len6, floor(sqrt(len6))). It has 4 order rules, 2 entries among them, and trades long and short with the default settings. Exits wait for a signal; there is no stop loss. Each trade commits 15% of equity and pays no commission. 56 settings; defaults include Trend EMA Length 200, Stop Loss Warning (%) -2.5 and Required Strong LONG Score 6.

Generated from the script's code by a template: every clause is a fact read from the source. Not written by a person or a model, and not taken from the author's description.

Does HAERI 𝐍𝐄𝐓𝐖𝐎𝐑𝐊 repaint?
No
No repainting patterns were found in the source.
Can HAERI 𝐍𝐄𝐓𝐖𝐎𝐑𝐊 be converted to Pine Script v5?
Not tested
The steps are shown below, but the original does not run in Zeal Terminal's engine, so they could not be checked.
What alerts does HAERI 𝐍𝐄𝐓𝐖𝐎𝐑𝐊 have?
6
EXIT-SHORT_BYBIT_LINKUSDT_mybybite-bot_10M_403d210eb46a9bd3; ENTER-LONG_BYBIT_LINKUSDT_mybybite-bot_10M_403d210eb46a9bd3; EXIT-LONG_BYBIT_LINKUSDT_mybybite-bot_10M_403d210eb46a9bd3; ENTER-SHORT_BYBIT_LINKUSDT_mybybite-bot_10M_403d210eb46a9bd3; and more.
Does HAERI 𝐍𝐄𝐓𝐖𝐎𝐑𝐊 use a stop loss?
No
Every exit waits for a signal; nothing limits a losing trade before it fires.
Does HAERI 𝐍𝐄𝐓𝐖𝐎𝐑𝐊 run in Zeal Terminal?
No
Not yet: Pine Script v4 Error at @L607:C15: Undeclared identifier 'earnings'.
Does not run in Zeal Terminal yetPine Script v4 Error at @L607:C15: Undeclared identifier 'earnings'. The settings, logic and review below are read from the source, which does not need a run.

Review

What a careful reader of this script would point out, found by checking the source.

  • Likely bug

    ema(rsi11, 40) ignores the settings line 1279

    Line 1279 hard-codes 40 where line 14 uses “Trend EMA Length”. Changing those settings moves one band but not this one.

    ema(rsi11,40)ema(rsi11, len111)
  • Likely bug

    ema(rsi11, 40) ignores the settings line 1291

    Line 1291 hard-codes 40 where line 14 uses “Trend EMA Length”. Changing those settings moves one band but not this one.

    ema(rsi11,40)ema(rsi11, len111)
  • Likely bug

    ema(rsi22, 12) ignores the settings line 1308

    Line 1308 hard-codes 12 where line 14 uses “Trend EMA Length”. Changing those settings moves one band but not this one.

    ema(rsi22,12)ema(rsi22, len111)
  • Likely bug

    ema(rsi22, 12) ignores the settings line 1327

    Line 1327 hard-codes 12 where line 14 uses “Trend EMA Length”. Changing those settings moves one band but not this one.

    ema(rsi22,12)ema(rsi22, len111)
  • Likely bug

    ema(cci4420, 5) ignores the settings line 1351

    Line 1351 hard-codes 5 where line 14 uses “Trend EMA Length”. Changing those settings moves one band but not this one.

    ema(cci4420,5)ema(cci4420, len111)
  • Likely bug

    ema(cci4420, 5) ignores the settings line 1357

    Line 1357 hard-codes 5 where line 14 uses “Trend EMA Length”. Changing those settings moves one band but not this one.

    ema(cci4420,5)ema(cci4420, len111)
  • Likely bug

    ema(cci07, 2) ignores the settings line 1434

    Line 1434 hard-codes 2 where line 14 uses “Trend EMA Length”. Changing those settings moves one band but not this one.

    ema(cci07,2)ema(cci07, len111)
  • Likely bug

    ema(cci07, 2) ignores the settings line 1447

    Line 1447 hard-codes 2 where line 14 uses “Trend EMA Length”. Changing those settings moves one band but not this one.

    ema(cci07,2)ema(cci07, len111)
  • Likely bug

    ema(rsi07, 2) ignores the settings line 1454

    Line 1454 hard-codes 2 where line 14 uses “Trend EMA Length”. Changing those settings moves one band but not this one.

    ema(rsi07,2)ema(rsi07, len111)
  • Likely bug

    ema(rsi07, 2) ignores the settings line 1460

    Line 1460 hard-codes 2 where line 14 uses “Trend EMA Length”. Changing those settings moves one band but not this one.

    ema(rsi07,2)ema(rsi07, len111)
  • Likely bug

    ema(stoch(rsi44, rsi44, rsi44, 21), 3) ignores the settings line 1520

    Line 1520 hard-codes 3 where line 14 uses “Trend EMA Length”. Changing those settings moves one band but not this one.

    ema(stoch(rsi44, rsi44, rsi44, 21), 3)ema(stoch(rsi44, rsi44, rsi44, 21), len111)
  • Likely bug

    ema(k44, 3) ignores the settings line 1521

    Line 1521 hard-codes 3 where line 14 uses “Trend EMA Length”. Changing those settings moves one band but not this one.

    ema(k44, 3)ema(k44, len111)
  • Likely bug

    ema(stoch(rsi44, rsi44, rsi44, 21), 3) ignores the settings line 1528

    Line 1528 hard-codes 3 where line 14 uses “Trend EMA Length”. Changing those settings moves one band but not this one.

    ema(stoch(rsi44, rsi44, rsi44, 21), 3)ema(stoch(rsi44, rsi44, rsi44, 21), len111)
  • Likely bug

    ema(k44, 3) ignores the settings line 1529

    Line 1529 hard-codes 3 where line 14 uses “Trend EMA Length”. Changing those settings moves one band but not this one.

    ema(k44, 3)ema(k44, len111)
  • Likely bug

    sma(wt1, 4) ignores the settings line 235

    Line 235 hard-codes 4 where line 1199 uses “Stoch Smooth K”. Changing those settings moves one band but not this one.

    sma(wt1, 4)sma(wt1, stoch_smooth_k)
  • Likely bug

    sma(close, 50) ignores the settings line 649

    Line 649 hard-codes 50 where line 1199 uses “Stoch Smooth K”. Changing those settings moves one band but not this one.

    sma(close, 50)sma(close, stoch_smooth_k)
  • Likely bug

    sma(close, 200) ignores the settings line 653

    Line 653 hard-codes 200 where line 1199 uses “Stoch Smooth K”. Changing those settings moves one band but not this one.

    sma(close, 200)sma(close, stoch_smooth_k)
  • Likely bug

    sma(close, 50) ignores the settings line 654

    Line 654 hard-codes 50 where line 1199 uses “Stoch Smooth K”. Changing those settings moves one band but not this one.

    sma(close, 50)sma(close, stoch_smooth_k)
  • Likely bug

    sma(stoch(rsi55, rsi55, rsi55, 14), 3) ignores the settings line 1281

    Line 1281 hard-codes 3 where line 1199 uses “Stoch Smooth K”. Changing those settings moves one band but not this one.

    sma(stoch(rsi55, rsi55, rsi55, 14), 3)sma(stoch(rsi55, rsi55, rsi55, 14), stoch_smooth_k)
  • Likely bug

    sma(k55, 3) ignores the settings line 1282

    Line 1282 hard-codes 3 where line 1199 uses “Stoch Smooth K”. Changing those settings moves one band but not this one.

    sma(k55, 3)sma(k55, stoch_smooth_k)
  • Likely bug

    sma(stoch(rsi55, rsi55, rsi55, 14), 3) ignores the settings line 1293

    Line 1293 hard-codes 3 where line 1199 uses “Stoch Smooth K”. Changing those settings moves one band but not this one.

    sma(stoch(rsi55, rsi55, rsi55, 14), 3)sma(stoch(rsi55, rsi55, rsi55, 14), stoch_smooth_k)
  • Likely bug

    sma(k55, 3) ignores the settings line 1294

    Line 1294 hard-codes 3 where line 1199 uses “Stoch Smooth K”. Changing those settings moves one band but not this one.

    sma(k55, 3)sma(k55, stoch_smooth_k)
  • Likely bug

    sma(stoch(rsi33, rsi33, rsi33, 14), 3) ignores the settings line 1310

    Line 1310 hard-codes 3 where line 1199 uses “Stoch Smooth K”. Changing those settings moves one band but not this one.

    sma(stoch(rsi33, rsi33, rsi33, 14), 3)sma(stoch(rsi33, rsi33, rsi33, 14), stoch_smooth_k)
  • Likely bug

    sma(k33, 3) ignores the settings line 1311

    Line 1311 hard-codes 3 where line 1199 uses “Stoch Smooth K”. Changing those settings moves one band but not this one.

    sma(k33, 3)sma(k33, stoch_smooth_k)
  • Likely bug

    sma(stoch(rsi33, rsi33, rsi33, 14), 3) ignores the settings line 1329

    Line 1329 hard-codes 3 where line 1199 uses “Stoch Smooth K”. Changing those settings moves one band but not this one.

    sma(stoch(rsi33, rsi33, rsi33, 14), 3)sma(stoch(rsi33, rsi33, rsi33, 14), stoch_smooth_k)
  • Likely bug

    sma(k33, 3) ignores the settings line 1330

    Line 1330 hard-codes 3 where line 1199 uses “Stoch Smooth K”. Changing those settings moves one band but not this one.

    sma(k33, 3)sma(k33, stoch_smooth_k)
  • Likely bug

    stoch(rsi55, rsi55, rsi55, 14) ignores the settings line 1281

    Line 1281 hard-codes 14 where line 1199 uses “Stoch Period”. Changing those settings moves one band but not this one.

    stoch(rsi55, rsi55, rsi55, 14)stoch(rsi55, rsi55, rsi55, stoch_period)
  • Likely bug

    stoch(rsi55, rsi55, rsi55, 14) ignores the settings line 1293

    Line 1293 hard-codes 14 where line 1199 uses “Stoch Period”. Changing those settings moves one band but not this one.

    stoch(rsi55, rsi55, rsi55, 14)stoch(rsi55, rsi55, rsi55, stoch_period)
  • Likely bug

    stoch(rsi33, rsi33, rsi33, 14) ignores the settings line 1310

    Line 1310 hard-codes 14 where line 1199 uses “Stoch Period”. Changing those settings moves one band but not this one.

    stoch(rsi33, rsi33, rsi33, 14)stoch(rsi33, rsi33, rsi33, stoch_period)
  • Likely bug

    stoch(rsi33, rsi33, rsi33, 14) ignores the settings line 1329

    Line 1329 hard-codes 14 where line 1199 uses “Stoch Period”. Changing those settings moves one band but not this one.

    stoch(rsi33, rsi33, rsi33, 14)stoch(rsi33, rsi33, rsi33, stoch_period)
  • Likely bug

    stoch(rsi44, rsi44, rsi44, 21) ignores the settings line 1520

    Line 1520 hard-codes 21 where line 1199 uses “Stoch Period”. Changing those settings moves one band but not this one.

    stoch(rsi44, rsi44, rsi44, 21)stoch(rsi44, rsi44, rsi44, stoch_period)
  • Likely bug

    stoch(rsi44, rsi44, rsi44, 21) ignores the settings line 1528

    Line 1528 hard-codes 21 where line 1199 uses “Stoch Period”. Changing those settings moves one band but not this one.

    stoch(rsi44, rsi44, rsi44, 21)stoch(rsi44, rsi44, rsi44, stoch_period)
  • Likely bug

    cci(close, 10) ignores the settings line 1349

    Line 1349 hard-codes close where line 1198 uses “Source” and 10 where line 1198 uses “CCI Period”. Changing those settings moves one band but not this one.

    cci(close,10)cci(source, cci_period)
  • Likely bug

    cci(close, 20) ignores the settings line 1350

    Line 1350 hard-codes close where line 1198 uses “Source” and 20 where line 1198 uses “CCI Period”. Changing those settings moves one band but not this one.

    cci(close,20)cci(source, cci_period)
  • Likely bug

    cci(close, 10) ignores the settings line 1355

    Line 1355 hard-codes close where line 1198 uses “Source” and 10 where line 1198 uses “CCI Period”. Changing those settings moves one band but not this one.

    cci(close,10)cci(source, cci_period)
  • Likely bug

    cci(close, 20) ignores the settings line 1356

    Line 1356 hard-codes close where line 1198 uses “Source” and 20 where line 1198 uses “CCI Period”. Changing those settings moves one band but not this one.

    cci(close,20)cci(source, cci_period)
  • Likely bug

    cci(close, 2) ignores the settings line 1427

    Line 1427 hard-codes close where line 1198 uses “Source” and 2 where line 1198 uses “CCI Period”. Changing those settings moves one band but not this one.

    cci(close,2)cci(source, cci_period)
  • Likely bug

    cci(close[0], 2) ignores the settings line 1431

    Line 1431 hard-codes 2 where line 1198 uses “CCI Period”. Changing those settings moves one band but not this one.

    cci(close[0],2)cci(close[0], cci_period)
  • Likely bug

    cci(close[1], 2) ignores the settings line 1432

    Line 1432 hard-codes 2 where line 1198 uses “CCI Period”. Changing those settings moves one band but not this one.

    cci(close[1],2)cci(close[1], cci_period)
  • Likely bug

    cci(close[2], 2) ignores the settings line 1433

    Line 1433 hard-codes 2 where line 1198 uses “CCI Period”. Changing those settings moves one band but not this one.

    cci(close[2],2)cci(close[2], cci_period)
  • Likely bug

    cci(close, 2) ignores the settings line 1440

    Line 1440 hard-codes close where line 1198 uses “Source” and 2 where line 1198 uses “CCI Period”. Changing those settings moves one band but not this one.

    cci(close,2)cci(source, cci_period)
  • Likely bug

    cci(close[0], 2) ignores the settings line 1444

    Line 1444 hard-codes 2 where line 1198 uses “CCI Period”. Changing those settings moves one band but not this one.

    cci(close[0],2)cci(close[0], cci_period)
  • Likely bug

    cci(close[1], 2) ignores the settings line 1445

    Line 1445 hard-codes 2 where line 1198 uses “CCI Period”. Changing those settings moves one band but not this one.

    cci(close[1],2)cci(close[1], cci_period)
  • Likely bug

    cci(close[2], 2) ignores the settings line 1446

    Line 1446 hard-codes 2 where line 1198 uses “CCI Period”. Changing those settings moves one band but not this one.

    cci(close[2],2)cci(close[2], cci_period)
  • Likely bug

    cci(close[0], 2) ignores the settings line 1451

    Line 1451 hard-codes 2 where line 1198 uses “CCI Period”. Changing those settings moves one band but not this one.

    cci(close[0],2)cci(close[0], cci_period)
  • Likely bug

    cci(close[1], 2) ignores the settings line 1452

    Line 1452 hard-codes 2 where line 1198 uses “CCI Period”. Changing those settings moves one band but not this one.

    cci(close[1],2)cci(close[1], cci_period)
  • Likely bug

    cci(close[2], 2) ignores the settings line 1453

    Line 1453 hard-codes 2 where line 1198 uses “CCI Period”. Changing those settings moves one band but not this one.

    cci(close[2],2)cci(close[2], cci_period)
  • Likely bug

    cci(close[0], 2) ignores the settings line 1457

    Line 1457 hard-codes 2 where line 1198 uses “CCI Period”. Changing those settings moves one band but not this one.

    cci(close[0],2)cci(close[0], cci_period)
  • Likely bug

    cci(close[1], 2) ignores the settings line 1458

    Line 1458 hard-codes 2 where line 1198 uses “CCI Period”. Changing those settings moves one band but not this one.

    cci(close[1],2)cci(close[1], cci_period)
  • Likely bug

    cci(close[2], 2) ignores the settings line 1459

    Line 1459 hard-codes 2 where line 1198 uses “CCI Period”. Changing those settings moves one band but not this one.

    cci(close[2],2)cci(close[2], cci_period)
  • Likely bug

    crossunder(ma, 50) ignores the settings line 1217

    Line 1217 hard-codes 50 where line 1203 uses “Oversold”. Changing those settings moves one band but not this one.

    crossunder(ma, 50)crossunder(ma, OS)
  • Likely bug

    crossover(ma, 50) ignores the settings line 1220

    Line 1220 hard-codes 50 where line 1206 uses “Overbought”. Changing those settings moves one band but not this one.

    crossover(ma, 50)crossover(ma, OB)
  • Check

    4 settings do nothing

    “Use STOP Alert”, “Stop Alert Message”, “Mid line”, “Show Arrows” are declared but never read.

  • Check

    No stop loss

    Every exit waits for a signal. Nothing limits a losing trade before the exit condition fires.

  • Check

    No commission

    The backtest assumes free trading. Results on any real exchange will be lower.

  • Note

    2 settings have no label

    In the settings dialog source (line 1185), d_or_k (line 1190) show an empty name. The labels on this page come from the variable names.

  • Note

    No slippage

    Fills are assumed at the exact open price. Add slippage in the properties for a more realistic test.

  • Note

    Uses iff(), which v5 removed line 469

    iff() on line 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480. v5 writes it as the ternary c ? a : b.

Upgrade and export

Written in Pine Script v4. The upgrade to v5 takes 1 step, one per version, each applied to the result of the one before. A last clean-v5 pass then types the settings and moves when = into if blocks, which v6 requires. Every step runs before and after on the same candles in Zeal Terminal's engine; a step whose results differ is shown but not offered as a download. Upgrades preserve behaviour: bugs are fixed in the Review, never silently here.

  • Upgrading to v5 renames ema → ta.ema, supertrend → ta.supertrend, wma → ta.wma, floor → math.floor, sqrt → math.sqrt, sar → ta.sar, rsi → ta.rsi, pivotlow → ta.pivotlow, pivothigh → ta.pivothigh, barssince → ta.barssince, valuewhen → ta.valuewhen, sma → ta.sma, highest → ta.highest, lowest → ta.lowest, abs → math.abs, stoch → ta.stoch, stdev → ta.stdev, atr → ta.atr, max → math.max, min → math.min, change → ta.change, cum → ta.cum, sum → math.sum, pow → math.pow, tostring → str.tostring, cci → ta.cci, crossunder → ta.crossunder, crossover → ta.crossover, rma → ta.rma, highestbars → ta.highestbars, lowestbars → ta.lowestbars.

v4 → v5

Not verified

The v4 script does not run in Zeal Terminal's engine (Pine Script v4 Error at @L607:C15: Undeclared identifier 'earnings'.), so this step could not be checked.

  • Line 3: //@version=4 → //@version=5
  • Line 14: ema → ta.ema
  • Line 21: ema → ta.ema
  • Line 27: ema → ta.ema
  • Line 33: ema → ta.ema
  • Line 39: ema → ta.ema
408 more edits
  • Line 45: ema → ta.ema
  • Line 52: supertrend → ta.supertrend
  • Line 63: wma → ta.wma
  • Line 63: wma → ta.wma
  • Line 63: wma → ta.wma
  • Line 63: floor → math.floor
  • Line 63: sqrt → math.sqrt
  • Line 70: sar → ta.sar
  • Line 92: rsi → ta.rsi
  • Line 98: pivotlow → ta.pivotlow
  • Line 99: pivothigh → ta.pivothigh
  • Line 101: barssince → ta.barssince
  • Line 105: valuewhen → ta.valuewhen
  • Line 107: valuewhen → ta.valuewhen
  • Line 113: valuewhen → ta.valuewhen
  • Line 115: valuewhen → ta.valuewhen
  • Line 122: valuewhen → ta.valuewhen
  • Line 124: valuewhen → ta.valuewhen
  • Line 131: valuewhen → ta.valuewhen
  • Line 133: valuewhen → ta.valuewhen
  • Line 152: sma → ta.sma
  • Line 152: ema → ta.ema
  • Line 153: sma → ta.sma
  • Line 153: ema → ta.ema
  • Line 155: sma → ta.sma
  • Line 155: ema → ta.ema
  • Line 176: pivotlow → ta.pivotlow
  • Line 177: pivothigh → ta.pivothigh
  • Line 179: barssince → ta.barssince
  • Line 184: valuewhen → ta.valuewhen
  • Line 186: valuewhen → ta.valuewhen
  • Line 187: highest → ta.highest
  • Line 196: valuewhen → ta.valuewhen
  • Line 198: valuewhen → ta.valuewhen
  • Line 205: valuewhen → ta.valuewhen
  • Line 206: lowest → ta.lowest
  • Line 210: valuewhen → ta.valuewhen
  • Line 217: valuewhen → ta.valuewhen
  • Line 219: valuewhen → ta.valuewhen
  • Line 229: ema → ta.ema
  • Line 230: ema → ta.ema
  • Line 230: abs → math.abs
  • Line 232: ema → ta.ema
  • Line 235: sma → ta.sma
  • Line 257: pivotlow → ta.pivotlow
  • Line 258: pivothigh → ta.pivothigh
  • Line 260: barssince → ta.barssince
  • Line 264: valuewhen → ta.valuewhen
  • Line 266: valuewhen → ta.valuewhen
  • Line 272: valuewhen → ta.valuewhen
  • Line 274: valuewhen → ta.valuewhen
  • Line 281: valuewhen → ta.valuewhen
  • Line 283: valuewhen → ta.valuewhen
  • Line 289: valuewhen → ta.valuewhen
  • Line 291: valuewhen → ta.valuewhen
  • Line 299: sma → ta.sma
  • Line 299: stoch → ta.stoch
  • Line 300: sma → ta.sma
  • Line 322: pivotlow → ta.pivotlow
  • Line 323: pivothigh → ta.pivothigh
  • Line 325: barssince → ta.barssince
  • Line 329: valuewhen → ta.valuewhen
  • Line 331: valuewhen → ta.valuewhen
  • Line 337: valuewhen → ta.valuewhen
  • Line 339: valuewhen → ta.valuewhen
  • Line 345: valuewhen → ta.valuewhen
  • Line 347: valuewhen → ta.valuewhen
  • Line 354: valuewhen → ta.valuewhen
  • Line 356: valuewhen → ta.valuewhen
  • Line 367: sma → ta.sma
  • Line 368: stdev → ta.stdev
  • Line 382: atr → ta.atr
  • Line 383: highest → ta.highest
  • Line 383: highest → ta.highest
  • Line 385: max → math.max
  • Line 386: lowest → ta.lowest
  • Line 386: lowest → ta.lowest
  • Line 388: min → math.min
  • Line 401: stdev → ta.stdev
  • Line 402: ema → ta.ema
  • Line 402: change → ta.change
  • Line 403: ema → ta.ema
  • Line 403: change → ta.change
  • Line 426: pivotlow → ta.pivotlow
  • Line 427: pivothigh → ta.pivothigh
  • Line 429: barssince → ta.barssince
  • Line 433: valuewhen → ta.valuewhen
  • Line 435: valuewhen → ta.valuewhen
  • Line 441: valuewhen → ta.valuewhen
  • Line 443: valuewhen → ta.valuewhen
  • Line 450: valuewhen → ta.valuewhen
  • Line 452: valuewhen → ta.valuewhen
  • Line 458: valuewhen → ta.valuewhen
  • Line 460: valuewhen → ta.valuewhen
  • Line 469: iff(c, a, b) → (c ? a : b)
  • Line 469: pivothigh → ta.pivothigh
  • Line 469: pivothigh → ta.pivothigh
  • Line 470: iff(c, a, b) → (c ? a : b)
  • Line 470: pivotlow → ta.pivotlow
  • Line 470: pivotlow → ta.pivotlow
  • Line 471: iff(c, a, b) → (c ? a : b)
  • Line 471: pivothigh → ta.pivothigh
  • Line 471: pivothigh → ta.pivothigh
  • Line 472: iff(c, a, b) → (c ? a : b)
  • Line 472: pivotlow → ta.pivotlow
  • Line 472: pivotlow → ta.pivotlow
  • Line 473: iff(c, a, b) → (c ? a : b)
  • Line 473: valuewhen → ta.valuewhen
  • Line 473: valuewhen → ta.valuewhen
  • Line 474: iff(c, a, b) → (c ? a : b)
  • Line 474: valuewhen → ta.valuewhen
  • Line 474: valuewhen → ta.valuewhen
  • Line 475: iff(c, a, b) → (c ? a : b)
  • Line 475: valuewhen → ta.valuewhen
  • Line 475: valuewhen → ta.valuewhen
  • Line 476: iff(c, a, b) → (c ? a : b)
  • Line 476: valuewhen → ta.valuewhen
  • Line 476: valuewhen → ta.valuewhen
  • Line 477: iff(c, a, b) → (c ? a : b)
  • Line 477: valuewhen → ta.valuewhen
  • Line 477: valuewhen → ta.valuewhen
  • Line 478: iff(c, a, b) → (c ? a : b)
  • Line 478: valuewhen → ta.valuewhen
  • Line 478: valuewhen → ta.valuewhen
  • Line 479: iff(c, a, b) → (c ? a : b)
  • Line 479: valuewhen → ta.valuewhen
  • Line 479: valuewhen → ta.valuewhen
  • Line 480: iff(c, a, b) → (c ? a : b)
  • Line 480: valuewhen → ta.valuewhen
  • Line 480: valuewhen → ta.valuewhen
  • Line 491: wma → ta.wma
  • Line 491: wma → ta.wma
  • Line 491: wma → ta.wma
  • Line 491: floor → math.floor
  • Line 491: sqrt → math.sqrt
  • Line 528: change → ta.change
  • Line 529: cum → ta.cum
  • Line 529: change → ta.change
  • Line 531: ema → ta.ema
  • Line 536: pivotlow → ta.pivotlow
  • Line 537: pivothigh → ta.pivothigh
  • Line 539: barssince → ta.barssince
  • Line 543: valuewhen → ta.valuewhen
  • Line 545: valuewhen → ta.valuewhen
  • Line 551: valuewhen → ta.valuewhen
  • Line 553: valuewhen → ta.valuewhen
  • Line 559: valuewhen → ta.valuewhen
  • Line 561: valuewhen → ta.valuewhen
  • Line 567: valuewhen → ta.valuewhen
  • Line 569: valuewhen → ta.valuewhen
  • Line 576: sum → math.sum
  • Line 576: sum → math.sum
  • Line 588: pow → math.pow
  • Line 588: pow → math.pow
  • Line 591: pow → math.pow
  • Line 593: sqrt → math.sqrt
  • Line 606: change → ta.change
  • Line 649: sma → ta.sma
  • Line 653: sma → ta.sma
  • Line 654: sma → ta.sma
  • Line 662: max → math.max
  • Line 663: min → math.min
  • Line 665: ema → ta.ema
  • Line 677: abs → math.abs
  • Line 677: abs → math.abs
  • Line 680: atr → ta.atr
  • Line 681: atr → ta.atr
  • Line 706: input(type = input.float) → input.float()
  • Line 911: tostring → str.tostring
  • Line 913: tostring → str.tostring
  • Line 915: tostring → str.tostring
  • Line 919: tostring → str.tostring
  • Line 924: tostring → str.tostring
  • Line 926: tostring → str.tostring
  • Line 928: tostring → str.tostring
  • Line 932: tostring → str.tostring
  • Line 938: tostring → str.tostring
  • Line 940: tostring → str.tostring
  • Line 942: tostring → str.tostring
  • Line 946: tostring → str.tostring
  • Line 951: tostring → str.tostring
  • Line 953: tostring → str.tostring
  • Line 955: tostring → str.tostring
  • Line 959: tostring → str.tostring
  • Line 968: tostring → str.tostring
  • Line 972: tostring → str.tostring
  • Line 976: tostring → str.tostring
  • Line 980: tostring → str.tostring
  • Line 984: tostring → str.tostring
  • Line 988: tostring → str.tostring
  • Line 993: tostring → str.tostring
  • Line 997: tostring → str.tostring
  • Line 1001: tostring → str.tostring
  • Line 1005: tostring → str.tostring
  • Line 1009: tostring → str.tostring
  • Line 1013: tostring → str.tostring
  • Line 1018: tostring → str.tostring
  • Line 1022: tostring → str.tostring
  • Line 1026: tostring → str.tostring
  • Line 1030: tostring → str.tostring
  • Line 1036: tostring → str.tostring
  • Line 1040: tostring → str.tostring
  • Line 1044: tostring → str.tostring
  • Line 1048: tostring → str.tostring
  • Line 1057: tostring → str.tostring
  • Line 1061: tostring → str.tostring
  • Line 1067: tostring → str.tostring
  • Line 1071: tostring → str.tostring
  • Line 1077: tostring → str.tostring
  • Line 1081: tostring → str.tostring
  • Line 1085: tostring → str.tostring
  • Line 1089: tostring → str.tostring
  • Line 1094: tostring → str.tostring
  • Line 1098: tostring → str.tostring
  • Line 1108: tostring → str.tostring
  • Line 1112: tostring → str.tostring
  • Line 1118: tostring → str.tostring
  • Line 1122: tostring → str.tostring
  • Line 1126: tostring → str.tostring
  • Line 1128: tostring → str.tostring
  • Line 1132: tostring → str.tostring
  • Line 1136: tostring → str.tostring
  • Line 1140: tostring → str.tostring
  • Line 1142: tostring → str.tostring
  • Line 1146: tostring → str.tostring
  • Line 1150: tostring → str.tostring
  • Line 1178: input(type = input.string) → input.string()
  • Line 1191: input(type = input.integer) → input.int()
  • Line 1192: input(type = input.integer) → input.int()
  • Line 1193: input(type = input.integer) → input.int()
  • Line 1198: cci → ta.cci
  • Line 1199: sma → ta.sma
  • Line 1199: stoch → ta.stoch
  • Line 1200: sma → ta.sma
  • Line 1203: crossunder → ta.crossunder
  • Line 1206: crossover → ta.crossover
  • Line 1211: crossunder → ta.crossunder
  • Line 1214: crossover → ta.crossover
  • Line 1217: crossunder → ta.crossunder
  • Line 1220: crossover → ta.crossover
  • Line 1276: rma → ta.rma
  • Line 1276: max → math.max
  • Line 1276: change → ta.change
  • Line 1277: rma → ta.rma
  • Line 1277: min → math.min
  • Line 1277: change → ta.change
  • Line 1279: ema → ta.ema
  • Line 1280: rsi → ta.rsi
  • Line 1281: sma → ta.sma
  • Line 1281: stoch → ta.stoch
  • Line 1282: sma → ta.sma
  • Line 1288: rma → ta.rma
  • Line 1288: max → math.max
  • Line 1288: change → ta.change
  • Line 1289: rma → ta.rma
  • Line 1289: min → math.min
  • Line 1289: change → ta.change
  • Line 1291: ema → ta.ema
  • Line 1292: rsi → ta.rsi
  • Line 1293: sma → ta.sma
  • Line 1293: stoch → ta.stoch
  • Line 1294: sma → ta.sma
  • Line 1305: rma → ta.rma
  • Line 1305: max → math.max
  • Line 1305: change → ta.change
  • Line 1306: rma → ta.rma
  • Line 1306: min → math.min
  • Line 1306: change → ta.change
  • Line 1308: ema → ta.ema
  • Line 1309: rsi → ta.rsi
  • Line 1310: sma → ta.sma
  • Line 1310: stoch → ta.stoch
  • Line 1311: sma → ta.sma
  • Line 1314: barssince → ta.barssince
  • Line 1314: crossover → ta.crossover
  • Line 1314: barssince → ta.barssince
  • Line 1314: crossunder → ta.crossunder
  • Line 1314: barssince → ta.barssince
  • Line 1314: crossover → ta.crossover
  • Line 1315: barssince → ta.barssince
  • Line 1315: crossunder → ta.crossunder
  • Line 1315: barssince → ta.barssince
  • Line 1315: crossover → ta.crossover
  • Line 1315: barssince → ta.barssince
  • Line 1315: crossunder → ta.crossunder
  • Line 1318: barssince → ta.barssince
  • Line 1318: crossover → ta.crossover
  • Line 1318: barssince → ta.barssince
  • Line 1318: crossunder → ta.crossunder
  • Line 1318: barssince → ta.barssince
  • Line 1318: crossover → ta.crossover
  • Line 1319: barssince → ta.barssince
  • Line 1319: crossunder → ta.crossunder
  • Line 1319: barssince → ta.barssince
  • Line 1319: crossover → ta.crossover
  • Line 1319: barssince → ta.barssince
  • Line 1319: crossunder → ta.crossunder
  • Line 1324: rma → ta.rma
  • Line 1324: max → math.max
  • Line 1324: change → ta.change
  • Line 1325: rma → ta.rma
  • Line 1325: min → math.min
  • Line 1325: change → ta.change
  • Line 1327: ema → ta.ema
  • Line 1328: rsi → ta.rsi
  • Line 1329: sma → ta.sma
  • Line 1329: stoch → ta.stoch
  • Line 1330: sma → ta.sma
  • Line 1333: barssince → ta.barssince
  • Line 1333: crossover → ta.crossover
  • Line 1333: barssince → ta.barssince
  • Line 1333: crossunder → ta.crossunder
  • Line 1333: barssince → ta.barssince
  • Line 1333: crossover → ta.crossover
  • Line 1334: barssince → ta.barssince
  • Line 1334: crossunder → ta.crossunder
  • Line 1334: barssince → ta.barssince
  • Line 1334: crossover → ta.crossover
  • Line 1334: barssince → ta.barssince
  • Line 1334: crossunder → ta.crossunder
  • Line 1337: barssince → ta.barssince
  • Line 1337: crossover → ta.crossover
  • Line 1337: barssince → ta.barssince
  • Line 1337: crossunder → ta.crossunder
  • Line 1337: barssince → ta.barssince
  • Line 1337: crossover → ta.crossover
  • Line 1338: barssince → ta.barssince
  • Line 1338: crossunder → ta.crossunder
  • Line 1338: barssince → ta.barssince
  • Line 1338: crossover → ta.crossover
  • Line 1338: barssince → ta.barssince
  • Line 1338: crossunder → ta.crossunder
  • Line 1349: cci → ta.cci
  • Line 1350: cci → ta.cci
  • Line 1351: ema → ta.ema
  • Line 1353: barssince → ta.barssince
  • Line 1353: crossover → ta.crossover
  • Line 1353: barssince → ta.barssince
  • Line 1353: crossunder → ta.crossunder
  • Line 1353: barssince → ta.barssince
  • Line 1353: crossover → ta.crossover
  • Line 1355: cci → ta.cci
  • Line 1356: cci → ta.cci
  • Line 1357: ema → ta.ema
  • Line 1359: barssince → ta.barssince
  • Line 1359: crossunder → ta.crossunder
  • Line 1359: barssince → ta.barssince
  • Line 1359: crossover → ta.crossover
  • Line 1359: barssince → ta.barssince
  • Line 1359: crossunder → ta.crossunder
  • Line 1376: atr → ta.atr
  • Line 1378: abs → math.abs
  • Line 1378: highestbars → ta.highestbars
  • Line 1379: abs → math.abs
  • Line 1379: lowestbars → ta.lowestbars
  • Line 1380: sma → ta.sma
  • Line 1381: sma → ta.sma
  • Line 1383: max → math.max
  • Line 1389: min → math.min
  • Line 1399: max → math.max
  • Line 1407: min → math.min
  • Line 1417: barssince → ta.barssince
  • Line 1417: barssince → ta.barssince
  • Line 1417: barssince → ta.barssince
  • Line 1425: rsi → ta.rsi
  • Line 1426: rsi → ta.rsi
  • Line 1427: cci → ta.cci
  • Line 1431: cci → ta.cci
  • Line 1432: cci → ta.cci
  • Line 1433: cci → ta.cci
  • Line 1434: ema → ta.ema
  • Line 1436: crossunder → ta.crossunder
  • Line 1438: rsi → ta.rsi
  • Line 1439: rsi → ta.rsi
  • Line 1440: cci → ta.cci
  • Line 1444: cci → ta.cci
  • Line 1445: cci → ta.cci
  • Line 1446: cci → ta.cci
  • Line 1447: ema → ta.ema
  • Line 1449: crossover → ta.crossover
  • Line 1451: cci → ta.cci
  • Line 1452: cci → ta.cci
  • Line 1453: cci → ta.cci
  • Line 1454: ema → ta.ema
  • Line 1455: crossunder → ta.crossunder
  • Line 1457: cci → ta.cci
  • Line 1458: cci → ta.cci
  • Line 1459: cci → ta.cci
  • Line 1460: ema → ta.ema
  • Line 1461: crossover → ta.crossover
  • Line 1463: barssince → ta.barssince
  • Line 1463: barssince → ta.barssince
  • Line 1463: barssince → ta.barssince
  • Line 1465: barssince → ta.barssince
  • Line 1465: barssince → ta.barssince
  • Line 1465: barssince → ta.barssince
  • Line 1469: rsi → ta.rsi
  • Line 1473: rsi → ta.rsi
  • Line 1519: rsi → ta.rsi
  • Line 1520: ema → ta.ema
  • Line 1520: stoch → ta.stoch
  • Line 1521: ema → ta.ema
  • Line 1527: rsi → ta.rsi
  • Line 1528: ema → ta.ema
  • Line 1528: stoch → ta.stoch
  • Line 1529: ema → ta.ema
  • Line 1539: strategy.entry(…, 1) → strategy.entry(…, strategy.long)
  • Line 1545: strategy.entry(…, 0) → strategy.entry(…, strategy.short)
⋯// © ahhanegin-//@version=4+//@version=5//study("Haeri")⋯src111 = close-out111 = ema(src111, len111)+out111 = ta.ema(src111, len111)ma111  = plot(out111, title="EMA 200", linewidth=2, color=color.blue, offset=0)⋯src1 = close-out1 = ema(src1, len1)+out1 = ta.ema(src1, len1)ema1color = (out1 > out1[1] ? #00bcd4 : #e91e63)⋯src2 = close-out2 = ema(src2, len2)+out2 = ta.ema(src2, len2)ema2color = (out2 > out2[1] ? #00bcd4 : #e91e63)⋯src3 = close-out3 = ema(src3, len3)+out3 = ta.ema(src3, len3)ema3color = (out3 > out3[1] ? #00bcd4 : #e91e63)⋯src4 = close-out4 = ema(src4, len4)+out4 = ta.ema(src4, len4)ema4color = (out4 > out4[1] ? #00bcd4 : #e91e63)⋯src5 = close-out5 = ema(src5, len5)+out5 = ta.ema(src5, len5)ema5color = (out5 > out5[1] ? #00bcd4 : #e91e63)⋯factor = 3-[supertrend, direction] = supertrend(factor, atrPeriod)+[supertrend, direction] = ta.supertrend(factor, atrPeriod)bodyMiddle = plot((open + close) / 2, display=display.none, title="Body Middle Line")⋯src6 = close-hma = wma(2*wma(src6, len6/2)-wma(src6, len6), floor(sqrt(len6)))+hma = ta.wma(2*ta.wma(src6, len6/2)-ta.wma(src6, len6), math.floor(math.sqrt(len6)))hmacolor = close > hma ? #00bcd4 : #e91e63⋯maximum = 0.2-psar = sar(start, increment, maximum)+psar = ta.sar(start, increment, maximum)//plot(psar, "ParabolicSAR", style=plot.style_circles, color=#ffffff)⋯noneColor11 = color.new(color.white, 100)-osc11 = rsi(src11, len11)+osc11 = ta.rsi(src11, len11)//plot(osc11, title="RSI", linewidth=2, color=#2962FF)⋯//fill(obLevel11, osLevel11, title="Background", color=color.rgb(33, 150, 243, 90))-plFound11 = na(pivotlow(osc11, lbL11, lbR11)) ? false : true+plFound11 = na(ta.pivotlow(osc11, lbL11, lbR11)) ? false : true-phFound11 = na(pivothigh(osc11, lbL11, lbR11)) ? false : true+phFound11 = na(ta.pivothigh(osc11, lbL11, lbR11)) ? false : true_inRange11(cond) =>-    bars11 = barssince(cond == true)+    bars11 = ta.barssince(cond == true)    rangeLower11 <= bars11 and bars11 <= rangeUpper11⋯//Osc: Higher Low-oscHL11 = osc11[lbR11] > valuewhen(plFound11, osc11[lbR11], 1) and _inRange11(plFound11[1])+oscHL11 = osc11[lbR11] > ta.valuewhen(plFound11, osc11[lbR11], 1) and _inRange11(plFound11[1])//Price: Lower Low-priceLL11 = low[lbR11] < valuewhen(plFound11, low[lbR11], 1)+priceLL11 = low[lbR11] < ta.valuewhen(plFound11, low[lbR11], 1)bullCond11 = plotBull11 and priceLL11 and oscHL11 and plFound11⋯//Osc: Lower Low-oscLL11 = osc11[lbR11] < valuewhen(plFound11, osc11[lbR11], 1) and _inRange11(plFound11[1])+oscLL11 = osc11[lbR11] < ta.valuewhen(plFound11, osc11[lbR11], 1) and _inRange11(plFound11[1])//Price: Higher Low-priceHL11 = low[lbR11] > valuewhen(plFound11, low[lbR11], 1)+priceHL11 = low[lbR11] > ta.valuewhen(plFound11, low[lbR11], 1)hiddenBullCond11 = plotHiddenBull11 and priceHL11 and oscLL11 and plFound11⋯//Osc: Lower High-oscLH11 = osc11[lbR11] < valuewhen(phFound11, osc11[lbR11], 1) and _inRange11(phFound11[1])+oscLH11 = osc11[lbR11] < ta.valuewhen(phFound11, osc11[lbR11], 1) and _inRange11(phFound11[1])//Price: Higher High-priceHH11 = high[lbR11] > valuewhen(phFound11, high[lbR11], 1)+priceHH11 = high[lbR11] > ta.valuewhen(phFound11, high[lbR11], 1)bearCond11 = plotBear11 and priceHH11 and oscLH11 and phFound11⋯//Osc: Higher High-oscHH11 = osc11[lbR11] > valuewhen(phFound11, osc11[lbR11], 1) and _inRange11(phFound11[1])+oscHH11 = osc11[lbR11] > ta.valuewhen(phFound11, osc11[lbR11], 1) and _inRange11(phFound11[1])// Price: Lower High-priceLH11 = high[lbR11] < valuewhen(phFound11, high[lbR11], 1)+priceLH11 = high[lbR11] < ta.valuewhen(phFound11, high[lbR11], 1)hiddenBearCond11 = plotHiddenBear11 and priceLH11 and oscHH11 and phFound11⋯//Calculating-fast_ma12 = sma_source12 == "SMA" ? sma(src12, fast_length12) : ema(src12, fast_length12)+fast_ma12 = sma_source12 == "SMA" ? ta.sma(src12, fast_length12) : ta.ema(src12, fast_length12)-slow_ma12 = sma_source12 == "SMA" ? sma(src12, slow_length12) : ema(src12, slow_length12)+slow_ma12 = sma_source12 == "SMA" ? ta.sma(src12, slow_length12) : ta.ema(src12, slow_length12)macd = fast_ma12 - slow_ma12-signal = sma_signal12 == "SMA" ? sma(macd, signal_length12) : ema(macd, signal_length12)+signal = sma_signal12 == "SMA" ? ta.sma(macd, signal_length12) : ta.ema(macd, signal_length12)hist = macd - signal⋯osc12 = macd-plFound12 = na(pivotlow(osc12, lbL12, lbR12)) ? false : true+plFound12 = na(ta.pivotlow(osc12, lbL12, lbR12)) ? false : true-phFound12 = na(pivothigh(osc12, lbL12, lbR12)) ? false : true+phFound12 = na(ta.pivothigh(osc12, lbL12, lbR12)) ? false : true_inRange12(cond) =>-    bars12 = barssince(cond == true)+    bars12 = ta.barssince(cond == true)    rangeLower12 <= bars12 and bars12 <= rangeUpper12⋯//Osc: Higher Low-oscHL12 = osc12[lbR12] > valuewhen(plFound12, osc12[lbR12], 1) and _inRange12(plFound12[1]) and  osc12[lbR12] < 0+oscHL12 = osc12[lbR12] > ta.valuewhen(plFound12, osc12[lbR12], 1) and _inRange12(plFound12[1]) and  osc12[lbR12] < 0// Price: Lower Low-priceLL12 = low[lbR12] < valuewhen(plFound12, low[lbR12], 1)+priceLL12 = low[lbR12] < ta.valuewhen(plFound12, low[lbR12], 1)-priceHHZero12 =  highest(osc12, lbL12+lbR12+5) +priceHHZero12 =  ta.highest(osc12, lbL12+lbR12+5) //plot(priceHHZero,title="priceHHZero",color=color.green)⋯//Osc: Lower Low-oscLL12 = osc12[lbR12] < valuewhen(plFound12, osc12[lbR12], 1) and _inRange12(plFound12[1])+oscLL12 = osc12[lbR12] < ta.valuewhen(plFound12, osc12[lbR12], 1) and _inRange12(plFound12[1])//Price: Higher Low-priceHL12 = low[lbR12] > valuewhen(plFound12, low[lbR12], 1)+priceHL12 = low[lbR12] > ta.valuewhen(plFound12, low[lbR12], 1)hiddenBullCond12 = plotHiddenBull12 and priceHL12 and oscLL12 and plFound12⋯//Osc: Lower High-oscLH12 = osc12[lbR12] < valuewhen(phFound12, osc12[lbR12], 1) and _inRange12(phFound12[1])  and osc12[lbR12] > 0+oscLH12 = osc12[lbR12] < ta.valuewhen(phFound12, osc12[lbR12], 1) and _inRange12(phFound12[1])  and osc12[lbR12] > 0-priceLLZero12 =  lowest(osc12, lbL12+lbR12+5) +priceLLZero12 =  ta.lowest(osc12, lbL12+lbR12+5) //plot(priceLLZero,title="priceLLZero", color=color.red)⋯//Price: Higher High-priceHH12 = high[lbR12] > valuewhen(phFound12, high[lbR12], 1)+priceHH12 = high[lbR12] > ta.valuewhen(phFound12, high[lbR12], 1)bearCond12 = plotBear12 and priceHH12 and oscLH12 and phFound12 and bearzero12⋯//Osc: Higher High-oscHH12 = osc12[lbR12] > valuewhen(phFound12, osc12[lbR12], 1) and _inRange12(phFound12[1])+oscHH12 = osc12[lbR12] > ta.valuewhen(phFound12, osc12[lbR12], 1) and _inRange12(phFound12[1])//Price: Lower High-priceLH12 = high[lbR12] < valuewhen(phFound12, high[lbR12], 1)+priceLH12 = high[lbR12] < ta.valuewhen(phFound12, high[lbR12], 1)hiddenBearCond12 = plotHiddenBear12 and priceLH12 and oscHH12 and phFound12⋯ap = hlc3 -esa = ema(ap, n1)+esa = ta.ema(ap, n1)-d1 = ema(abs(ap - esa), n1)+d1 = ta.ema(math.abs(ap - esa), n1)ci = (ap - esa) / (0.015 * d1)-tci = ema(ci, n2)+tci = ta.ema(ci, n2)hline = 0wt1 = tci-wt2 = sma(wt1, 4)+wt2 = ta.sma(wt1, 4)//plot(hline, color=color.gray)⋯osc13 = k13-plFound13 = na(pivotlow(osc13, lbL13, lbR13)) ? false : true+plFound13 = na(ta.pivotlow(osc13, lbL13, lbR13)) ? false : true-phFound13 = na(pivothigh(osc13, lbL13, lbR13)) ? false : true+phFound13 = na(ta.pivothigh(osc13, lbL13, lbR13)) ? false : true_inRange13(cond) =>-    bars13 = barssince(cond == true)+    bars13 = ta.barssince(cond == true)    rangeLower13 <= bars13 and bars13 <= rangeUpper13⋯//Osc: Higher Low-oscHL13 = osc13[lbR13] > valuewhen(plFound13, osc13[lbR13], 1) and _inRange13(plFound13[1])+oscHL13 = osc13[lbR13] > ta.valuewhen(plFound13, osc13[lbR13], 1) and _inRange13(plFound13[1])//Price: Lower Low-priceLL13 = low[lbR13] < valuewhen(plFound13, low[lbR13], 1)+priceLL13 = low[lbR13] < ta.valuewhen(plFound13, low[lbR13], 1)bullCond13 = plotBull13 and priceLL13 and oscHL13 and plFound13⋯//Osc: Lower Low-oscLL13 = osc13[lbR13] < valuewhen(plFound13, osc13[lbR13], 1) and _inRange13(plFound13[1])+oscLL13 = osc13[lbR13] < ta.valuewhen(plFound13, osc13[lbR13], 1) and _inRange13(plFound13[1])//Price: Higher Low-priceHL13 = low[lbR13] > valuewhen(plFound13, low[lbR13], 1)+priceHL13 = low[lbR13] > ta.valuewhen(plFound13, low[lbR13], 1)hiddenBullCond13 = plotHiddenBull13 and priceHL13 and oscLL13 and plFound13⋯//Osc: Lower High-oscLH13 = osc13[lbR13] < valuewhen(phFound13, osc13[lbR13], 1) and _inRange13(phFound13[1])+oscLH13 = osc13[lbR13] < ta.valuewhen(phFound13, osc13[lbR13], 1) and _inRange13(phFound13[1])//Price: Higher High-priceHH13 = high[lbR13] > valuewhen(phFound13, high[lbR13], 1)+priceHH13 = high[lbR13] > ta.valuewhen(phFound13, high[lbR13], 1)bearCond13 = plotBear13 and priceHH13 and oscLH13 and phFound13⋯//Osc: Higher High-oscHH13 = osc13[lbR13] > valuewhen(phFound13, osc13[lbR13], 1) and _inRange13(phFound13[1])+oscHH13 = osc13[lbR13] > ta.valuewhen(phFound13, osc13[lbR13], 1) and _inRange13(phFound13[1])//Price: Lower High-priceLH13 = high[lbR13] < valuewhen(phFound13, high[lbR13], 1)+priceLH13 = high[lbR13] < ta.valuewhen(phFound13, high[lbR13], 1)hiddenBearCond13 = plotHiddenBear13 and priceLH13 and oscHH13 and phFound13⋯periodD14 = 3-k14 = sma(stoch(close, high, low, periodK14), smoothK14)+k14 = ta.sma(ta.stoch(close, high, low, periodK14), smoothK14)-d14 = sma(k14, periodD14)+d14 = ta.sma(k14, periodD14)//plot(k14, title="%K", color=#2962FF)⋯osc14 = k14-plFound14 = na(pivotlow(osc14, lbL14, lbR14)) ? false : true+plFound14 = na(ta.pivotlow(osc14, lbL14, lbR14)) ? false : true-phFound14 = na(pivothigh(osc14, lbL14, lbR14)) ? false : true+phFound14 = na(ta.pivothigh(osc14, lbL14, lbR14)) ? false : true_inRange14(cond) =>-    bars14 = barssince(cond == true)+    bars14 = ta.barssince(cond == true)    rangeLower14 <= bars14 and bars14 <= rangeUpper14⋯//Osc: Higher Low-oscHL14 = osc14[lbR14] > valuewhen(plFound14, osc14[lbR14], 1) and _inRange14(plFound14[1])+oscHL14 = osc14[lbR14] > ta.valuewhen(plFound14, osc14[lbR14], 1) and _inRange14(plFound14[1])//Price: Lower Low-priceLL14 = low[lbR14] < valuewhen(plFound14, low[lbR14], 1)+priceLL14 = low[lbR14] < ta.valuewhen(plFound14, low[lbR14], 1)bullCond14 = plotBull14 and priceLL14 and oscHL14 and plFound14⋯//Osc: Lower Low-oscLL14 = osc14[lbR14] < valuewhen(plFound14, osc14[lbR14], 1) and _inRange14(plFound14[1])+oscLL14 = osc14[lbR14] < ta.valuewhen(plFound14, osc14[lbR14], 1) and _inRange14(plFound14[1])//Price: Higher Low-priceHL14 = low[lbR14] > valuewhen(plFound14, low[lbR14], 1)+priceHL14 = low[lbR14] > ta.valuewhen(plFound14, low[lbR14], 1)hiddenBullCond14 = plotHiddenBull14 and priceHL14 and oscLL14 and plFound14⋯//Osc: Lower High-oscLH14 = osc14[lbR14] < valuewhen(phFound14, osc14[lbR14], 1) and _inRange14(phFound14[1])+oscLH14 = osc14[lbR14] < ta.valuewhen(phFound14, osc14[lbR14], 1) and _inRange14(phFound14[1])//Price: Higher High-priceHH14 = high[lbR14] > valuewhen(phFound14, high[lbR14], 1)+priceHH14 = high[lbR14] > ta.valuewhen(phFound14, high[lbR14], 1)bearCond14 = plotBear14 and priceHH14 and oscLH14 and phFound14⋯//Osc: Higher High-oscHH14 = osc14[lbR14] > valuewhen(phFound14, osc14[lbR14], 1) and _inRange14(phFound14[1])+oscHH14 = osc14[lbR14] > ta.valuewhen(phFound14, osc14[lbR14], 1) and _inRange14(phFound14[1])//Price: Lower High-priceLH14 = high[lbR14] < valuewhen(phFound14, high[lbR14], 1)+priceLH14 = high[lbR14] < ta.valuewhen(phFound14, high[lbR14], 1)hiddenBearCond14 = plotHiddenBear14 and priceLH14 and oscHH14 and phFound14⋯mult1 = 2.0-basis = sma(src7, length1)+basis = ta.sma(src7, length1)-dev = mult1 * stdev(src7, length1)+dev = mult1 * ta.stdev(src7, length1)upper = basis + dev⋯highlightState = false-atr = mult2 * atr(length2)+atr = mult2 * ta.atr(length2)-longStop = (useClose ? highest(close, length2) : highest(length2)) - atr+longStop = (useClose ? ta.highest(close, length2) : ta.highest(length2)) - atrlongStopPrev = nz(longStop[1], longStop) -longStop := close[1] > longStopPrev ? max(longStop, longStopPrev) : longStop+longStop := close[1] > longStopPrev ? math.max(longStop, longStopPrev) : longStop-shortStop = (useClose ? lowest(close, length2) : lowest(length2)) + atr+shortStop = (useClose ? ta.lowest(close, length2) : ta.lowest(length2)) + atrshortStopPrev = nz(shortStop[1], shortStop)-shortStop := close[1] < shortStopPrev ? min(shortStop, shortStopPrev) : shortStop+shortStop := close[1] < shortStopPrev ? math.min(shortStop, shortStopPrev) : shortStopvar int dir = 1⋯len15 = 14-stddev15 = stdev(src15, length15)+stddev15 = ta.stdev(src15, length15)-upper15 = ema(change(src15) <= 0 ? 0 : stddev15, len15)+upper15 = ta.ema(ta.change(src15) <= 0 ? 0 : stddev15, len15)-lower15 = ema(change(src15) > 0 ? 0 : stddev15, len15)+lower15 = ta.ema(ta.change(src15) > 0 ? 0 : stddev15, len15)rvi = upper15 / (upper15 + lower15) * 100⋯osc15 = d15-plFound15 = na(pivotlow(osc15, lbL15, lbR15)) ? false : true+plFound15 = na(ta.pivotlow(osc15, lbL15, lbR15)) ? false : true-phFound15 = na(pivothigh(osc15, lbL15, lbR15)) ? false : true+phFound15 = na(ta.pivothigh(osc15, lbL15, lbR15)) ? false : true_inRange15(cond) =>-    bars15 = barssince(cond == true)+    bars15 = ta.barssince(cond == true)    rangeLower15 <= bars15 and bars15 <= rangeUpper15⋯//Osc: Higher Low-oscHL15 = osc15[lbR15] > valuewhen(plFound15, osc15[lbR15], 1) and _inRange15(plFound15[1])+oscHL15 = osc15[lbR15] > ta.valuewhen(plFound15, osc15[lbR15], 1) and _inRange15(plFound15[1])//Price: Lower Low-priceLL15 = low[lbR15] < valuewhen(plFound15, low[lbR15], 1)+priceLL15 = low[lbR15] < ta.valuewhen(plFound15, low[lbR15], 1)bullCond15 = plotBull15 and priceLL15 and oscHL15 and plFound15⋯//Osc: Lower Low-oscLL15 = osc15[lbR15] < valuewhen(plFound15, osc15[lbR15], 1) and _inRange15(plFound15[1])+oscLL15 = osc15[lbR15] < ta.valuewhen(plFound15, osc15[lbR15], 1) and _inRange15(plFound15[1])//Price: Higher Low-priceHL15 = low[lbR15] > valuewhen(plFound15, low[lbR15], 1)+priceHL15 = low[lbR15] > ta.valuewhen(plFound15, low[lbR15], 1)hiddenBullCond15 = plotHiddenBull15 and priceHL15 and oscLL15 and plFound15⋯//Osc: Lower High-oscLH15 = osc15[lbR15] < valuewhen(phFound15, osc15[lbR15], 1) and _inRange15(phFound15[1])+oscLH15 = osc15[lbR15] < ta.valuewhen(phFound15, osc15[lbR15], 1) and _inRange15(phFound15[1])//Price: Higher High-priceHH15 = high[lbR15] > valuewhen(phFound15, high[lbR15], 1)+priceHH15 = high[lbR15] > ta.valuewhen(phFound15, high[lbR15], 1)bearCond15 = plotBear15 and priceHH15 and oscLH15 and phFound15⋯//Osc: Higher High-oscHH15 = osc15[lbR15] > valuewhen(phFound15, osc15[lbR15], 1) and _inRange15(phFound15[1])+oscHH15 = osc15[lbR15] > ta.valuewhen(phFound15, osc15[lbR15], 1) and _inRange15(phFound15[1])//Price: Lower High-priceLH15 = high[lbR15] < valuewhen(phFound15, high[lbR15], 1)+priceLH15 = high[lbR15] < ta.valuewhen(phFound15, high[lbR15], 1)hiddenBearCond15 = plotHiddenBear15 and priceLH15 and oscHH15 and phFound15⋯src16 = "Close"-pivot_high16 = iff(src16=="Close",pivothigh(close,left16,right16),pivothigh(high,left16,right16))+pivot_high16 = (src16=="Close" ? ta.pivothigh(close,left16,right16) : ta.pivothigh(high,left16,right16))-pivot_lows16 = iff(src16=="Close",pivotlow(close, left16,right16),pivotlow(low,left16,right16))+pivot_lows16 = (src16=="Close" ? ta.pivotlow(close, left16,right16) : ta.pivotlow(low,left16,right16))-quick_pivot_high16 = iff(src16=="Close",pivothigh(close,left16,quick_right16),pivothigh(high,left16,quick_right16))+quick_pivot_high16 = (src16=="Close" ? ta.pivothigh(close,left16,quick_right16) : ta.pivothigh(high,left16,quick_right16))-quick_pivot_lows16 = iff(src16=="Close",pivotlow(close, left16,quick_right16),pivotlow(low, left16,quick_right16))+quick_pivot_lows16 = (src16=="Close" ? ta.pivotlow(close, left16,quick_right16) : ta.pivotlow(low, left16,quick_right16))-level1 = iff(src16=="Close",valuewhen(quick_pivot_high16, close[quick_right16], 0),valuewhen(quick_pivot_high16, high[quick_right16], 0))+level1 = (src16=="Close" ? ta.valuewhen(quick_pivot_high16, close[quick_right16], 0) : ta.valuewhen(quick_pivot_high16, high[quick_right16], 0))-level2 = iff(src16=="Close",valuewhen(quick_pivot_lows16, close[quick_right16], 0),valuewhen(quick_pivot_lows16, low[quick_right16], 0))+level2 = (src16=="Close" ? ta.valuewhen(quick_pivot_lows16, close[quick_right16], 0) : ta.valuewhen(quick_pivot_lows16, low[quick_right16], 0))-level3 = iff(src16=="Close",valuewhen(pivot_high16, close[right16], 0),valuewhen(pivot_high16, high[right16], 0))+level3 = (src16=="Close" ? ta.valuewhen(pivot_high16, close[right16], 0) : ta.valuewhen(pivot_high16, high[right16], 0))-level4 = iff(src16=="Close",valuewhen(pivot_lows16, close[right16], 0),valuewhen(pivot_lows16, low[right16], 0))+level4 = (src16=="Close" ? ta.valuewhen(pivot_lows16, close[right16], 0) : ta.valuewhen(pivot_lows16, low[right16], 0))-level5 = iff(src16=="Close",valuewhen(pivot_high16, close[right16], 1),valuewhen(pivot_high16, high[right16], 1))+level5 = (src16=="Close" ? ta.valuewhen(pivot_high16, close[right16], 1) : ta.valuewhen(pivot_high16, high[right16], 1))-level6 = iff(src16=="Close",valuewhen(pivot_lows16, close[right16], 1),valuewhen(pivot_lows16, low[right16], 1))+level6 = (src16=="Close" ? ta.valuewhen(pivot_lows16, close[right16], 1) : ta.valuewhen(pivot_lows16, low[right16], 1))-level7 = iff(src16=="Close",valuewhen(pivot_high16, close[right16], 2),valuewhen(pivot_high16, high[right16], 2))+level7 = (src16=="Close" ? ta.valuewhen(pivot_high16, close[right16], 2) : ta.valuewhen(pivot_high16, high[right16], 2))-level8 = iff(src16=="Close",valuewhen(pivot_lows16, close[right16], 2),valuewhen(pivot_lows16, low[right16], 2))+level8 = (src16=="Close" ? ta.valuewhen(pivot_lows16, close[right16], 2) : ta.valuewhen(pivot_lows16, low[right16], 2))level1_col = close >= level1 ? color.green : color.red⋯src17 = close-hma17 = wma(2*wma(src17, length17/2)-wma(src17, length17), floor(sqrt(length17)))+hma17 = ta.wma(2*ta.wma(src17, length17/2)-ta.wma(src17, length17), math.floor(math.sqrt(length17)))buy1 = hma17 > level1 and hma17[1] < level1[1] and close > close[2]⋯noneColor18 = color.new(color.white, 100)-csrc = change(src18)+csrc = ta.change(src18)-obv1(src18) => cum(change(src18) > 0 ? volume : csrc < 0 ? -volume : 0*volume)+obv1(src18) => ta.cum(ta.change(src18) > 0 ? volume : csrc < 0 ? -volume : 0*volume)os = obv1(src18)-obv_osc = (os - ema(os,len18))+obv_osc = (os - ta.ema(os,len18))obc_color=obv_osc > 0 ? color.green : color.red⋯//hline(0)-plFound18 = na(pivotlow(obv_osc, lbL18, lbR18)) ? false : true+plFound18 = na(ta.pivotlow(obv_osc, lbL18, lbR18)) ? false : true-phFound18 = na(pivothigh(obv_osc, lbL18, lbR18)) ? false : true+phFound18 = na(ta.pivothigh(obv_osc, lbL18, lbR18)) ? false : true_inRange(cond) =>-    bars = barssince(cond == true)+    bars = ta.barssince(cond == true)    rangeLower18 <= bars and bars <= rangeUpper18⋯// Osc: Higher Low-oscHL18 = obv_osc[lbR18] > valuewhen(plFound18, obv_osc[lbR18], 1) and _inRange(plFound18[1])+oscHL18 = obv_osc[lbR18] > ta.valuewhen(plFound18, obv_osc[lbR18], 1) and _inRange(plFound18[1])// Price: Lower Low-priceLL18 = low[lbR18] < valuewhen(plFound18, low[lbR18], 1)+priceLL18 = low[lbR18] < ta.valuewhen(plFound18, low[lbR18], 1)bullCond18 = plotBull18 and priceLL18 and oscHL18 and plFound18⋯// Osc: Lower Low-oscLL18 = obv_osc[lbR18] < valuewhen(plFound18, obv_osc[lbR18], 1) and _inRange(plFound18[1])+oscLL18 = obv_osc[lbR18] < ta.valuewhen(plFound18, obv_osc[lbR18], 1) and _inRange(plFound18[1])// Price: Higher Low-priceHL18 = low[lbR18] > valuewhen(plFound18, low[lbR18], 1)+priceHL18 = low[lbR18] > ta.valuewhen(plFound18, low[lbR18], 1)hiddenBullCond18 = plotHiddenBull18 and priceHL18 and oscLL18 and plFound18⋯// Osc: Lower High-oscLH18 = obv_osc[lbR18] < valuewhen(phFound18, obv_osc[lbR18], 1) and _inRange(phFound18[1])+oscLH18 = obv_osc[lbR18] < ta.valuewhen(phFound18, obv_osc[lbR18], 1) and _inRange(phFound18[1])// Price: Higher High-priceHH18 = high[lbR18] > valuewhen(phFound18, high[lbR18], 1)+priceHH18 = high[lbR18] > ta.valuewhen(phFound18, high[lbR18], 1)bearCond18 = plotBear18 and priceHH18 and oscLH18 and phFound18⋯// Osc: Higher High-oscHH18 = obv_osc[lbR18] > valuewhen(phFound18, obv_osc[lbR18], 1) and _inRange(phFound18[1])+oscHH18 = obv_osc[lbR18] > ta.valuewhen(phFound18, obv_osc[lbR18], 1) and _inRange(phFound18[1])// Price: Lower High-priceLH18 = high[lbR18] < valuewhen(phFound18, high[lbR18], 1)+priceLH18 = high[lbR18] < ta.valuewhen(phFound18, high[lbR18], 1)hiddenBearCond18 = plotHiddenBear18 and priceLH18 and oscHH18 and phFound18⋯ad19 = close==high and close==low or high==low ? 0 : ((2*close-low-high)/(high-low))*volume-cmf = sum(ad19, length19) / sum(volume, length19)+cmf = math.sum(ad19, length19) / math.sum(volume, length19)//plot(cmf, color=#43A047, title="MF")⋯    // sumSrcSrcVol calculates the dividend of the equation that is later used to calculate the standard deviation-    sumSrcSrcVol := isNewPeriod ? volume * pow(src20, 2) : volume * pow(src20, 2) + sumSrcSrcVol[1]+    sumSrcSrcVol := isNewPeriod ? volume * math.pow(src20, 2) : volume * math.pow(src20, 2) + sumSrcSrcVol[1]        _vwap = sumSrcVol / sumVol-    variance = sumSrcSrcVol / sumVol - pow(_vwap, 2)+    variance = sumSrcSrcVol / sumVol - math.pow(_vwap, 2)    variance := variance < 0 ? 0 : variance-    stDev = sqrt(variance)+    stDev = math.sqrt(variance)    ⋯timeChange(period) =>-    change(time(period))+    ta.change(time(period))new_earnings = earnings(syminfo.tickerid, earnings.actual, barmerge.gaps_on, barmerge.lookahead_on)⋯if trendRule == trendRule1-    priceAvg = sma(close, 50)+    priceAvg = ta.sma(close, 50)    C_DownTrend := close < priceAvg⋯if trendRule == trendRule2-    sma200 = sma(close, 200)+    sma200 = ta.sma(close, 200)-    sma50 = sma(close, 50)+    sma50 = ta.sma(close, 50)    C_DownTrend := close < sma50 and sma50 < sma200⋯C_Factor = 2.0 // shows the number of times the shadow dominates the candlestick body-C_BodyHi = max(close, open)+C_BodyHi = math.max(close, open)-C_BodyLo = min(close, open)+C_BodyLo = math.min(close, open)C_Body = C_BodyHi - C_BodyLo-C_BodyAvg = ema(C_Body, C_Len)+C_BodyAvg = ta.ema(C_Body, C_Len)C_SmallBody = C_Body < C_BodyAvg⋯C_BodyMiddle = C_Body / 2 + C_BodyLo-C_ShadowEquals = C_UpShadow == C_DnShadow or (abs(C_UpShadow - C_DnShadow) / C_DnShadow * 100) < C_ShadowEqualsPercent and (abs(C_DnShadow - C_UpShadow) / C_UpShadow * 100) < C_ShadowEqualsPercent+C_ShadowEquals = C_UpShadow == C_DnShadow or (math.abs(C_UpShadow - C_DnShadow) / C_DnShadow * 100) < C_ShadowEqualsPercent and (math.abs(C_DnShadow - C_UpShadow) / C_UpShadow * 100) < C_ShadowEqualsPercentC_IsDojiBody = C_Range > 0 and C_Body <= C_Range * C_DojiBodyPercent / 100C_Doji = C_IsDojiBody and C_ShadowEquals-patternLabelPosLow = low - (atr(30) * 0.6)+patternLabelPosLow = low - (ta.atr(30) * 0.6)-patternLabelPosHigh = high + (atr(30) * 0.6)+patternLabelPosHigh = high + (ta.atr(30) * 0.6)label_color_bullish = color.blue⋯//Stop Loss Warning Option-stoplosspercent = input(title="Stop Loss Warning (%)", type=input.float, defval=-2.5, minval=-50, maxval=0, step=.1) / 100+stoplosspercent = input.float(title="Stop Loss Warning (%)", defval=-2.5, minval=-50, maxval=0, step=.1) / 100//Score Requirements⋯if emadirectionup-    table.cell(statuswindow, 3, 1, text=tostring(emadirectionupstatus), bgcolor=color.new(#00bcd4, 50), text_color=color.white, text_size=size.small)+    table.cell(statuswindow, 3, 1, text=str.tostring(emadirectionupstatus), bgcolor=color.new(#00bcd4, 50), text_color=color.white, text_size=size.small)if emadirectiondown-    table.cell(statuswindow, 3, 1, text=tostring(emadirectiondownstatus), bgcolor=color.new(#e91e63, 50), text_color=color.white, text_size=size.small)+    table.cell(statuswindow, 3, 1, text=str.tostring(emadirectiondownstatus), bgcolor=color.new(#e91e63, 50), text_color=color.white, text_size=size.small)if emapushup ? 1 : na-    table.cell(statuswindow, 3, 2, text=tostring(emapushupstatus), bgcolor=color.new(#00bcd4, 50), text_color=color.white, text_size=size.small)+    table.cell(statuswindow, 3, 2, text=str.tostring(emapushupstatus), bgcolor=color.new(#00bcd4, 50), text_color=color.white, text_size=size.small)if emapushup ? na : 1⋯if emapulldown ? 1 : na-    table.cell(statuswindow, 3, 3, text=tostring(emapulldownstatus), bgcolor=color.new(#e91e63, 50), text_color=color.white, text_size=size.small)+    table.cell(statuswindow, 3, 3, text=str.tostring(emapulldownstatus), bgcolor=color.new(#e91e63, 50), text_color=color.white, text_size=size.small)if emapulldown ? na : 1⋯if supertrendup-    table.cell(statuswindow, 3, 4, text=tostring(supertrendupstatus), bgcolor=color.new(#00bcd4, 50), text_color=color.white, text_size=size.small)+    table.cell(statuswindow, 3, 4, text=str.tostring(supertrendupstatus), bgcolor=color.new(#00bcd4, 50), text_color=color.white, text_size=size.small)if supertrenddown-    table.cell(statuswindow, 3, 4, text=tostring(supertrenddownstatus), bgcolor=color.new(#e91e63, 50), text_color=color.white, text_size=size.small)+    table.cell(statuswindow, 3, 4, text=str.tostring(supertrenddownstatus), bgcolor=color.new(#e91e63, 50), text_color=color.white, text_size=size.small)if supertrendrevup ? 1 : na-    table.cell(statuswindow, 3, 5, text=tostring(supertrendrevupstatus), bgcolor=color.new(#00bcd4, 50), text_color=color.white, text_size=size.small)+    table.cell(statuswindow, 3, 5, text=str.tostring(supertrendrevupstatus), bgcolor=color.new(#00bcd4, 50), text_color=color.white, text_size=size.small)if supertrendrevup ? na : 1⋯if supertrendrevdown ? 1 : na-    table.cell(statuswindow, 3, 6, text=tostring(supertrendrevdownstatus), bgcolor=color.new(#e91e63, 50), text_color=color.white, text_size=size.small)+    table.cell(statuswindow, 3, 6, text=str.tostring(supertrendrevdownstatus), bgcolor=color.new(#e91e63, 50), text_color=color.white, text_size=size.small)if supertrendrevdown ? na : 1⋯if psardirup-    table.cell(statuswindow, 3, 7, text=tostring(psardirupstatus), bgcolor=color.new(#00bcd4, 50), text_color=color.white, text_size=size.small)+    table.cell(statuswindow, 3, 7, text=str.tostring(psardirupstatus), bgcolor=color.new(#00bcd4, 50), text_color=color.white, text_size=size.small)if psardirdown-    table.cell(statuswindow, 3, 7, text=tostring(psardirdownstatus), bgcolor=color.new(#e91e63, 50), text_color=color.white, text_size=size.small)+    table.cell(statuswindow, 3, 7, text=str.tostring(psardirdownstatus), bgcolor=color.new(#e91e63, 50), text_color=color.white, text_size=size.small)if psarrevup ? 1 : na-    table.cell(statuswindow, 3, 8, text=tostring(psarrevupstatus), bgcolor=color.new(#00bcd4, 50), text_color=color.white, text_size=size.small)+    table.cell(statuswindow, 3, 8, text=str.tostring(psarrevupstatus), bgcolor=color.new(#00bcd4, 50), text_color=color.white, text_size=size.small)if psarrevup ? na : 1⋯if psarrevdown ? 1 : na-    table.cell(statuswindow, 3, 9, text=tostring(psarrevdownstatus), bgcolor=color.new(#e91e63, 50), text_color=color.white, text_size=size.small)+    table.cell(statuswindow, 3, 9, text=str.tostring(psarrevdownstatus), bgcolor=color.new(#e91e63, 50), text_color=color.white, text_size=size.small)if psarrevdown ? na : 1⋯if hmacloseposup-    table.cell(statuswindow, 3, 10, text=tostring(hmacloseposupstatus), bgcolor=color.new(#00bcd4, 50), text_color=color.white, text_size=size.small)+    table.cell(statuswindow, 3, 10, text=str.tostring(hmacloseposupstatus), bgcolor=color.new(#00bcd4, 50), text_color=color.white, text_size=size.small)if hmacloseposdown-    table.cell(statuswindow, 3, 10, text=tostring(hmacloseposdownstatus), bgcolor=color.new(#e91e63, 50), text_color=color.white, text_size=size.small)+    table.cell(statuswindow, 3, 10, text=str.tostring(hmacloseposdownstatus), bgcolor=color.new(#e91e63, 50), text_color=color.white, text_size=size.small)if hmapivotup ? 1 : na-    table.cell(statuswindow, 3, 11, text=tostring(hmapivotupstatus), bgcolor=color.new(#00bcd4, 50), text_color=color.white, text_size=size.small)+    table.cell(statuswindow, 3, 11, text=str.tostring(hmapivotupstatus), bgcolor=color.new(#00bcd4, 50), text_color=color.white, text_size=size.small)if hmapivotup ? na : 1⋯if hmapivotdown ? 1 : na-    table.cell(statuswindow, 3, 12, text=tostring(hmapivotdownstatus), bgcolor=color.new(#e91e63, 50), text_color=color.white, text_size=size.small)+    table.cell(statuswindow, 3, 12, text=str.tostring(hmapivotdownstatus), bgcolor=color.new(#e91e63, 50), text_color=color.white, text_size=size.small)if hmapivotdown ? na : 1⋯if rsidivup ? 1 : na-    table.cell(statuswindow, 2, 1, text=tostring(rsidivupstatus), bgcolor=color.new(#00bcd4, 50), text_color=color.white, text_size=size.small)+    table.cell(statuswindow, 2, 1, text=str.tostring(rsidivupstatus), bgcolor=color.new(#00bcd4, 50), text_color=color.white, text_size=size.small)if rsidivup ? na : 1⋯if rsidivdown ? 1 : na-    table.cell(statuswindow, 2, 2, text=tostring(rsidivdownstatus), bgcolor=color.new(#e91e63, 50), text_color=color.white, text_size=size.small)+    table.cell(statuswindow, 2, 2, text=str.tostring(rsidivdownstatus), bgcolor=color.new(#e91e63, 50), text_color=color.white, text_size=size.small)if rsidivdown ? na : 1⋯if rsioversold ? 1 : na-    table.cell(statuswindow, 2, 3, text=tostring(rsioversoldstatus), bgcolor=color.new(#00bcd4, 50), text_color=color.white, text_size=size.small)+    table.cell(statuswindow, 2, 3, text=str.tostring(rsioversoldstatus), bgcolor=color.new(#00bcd4, 50), text_color=color.white, text_size=size.small)if rsioversold ? na : 1⋯if rsioverbought ? 1 : na-    table.cell(statuswindow, 2, 4, text=tostring(rsioverboughtstatus), bgcolor=color.new(#e91e63, 50), text_color=color.white, text_size=size.small)+    table.cell(statuswindow, 2, 4, text=str.tostring(rsioverboughtstatus), bgcolor=color.new(#e91e63, 50), text_color=color.white, text_size=size.small)if rsioverbought ? na : 1⋯if rsicrossup ? 1 : na-    table.cell(statuswindow, 2, 5, text=tostring(rsicrossupstatus), bgcolor=color.new(#00bcd4, 50), text_color=color.white, text_size=size.small)+    table.cell(statuswindow, 2, 5, text=str.tostring(rsicrossupstatus), bgcolor=color.new(#00bcd4, 50), text_color=color.white, text_size=size.small)if rsicrossup ? na : 1⋯if rsicrossdown ? 1 : na-    table.cell(statuswindow, 2, 6, text=tostring(rsicrossdownstatus), bgcolor=color.new(#e91e63, 50), text_color=color.white, text_size=size.small)+    table.cell(statuswindow, 2, 6, text=str.tostring(rsicrossdownstatus), bgcolor=color.new(#e91e63, 50), text_color=color.white, text_size=size.small)if rsicrossdown ? na : 1⋯if macddivup ? 1 : na-    table.cell(statuswindow, 2, 7, text=tostring(macddivupstatus), bgcolor=color.new(#00bcd4, 50), text_color=color.white, text_size=size.small)+    table.cell(statuswindow, 2, 7, text=str.tostring(macddivupstatus), bgcolor=color.new(#00bcd4, 50), text_color=color.white, text_size=size.small)if macddivup ? na : 1⋯if macddivdown ? 1 : na-    table.cell(statuswindow, 2, 8, text=tostring(macddivdownstatus), bgcolor=color.new(#e91e63, 50), text_color=color.white, text_size=size.small)+    table.cell(statuswindow, 2, 8, text=str.tostring(macddivdownstatus), bgcolor=color.new(#e91e63, 50), text_color=color.white, text_size=size.small)if macddivdown ? na : 1⋯if histpivotup ? 1 : na-    table.cell(statuswindow, 2, 9, text=tostring(histpivotupstatus), bgcolor=color.new(#00bcd4, 50), text_color=color.white, text_size=size.small)+    table.cell(statuswindow, 2, 9, text=str.tostring(histpivotupstatus), bgcolor=color.new(#00bcd4, 50), text_color=color.white, text_size=size.small)if histpivotup ? na : 1⋯if histpivotdown ? 1 : na-    table.cell(statuswindow, 2, 10, text=tostring(histpivotdownstatus), bgcolor=color.new(#e91e63, 50), text_color=color.white, text_size=size.small)+    table.cell(statuswindow, 2, 10, text=str.tostring(histpivotdownstatus), bgcolor=color.new(#e91e63, 50), text_color=color.white, text_size=size.small)if histpivotdown ? na : 1⋯if macdcrosssignalup ? 1 : na-    table.cell(statuswindow, 2, 11, text=tostring(macdcrosssignalupstatus), bgcolor=color.new(#00bcd4, 50), text_color=color.white, text_size=size.small)+    table.cell(statuswindow, 2, 11, text=str.tostring(macdcrosssignalupstatus), bgcolor=color.new(#00bcd4, 50), text_color=color.white, text_size=size.small)if macdcrosssignalup ? na : 1⋯if macdcrosssignaldown ? 1 : na-    table.cell(statuswindow, 2, 12, text=tostring(macdcrosssignaldownstatus), bgcolor=color.new(#e91e63, 50), text_color=color.white, text_size=size.small)+    table.cell(statuswindow, 2, 12, text=str.tostring(macdcrosssignaldownstatus), bgcolor=color.new(#e91e63, 50), text_color=color.white, text_size=size.small)if macdcrosssignaldown ? na : 1⋯if wtdivup ? 1 : na-    table.cell(statuswindow, 2, 13, text=tostring(wtdivupstatus), bgcolor=color.new(#00bcd4, 50), text_color=color.white, text_size=size.small)+    table.cell(statuswindow, 2, 13, text=str.tostring(wtdivupstatus), bgcolor=color.new(#00bcd4, 50), text_color=color.white, text_size=size.small)if wtdivup ? na : 1⋯if wtdivdown ? 1 : na-    table.cell(statuswindow, 2, 14, text=tostring(wtdivdownstatus), bgcolor=color.new(#e91e63, 50), text_color=color.white, text_size=size.small)+    table.cell(statuswindow, 2, 14, text=str.tostring(wtdivdownstatus), bgcolor=color.new(#e91e63, 50), text_color=color.white, text_size=size.small)if wtdivdown ? na : 1⋯if wtcrosssignalup ? 1 : na-    table.cell(statuswindow, 2, 15, text=tostring(wtcrosssignalupstatus), bgcolor=color.new(#00bcd4, 50), text_color=color.white, text_size=size.small)+    table.cell(statuswindow, 2, 15, text=str.tostring(wtcrosssignalupstatus), bgcolor=color.new(#00bcd4, 50), text_color=color.white, text_size=size.small)if wtcrosssignalup ? na : 1⋯if wtcrosssignaldown ? 1 : na-    table.cell(statuswindow, 2, 16, text=tostring(wtcrosssignaldownstatus), bgcolor=color.new(#e91e63, 50), text_color=color.white, text_size=size.small)+    table.cell(statuswindow, 2, 16, text=str.tostring(wtcrosssignaldownstatus), bgcolor=color.new(#e91e63, 50), text_color=color.white, text_size=size.small)if wtcrosssignaldown ? na : 1⋯if sdivup ? 1 : na-    table.cell(statuswindow, 2, 17, text=tostring(sdivupstatus), bgcolor=color.new(#00bcd4, 50), text_color=color.white, text_size=size.small)+    table.cell(statuswindow, 2, 17, text=str.tostring(sdivupstatus), bgcolor=color.new(#00bcd4, 50), text_color=color.white, text_size=size.small)if sdivup ? na : 1⋯if sdivdown ? 1 : na-    table.cell(statuswindow, 2, 18, text=tostring(sdivdownstatus), bgcolor=color.new(#e91e63, 50), text_color=color.white, text_size=size.small)+    table.cell(statuswindow, 2, 18, text=str.tostring(sdivdownstatus), bgcolor=color.new(#e91e63, 50), text_color=color.white, text_size=size.small)if sdivdown ? na : 1⋯if scrosssignalup ? 1 : na-    table.cell(statuswindow, 2, 19, text=tostring(scrosssignalupstatus), bgcolor=color.new(#00bcd4, 50), text_color=color.white, text_size=size.small)+    table.cell(statuswindow, 2, 19, text=str.tostring(scrosssignalupstatus), bgcolor=color.new(#00bcd4, 50), text_color=color.white, text_size=size.small)if scrosssignalup ? na : 1⋯if scrosssignaldown ? 1 : na-    table.cell(statuswindow, 2, 20, text=tostring(scrosssignaldownstatus), bgcolor=color.new(#e91e63, 50), text_color=color.white, text_size=size.small)+    table.cell(statuswindow, 2, 20, text=str.tostring(scrosssignaldownstatus), bgcolor=color.new(#e91e63, 50), text_color=color.white, text_size=size.small)if scrosssignaldown ? na : 1⋯if bbcontup ? 1 : na-    table.cell(statuswindow, 1, 1, text=tostring(bbcontupstatus), bgcolor=color.new(#00bcd4, 50), text_color=color.white, text_size=size.small)+    table.cell(statuswindow, 1, 1, text=str.tostring(bbcontupstatus), bgcolor=color.new(#00bcd4, 50), text_color=color.white, text_size=size.small)if bbcontup ? na : 1⋯if bbcontup ? 1 : na-    table.cell(statuswindow, 1, 2, text=tostring(bbcontdownstatus), bgcolor=color.new(#e91e63, 50), text_color=color.white, text_size=size.small)+    table.cell(statuswindow, 1, 2, text=str.tostring(bbcontdownstatus), bgcolor=color.new(#e91e63, 50), text_color=color.white, text_size=size.small)if bbcontdown ? na : 1⋯if atrrevup ? 1 : na-    table.cell(statuswindow, 1, 3, text=tostring(atrrevupstatus), bgcolor=color.new(#00bcd4, 50), text_color=color.white, text_size=size.small)+    table.cell(statuswindow, 1, 3, text=str.tostring(atrrevupstatus), bgcolor=color.new(#00bcd4, 50), text_color=color.white, text_size=size.small)if atrrevup ? na : 1⋯if atrrevdown ? 1 : na-    table.cell(statuswindow, 1, 4, text=tostring(atrrevdownstatus), bgcolor=color.new(#e91e63, 50), text_color=color.white, text_size=size.small)+    table.cell(statuswindow, 1, 4, text=str.tostring(atrrevdownstatus), bgcolor=color.new(#e91e63, 50), text_color=color.white, text_size=size.small)if atrrevdown ? na : 1⋯if rviposup ? 1 : na-    table.cell(statuswindow, 1, 5, text=tostring(rviposupstatus), bgcolor=color.new(#00bcd4, 50), text_color=color.white, text_size=size.small)+    table.cell(statuswindow, 1, 5, text=str.tostring(rviposupstatus), bgcolor=color.new(#00bcd4, 50), text_color=color.white, text_size=size.small)if rviposup ? na : 1⋯if rviposdown ? 1 : na-    table.cell(statuswindow, 1, 6, text=tostring(rviposdownstatus), bgcolor=color.new(#e91e63, 50), text_color=color.white, text_size=size.small)+    table.cell(statuswindow, 1, 6, text=str.tostring(rviposdownstatus), bgcolor=color.new(#e91e63, 50), text_color=color.white, text_size=size.small)if rviposdown ? na : 1⋯if rvidivup ? 1 : na-    table.cell(statuswindow, 1, 7, text=tostring(rvidivupstatus), bgcolor=color.new(#00bcd4, 50), text_color=color.white, text_size=size.small)+    table.cell(statuswindow, 1, 7, text=str.tostring(rvidivupstatus), bgcolor=color.new(#00bcd4, 50), text_color=color.white, text_size=size.small)if rvidivup ? na : 1⋯if rvidivdown ? 1 : na-    table.cell(statuswindow, 1, 8, text=tostring(rvidivdownstatus), bgcolor=color.new(#e91e63, 50), text_color=color.white, text_size=size.small)+    table.cell(statuswindow, 1, 8, text=str.tostring(rvidivdownstatus), bgcolor=color.new(#e91e63, 50), text_color=color.white, text_size=size.small)if rvidivdown ? na : 1⋯if srcrossup ? 1 : na-    table.cell(statuswindow, 1, 9, text=tostring(srcrossupstatus), bgcolor=color.new(#00bcd4, 50), text_color=color.white, text_size=size.small)+    table.cell(statuswindow, 1, 9, text=str.tostring(srcrossupstatus), bgcolor=color.new(#00bcd4, 50), text_color=color.white, text_size=size.small)if srcrossup ? na : 1⋯if srcrossdown ? 1 : na-    table.cell(statuswindow, 1, 10, text=tostring(srcrossdownstatus), bgcolor=color.new(#e91e63, 50), text_color=color.white, text_size=size.small)+    table.cell(statuswindow, 1, 10, text=str.tostring(srcrossdownstatus), bgcolor=color.new(#e91e63, 50), text_color=color.white, text_size=size.small)if srcrossdown ? na : 1⋯if obvdivup ? 1 : na-    table.cell(statuswindow, 0, 1, text=tostring(obvdivupstatus), bgcolor=color.new(#00bcd4, 50), text_color=color.white, text_size=size.small)+    table.cell(statuswindow, 0, 1, text=str.tostring(obvdivupstatus), bgcolor=color.new(#00bcd4, 50), text_color=color.white, text_size=size.small)if obvdivup ? na : 1⋯if obvdivdown ? 1 : na-    table.cell(statuswindow, 0, 2, text=tostring(obvdivdownstatus), bgcolor=color.new(#e91e63, 50), text_color=color.white, text_size=size.small)+    table.cell(statuswindow, 0, 2, text=str.tostring(obvdivdownstatus), bgcolor=color.new(#e91e63, 50), text_color=color.white, text_size=size.small)if obvdivdown ? na : 1⋯if cmfcrossup ? 1 : na-    table.cell(statuswindow, 0, 3, text=tostring(cmfcrossupstatus), bgcolor=color.new(#00bcd4, 50), text_color=color.white, text_size=size.small)+    table.cell(statuswindow, 0, 3, text=str.tostring(cmfcrossupstatus), bgcolor=color.new(#00bcd4, 50), text_color=color.white, text_size=size.small)if cmfcrossup ? na : 1⋯if cmfcrossdown ? 1 : na-    table.cell(statuswindow, 0, 4, text=tostring(cmfcrossdownstatus), bgcolor=color.new(#e91e63, 50), text_color=color.white, text_size=size.small)+    table.cell(statuswindow, 0, 4, text=str.tostring(cmfcrossdownstatus), bgcolor=color.new(#e91e63, 50), text_color=color.white, text_size=size.small)if cmfcrossdown ? na : 1⋯if cmflevup ? 1 : na-    table.cell(statuswindow, 0,5, text=tostring(cmflevupstatus), bgcolor=color.new(#00bcd4, 50), text_color=color.white, text_size=size.small)+    table.cell(statuswindow, 0,5, text=str.tostring(cmflevupstatus), bgcolor=color.new(#00bcd4, 50), text_color=color.white, text_size=size.small)if cmflevdown ? 1 : na-    table.cell(statuswindow, 0, 5, text=tostring(cmflevdownstatus), bgcolor=color.new(#e91e63, 50), text_color=color.white, text_size=size.small)+    table.cell(statuswindow, 0, 5, text=str.tostring(cmflevdownstatus), bgcolor=color.new(#e91e63, 50), text_color=color.white, text_size=size.small)    ⋯if vwapcrossup ? 1 : na-    table.cell(statuswindow, 0, 6, text=tostring(vwapcrossupstatus), bgcolor=color.new(#00bcd4, 50), text_color=color.white, text_size=size.small)+    table.cell(statuswindow, 0, 6, text=str.tostring(vwapcrossupstatus), bgcolor=color.new(#00bcd4, 50), text_color=color.white, text_size=size.small)if vwapcrossup ? na : 1⋯if vwapcrossdown ? 1 : na-    table.cell(statuswindow, 0, 7, text=tostring(vwapcrossdownstatus), bgcolor=color.new(#e91e63, 50), text_color=color.white, text_size=size.small)+    table.cell(statuswindow, 0, 7, text=str.tostring(vwapcrossdownstatus), bgcolor=color.new(#e91e63, 50), text_color=color.white, text_size=size.small)if vwapcrossdown ? na : 1⋯if vwaptrendup ? 1 : na-    table.cell(statuswindow, 0,8, text=tostring(vwaptrendupstatus), bgcolor=color.new(#00bcd4, 50), text_color=color.white, text_size=size.small)+    table.cell(statuswindow, 0,8, text=str.tostring(vwaptrendupstatus), bgcolor=color.new(#00bcd4, 50), text_color=color.white, text_size=size.small)if vwaptrenddown ? 1 : na-    table.cell(statuswindow, 0, 8, text=tostring(vwaptrenddownstatus), bgcolor=color.new(#e91e63, 50), text_color=color.white, text_size=size.small)+    table.cell(statuswindow, 0, 8, text=str.tostring(vwaptrenddownstatus), bgcolor=color.new(#e91e63, 50), text_color=color.white, text_size=size.small)    ⋯if bulleng ? 1 : na-    table.cell(statuswindow, 0, 9, text=tostring(bullengstatus), bgcolor=color.new(#00bcd4, 50), text_color=color.white, text_size=size.small)+    table.cell(statuswindow, 0, 9, text=str.tostring(bullengstatus), bgcolor=color.new(#00bcd4, 50), text_color=color.white, text_size=size.small)if bulleng ? na : 1⋯if beareng ? 1 : na-    table.cell(statuswindow, 0, 10, text=tostring(bearengstatus), bgcolor=color.new(#e91e63, 50), text_color=color.white, text_size=size.small)+    table.cell(statuswindow, 0, 10, text=str.tostring(bearengstatus), bgcolor=color.new(#e91e63, 50), text_color=color.white, text_size=size.small)if beareng ? na : 1⋯usestopalert = input(defval=true, title="Use STOP Alert", group="Alert Messages")-stopstring = input(title="Stop Alert Message", defval="CLOSE", type=input.string, confirm=false, group="Alert Messages", tooltip=ttstopstring)+stopstring = input.string(title="Stop Alert Message", defval="CLOSE", confirm=false, group="Alert Messages", tooltip=ttstopstring)//buystring  = "ENTER-LONG_BYBIT_LINKUSDT_mybybite-bot_10M_403d210eb46a9bd3"⋯d_or_k = input(defval="D", options=["D", "K"])-OB = input(80, "Overbought", type=input.integer)+OB = input.int(80, "Overbought")-OS = input(20, "Oversold", type=input.integer)+OS = input.int(20, "Oversold")-midline= input(50, "Mid line", type=input.integer)+midline= input.int(50, "Mid line")showArrows = input(true, "Show Arrows")⋯showArrowsExit = input(true, "Show Arrows on Exit zone")-cci = cci(source, cci_period)+cci = ta.cci(source, cci_period)-stoch_cci_k = sma(stoch(cci, cci, cci, stoch_period), stoch_smooth_k)+stoch_cci_k = ta.sma(ta.stoch(cci, cci, cci, stoch_period), stoch_smooth_k)-stoch_cci_d = sma(stoch_cci_k, stoch_smooth_d)+stoch_cci_d = ta.sma(stoch_cci_k, stoch_smooth_d)ma = (d_or_k == "D") ? stoch_cci_d : stoch_cci_ktrend_enter = if showArrowsEnter-    if crossunder(ma, OS)+    if ta.crossunder(ma, OS)        1    else-        if crossover(ma, OB)+        if ta.crossover(ma, OB)            -1⋯trend_exit = if showArrowsExit-    if crossunder(ma, OB)+    if ta.crossunder(ma, OB)        -1    else-        if crossover(ma, OS)+        if ta.crossover(ma, OS)            1trend_center = if showArrowsCenter-    if crossunder(ma, 50)+    if ta.crossunder(ma, 50)        -1    else-        if crossover(ma, 50)+        if ta.crossover(ma, 50)            1⋯//len22 = input(50, minval=1, title="EMA of RSI Length")-    up11 = rma(max(change(close), 0), 20)+    up11 = ta.rma(math.max(ta.change(close), 0), 20)-    down11 = rma(-min(change(close), 0), 20)+    down11 = ta.rma(-math.min(ta.change(close), 0), 20)    rsi11 = down11 == 0 ? 100 : up11 == 0 ? 0 : 100 - (100 / (1 + up11 / down11))-    emaRSI11 = ema(rsi11,40)+    emaRSI11 = ta.ema(rsi11,40)-    rsi55 = rsi(close, 14)+    rsi55 = ta.rsi(close, 14)-    k55 = sma(stoch(rsi55, rsi55, rsi55, 14), 3)+    k55 = ta.sma(ta.stoch(rsi55, rsi55, rsi55, 14), 3)-    d55 = sma(k55, 3)+    d55 = ta.sma(k55, 3)    rsi11+1.8 > emaRSI11  ? 1 : 0 ⋯//len22 = input(50, minval=1, title="EMA of RSI Length")-    up11 = rma(max(change(close), 0), 20)+    up11 = ta.rma(math.max(ta.change(close), 0), 20)-    down11 = rma(-min(change(close), 0), 20)+    down11 = ta.rma(-math.min(ta.change(close), 0), 20)    rsi11 = down11 == 0 ? 100 : up11 == 0 ? 0 : 100 - (100 / (1 + up11 / down11))-    emaRSI11 = ema(rsi11,40)+    emaRSI11 = ta.ema(rsi11,40)-    rsi55 = rsi(close, 14)+    rsi55 = ta.rsi(close, 14)-    k55 = sma(stoch(rsi55, rsi55, rsi55, 14), 3)+    k55 = ta.sma(ta.stoch(rsi55, rsi55, rsi55, 14), 3)-    d55 = sma(k55, 3)+    d55 = ta.sma(k55, 3)    rsi11-1.8 < emaRSI11  ? 1 : 0 ⋯//len22 = input(50, minval=1, title="EMA of RSI Length")-    up22 = rma(max(change(close), 0), 12)+    up22 = ta.rma(math.max(ta.change(close), 0), 12)-    down22 = rma(-min(change(close), 0), 12)+    down22 = ta.rma(-math.min(ta.change(close), 0), 12)    rsi22 = down22 == 0 ? 100 : up22 == 0 ? 0 : 100 - (100 / (1 + up22 / down22))-    emaRSI22 = ema(rsi22,12)+    emaRSI22 = ta.ema(rsi22,12)-    rsi33 = rsi(close, 14)+    rsi33 = ta.rsi(close, 14)-    k33 = sma(stoch(rsi33, rsi33, rsi33, 14), 3)+    k33 = ta.sma(ta.stoch(rsi33, rsi33, rsi33, 14), 3)-    d33 = sma(k33, 3)+    d33 = ta.sma(k33, 3)    StochRsiUP = k33>d33  ? 1 : 0    StochRsiDOWN = k33<d33 ?  1 : 0 -    StochRsiUpSignal = StochRsiUP and  barssince(crossover(k33,d33)) < barssince(crossunder(k33,d33)) and barssince(crossover(k33,d33)) <3     and k33-d33>0.7  ? 1 : 0//and d33<40 ? 1 : 0 +    StochRsiUpSignal = StochRsiUP and  ta.barssince(ta.crossover(k33,d33)) < ta.barssince(ta.crossunder(k33,d33)) and ta.barssince(ta.crossover(k33,d33)) <3     and k33-d33>0.7  ? 1 : 0//and d33<40 ? 1 : 0 -    StochRsiDownSignal = StochRsiDOWN and  barssince(crossunder(k33,d33)) < barssince(crossover(k33,d33)) and barssince(crossunder(k33,d33)) <3  and d33-k33>0.7 ?  1 : 0//and k33 > 60 ?  1 : 0 +    StochRsiDownSignal = StochRsiDOWN and  ta.barssince(ta.crossunder(k33,d33)) < ta.barssince(ta.crossover(k33,d33)) and ta.barssince(ta.crossunder(k33,d33)) <3  and d33-k33>0.7 ?  1 : 0//and k33 > 60 ?  1 : 0     RsiMa1212UP= rsi22>emaRSI22 ? 1:0    RsiMa1212DOWN= rsi22<emaRSI22 ? 1:0-    RsiMa1212UpSignal = RsiMa1212UP and barssince(crossover(rsi22,emaRSI22)) < barssince(crossunder(rsi22,emaRSI22)) and barssince(crossover(rsi22,emaRSI22)) <3   and rsi22-emaRSI22>0.7  ? 1 : 0//and d33<40 ? 1 : 0 +    RsiMa1212UpSignal = RsiMa1212UP and ta.barssince(ta.crossover(rsi22,emaRSI22)) < ta.barssince(ta.crossunder(rsi22,emaRSI22)) and ta.barssince(ta.crossover(rsi22,emaRSI22)) <3   and rsi22-emaRSI22>0.7  ? 1 : 0//and d33<40 ? 1 : 0 -    RsiMa1212DownSignal = RsiMa1212DOWN and barssince(crossunder(rsi22,emaRSI22)) < barssince(crossover(rsi22,emaRSI22)) and barssince(crossunder(rsi22,emaRSI22)) <3  and emaRSI22-rsi22>0.7 ?  1 : 0//and k33 > 60 ?  1 : 0 +    RsiMa1212DownSignal = RsiMa1212DOWN and ta.barssince(ta.crossunder(rsi22,emaRSI22)) < ta.barssince(ta.crossover(rsi22,emaRSI22)) and ta.barssince(ta.crossunder(rsi22,emaRSI22)) <3  and emaRSI22-rsi22>0.7 ?  1 : 0//and k33 > 60 ?  1 : 0     StochRsiUpSignal and RsiMa1212UpSignal ? 1 : 0 // LongFlage #3⋯//len22 = input(50, minval=1, title="EMA of RSI Length")-    up22 = rma(max(change(close), 0), 12)+    up22 = ta.rma(math.max(ta.change(close), 0), 12)-    down22 = rma(-min(change(close), 0), 12)+    down22 = ta.rma(-math.min(ta.change(close), 0), 12)    rsi22 = down22 == 0 ? 100 : up22 == 0 ? 0 : 100 - (100 / (1 + up22 / down22))-    emaRSI22 = ema(rsi22,12)+    emaRSI22 = ta.ema(rsi22,12)-    rsi33 = rsi(close, 14)+    rsi33 = ta.rsi(close, 14)-    k33 = sma(stoch(rsi33, rsi33, rsi33, 14), 3)+    k33 = ta.sma(ta.stoch(rsi33, rsi33, rsi33, 14), 3)-    d33 = sma(k33, 3)+    d33 = ta.sma(k33, 3)    StochRsiUP = k33>d33  ? 1 : 0    StochRsiDOWN = k33<d33 ?  1 : 0 -    StochRsiUpSignal = StochRsiUP and  barssince(crossover(k33,d33)) < barssince(crossunder(k33,d33)) and barssince(crossover(k33,d33)) <3     and k33-d33>0.7  ? 1 : 0//and d33<40 ? 1 : 0 +    StochRsiUpSignal = StochRsiUP and  ta.barssince(ta.crossover(k33,d33)) < ta.barssince(ta.crossunder(k33,d33)) and ta.barssince(ta.crossover(k33,d33)) <3     and k33-d33>0.7  ? 1 : 0//and d33<40 ? 1 : 0 -    StochRsiDownSignal = StochRsiDOWN and  barssince(crossunder(k33,d33)) < barssince(crossover(k33,d33)) and barssince(crossunder(k33,d33)) <3  and d33-k33>0.7 ?  1 : 0//and k33 > 60 ?  1 : 0 +    StochRsiDownSignal = StochRsiDOWN and  ta.barssince(ta.crossunder(k33,d33)) < ta.barssince(ta.crossover(k33,d33)) and ta.barssince(ta.crossunder(k33,d33)) <3  and d33-k33>0.7 ?  1 : 0//and k33 > 60 ?  1 : 0     RsiMa1212UP= rsi22>emaRSI22 ? 1:0    RsiMa1212DOWN= rsi22<emaRSI22 ? 1:0-    RsiMa1212UpSignal = RsiMa1212UP and barssince(crossover(rsi22,emaRSI22)) < barssince(crossunder(rsi22,emaRSI22)) and barssince(crossover(rsi22,emaRSI22)) <3   and rsi22-emaRSI22>0.7  ? 1 : 0//and d33<40 ? 1 : 0 +    RsiMa1212UpSignal = RsiMa1212UP and ta.barssince(ta.crossover(rsi22,emaRSI22)) < ta.barssince(ta.crossunder(rsi22,emaRSI22)) and ta.barssince(ta.crossover(rsi22,emaRSI22)) <3   and rsi22-emaRSI22>0.7  ? 1 : 0//and d33<40 ? 1 : 0 -    RsiMa1212DownSignal = RsiMa1212DOWN and barssince(crossunder(rsi22,emaRSI22)) < barssince(crossover(rsi22,emaRSI22)) and barssince(crossunder(rsi22,emaRSI22)) <3  and emaRSI22-rsi22>0.7 ?  1 : 0//and k33 > 60 ?  1 : 0 +    RsiMa1212DownSignal = RsiMa1212DOWN and ta.barssince(ta.crossunder(rsi22,emaRSI22)) < ta.barssince(ta.crossover(rsi22,emaRSI22)) and ta.barssince(ta.crossunder(rsi22,emaRSI22)) <3  and emaRSI22-rsi22>0.7 ?  1 : 0//and k33 > 60 ?  1 : 0     StochRsiDownSignal and RsiMa1212DownSignal ? 1 : 0 // ShortFlage #3⋯LongFL4() =>-    cci4410= cci(close,10)+    cci4410= ta.cci(close,10)-    cci4420= cci(close,20)+    cci4420= ta.cci(close,20)-    emacci4420= ema(cci4420,5)+    emacci4420= ta.ema(cci4420,5)//Cci4410EmaCci4420Up = emacci4420>cci4410 and  barssince(crossover(emacci4420,cci4410)<3 ?1 :0  -    cci4410>emacci4420 and  barssince(crossover(cci4410,emacci4420))<barssince(crossunder(cci4410,emacci4420)) and  barssince(crossover(cci4410,emacci4420))<3 ?1 :0+    cci4410>emacci4420 and  ta.barssince(ta.crossover(cci4410,emacci4420))<ta.barssince(ta.crossunder(cci4410,emacci4420)) and  ta.barssince(ta.crossover(cci4410,emacci4420))<3 ?1 :0ShortFL4() =>-    cci4410= cci(close,10)+    cci4410= ta.cci(close,10)-    cci4420= cci(close,20)+    cci4420= ta.cci(close,20)-    emacci4420= ema(cci4420,5)+    emacci4420= ta.ema(cci4420,5)//Cci4410EmaCci4420Up = emacci4420>cci4410 and  barssince(crossover(emacci4420,cci4410)<3 ?1 :0  -    emacci4420>cci4410 and  barssince(crossunder(cci4410,emacci4420))<barssince(crossover(cci4410,emacci4420))  and  barssince(crossunder(cci4410,emacci4420))<3 ?1 :0+    emacci4420>cci4410 and  ta.barssince(ta.crossunder(cci4410,emacci4420))<ta.barssince(ta.crossover(cci4410,emacci4420))  and  ta.barssince(ta.crossunder(cci4410,emacci4420))<3 ?1 :0//***********************************************************************        END         *****************************************************************************⋯float arrowDown = na-atr2 = atr(100) / 2+atr2 = ta.atr(100) / 2dev22 = channelDeviation22 * atr2-highPrice = high[abs(highestbars(amplitude22))]+highPrice = high[math.abs(ta.highestbars(amplitude22))]-lowPrice = low[abs(lowestbars(amplitude22))]+lowPrice = low[math.abs(ta.lowestbars(amplitude22))]-highma = sma(high, amplitude22)+highma = ta.sma(high, amplitude22)-lowma = sma(low, amplitude22)+lowma = ta.sma(low, amplitude22)if nextTrend == 1-    maxLowPrice := max(lowPrice, maxLowPrice)+    maxLowPrice := math.max(lowPrice, maxLowPrice)    if highma < maxLowPrice and close < nz(low[1], low)⋯else-    minHighPrice := min(highPrice, minHighPrice)+    minHighPrice := math.min(highPrice, minHighPrice)    if lowma > minHighPrice and close > nz(high[1], high)⋯    else-        up := na(up[1]) ? maxLowPrice : max(maxLowPrice, up[1])+        up := na(up[1]) ? maxLowPrice : math.max(maxLowPrice, up[1])    atrHigh := up + dev22⋯    else-        down := na(down[1]) ? minHighPrice : min(minHighPrice, down[1])+        down := na(down[1]) ? minHighPrice : math.min(minHighPrice, down[1])    atrHigh := down + dev22⋯sellSignal55 = not na(arrowDown) and (trend == 1 and trend[1] == 0)-halfTrend= barssince(buySignal55)>=0  and barssince(buySignal55) < barssince(sellSignal55) ? "Blue" : "Red" /// 1= Long , 0= Short+halfTrend= ta.barssince(buySignal55)>=0  and ta.barssince(buySignal55) < ta.barssince(sellSignal55) ? "Blue" : "Red" /// 1= Long , 0= Short//LongFlage5=  crossunder(rsi66,30) and  barssince(buySignal55)>0  and barssince(buySignal55) < barssince(sellSignal55) ? 1 :0⋯SHcciTop() =>-    rsi66 = rsi(close,2)+    rsi66 = ta.rsi(close,2)-    rsi661 = rsi(close[1],2)+    rsi661 = ta.rsi(close[1],2)-    cci66= cci(close,2) // 5 bod+    cci66= ta.cci(close,2) // 5 bod    cci77 = open[0] > close[0] ? open[0]-close[0]>0.2 ? cci66+25 : 0 : close[0]-open[0]>0.2 ? cci66-25 : 0  // cci taghir yafteh bedelile candle bozorge ⋯    finalCCi= cci77==0 ? cci66 : cci77-    cci07=cci(close[0],2)+    cci07=ta.cci(close[0],2)-    cci17=cci(close[1],2)+    cci17=ta.cci(close[1],2)-    cci27=cci(close[2],2)+    cci27=ta.cci(close[2],2)-    maCCI=ema(cci07,2)+    maCCI=ta.ema(cci07,2)    -    crossunder(cci07,maCCI) and cci17>55 and finalCCi==cci66  ? 1 : 0+    ta.crossunder(cci07,maCCI) and cci17>55 and finalCCi==cci66  ? 1 : 0SHcciKaf() =>-    rsi66 = rsi(close,2)+    rsi66 = ta.rsi(close,2)-    rsi661 = rsi(close[1],2)+    rsi661 = ta.rsi(close[1],2)-    cci66= cci(close,2) // 5 bod+    cci66= ta.cci(close,2) // 5 bod    cci77 = open[0] > close[0] ? open[0]-close[0]>0.2 ? cci66+25 : 0 : close[0]-open[0]>0.2 ? cci66-25 : 0  // cci taghir yafteh bedelile candle bozorge ⋯    finalCCi= cci77==0 ? cci66 : cci77-    cci07=cci(close[0],2)+    cci07=ta.cci(close[0],2)-    cci17=cci(close[1],2)+    cci17=ta.cci(close[1],2)-    cci27=cci(close[2],2)+    cci27=ta.cci(close[2],2)-    maCCI=ema(cci07,2)+    maCCI=ta.ema(cci07,2)    -    crossover(cci07,maCCI) and cci17<-55 and finalCCi==cci66 ? 1:0+    ta.crossover(cci07,maCCI) and cci17<-55 and finalCCi==cci66 ? 1:0SHrsiTop() =>-    rsi07=cci(close[0],2)+    rsi07=ta.cci(close[0],2)-    rsi17=cci(close[1],2)+    rsi17=ta.cci(close[1],2)-    rsi27=cci(close[2],2)+    rsi27=ta.cci(close[2],2)-    maRSI=ema(rsi07,2)+    maRSI=ta.ema(rsi07,2)-    crossunder(rsi07,maRSI) and rsi17>65 ? 1 : 0+    ta.crossunder(rsi07,maRSI) and rsi17>65 ? 1 : 0SHrsiKaf() =>-    rsi07=cci(close[0],2)+    rsi07=ta.cci(close[0],2)-    rsi17=cci(close[1],2)+    rsi17=ta.cci(close[1],2)-    rsi27=cci(close[2],2)+    rsi27=ta.cci(close[2],2)-    maRSI=ema(rsi07,2)+    maRSI=ta.ema(rsi07,2)-    crossover(rsi07,maRSI) and rsi17<35 ? 1 : 0+    ta.crossover(rsi07,maRSI) and rsi17<35 ? 1 : 0LongFL5() =>-    SHrsiKaf() and SHcciKaf() and barssince(buySignal55)>0  and barssince(buySignal55) < barssince(sellSignal55) ?1 : 0   // khate Abi+    SHrsiKaf() and SHcciKaf() and ta.barssince(buySignal55)>0  and ta.barssince(buySignal55) < ta.barssince(sellSignal55) ?1 : 0   // khate AbiShortFL5() =>-    SHrsiTop() and SHcciTop() and barssince(sellSignal55)>0  and  barssince(sellSignal55) < barssince(buySignal55) ? 1 :0 //khate Ghermez+    SHrsiTop() and SHcciTop() and ta.barssince(sellSignal55)>0  and  ta.barssince(sellSignal55) < ta.barssince(buySignal55) ? 1 :0 //khate Ghermez//LongFlage5=  (shekasteRSIkaf and shekastCCIkaf and  barssince(buySignal55)>0  and barssince(buySignal55) < barssince(sellSignal55)) ? 1 :0  // khate Abi⋯LongFL6() =>-    rsi661 = rsi(close[1],2)+    rsi661 = ta.rsi(close[1],2)    rsi661<33 and SHcciKaf() ?1 :0 ⋯ShortFL6() =>-    rsi661 = rsi(close[1],2)+    rsi661 = ta.rsi(close[1],2)    rsi661>67 and SHcciTop()⋯ExitLong() =>-    rsi44 = rsi(close, 21)+    rsi44 = ta.rsi(close, 21)-    k44 = ema(stoch(rsi44, rsi44, rsi44, 21), 3)+    k44 = ta.ema(ta.stoch(rsi44, rsi44, rsi44, 21), 3)-    d44 = ema(k44, 3)+    d44 = ta.ema(k44, 3)//ExitLong=crossover(ma,70) ? 1:0 //midline=57⋯ExitShort() =>-    rsi44 = rsi(close, 21)+    rsi44 = ta.rsi(close, 21)-    k44 = ema(stoch(rsi44, rsi44, rsi44, 21), 3)+    k44 = ta.ema(ta.stoch(rsi44, rsi44, rsi44, 21), 3)-    d44 = ema(k44, 3)+    d44 = ta.ema(k44, 3)//ExitShort= crossunder(ma,30) ? 1:0 //midline=43⋯    ShortPos= false-    strategy.entry("LONG",1)+    strategy.entry("LONG",strategy.long)EnterShort() =>⋯    LongPos = false-    strategy.entry("SHORT",0)+    strategy.entry("SHORT",strategy.short)ExitPos() =>⋯

Clean v5

Not verified

The v5 script does not run in Zeal Terminal's engine ([Context.call] Execution error for ID "earnings@L607:C15": The provided reference is not a function. Check if the function exists in the stdlib.), so this step could not be checked.

  • Line 11: input() → input.bool()
  • Line 12: input() → input.int()
  • Line 701: input() → input.bool()
  • Line 703: input() → input.bool()
  • Line 704: input() → input.bool()
  • Line 708: input() → input.int()
45 more edits
  • Line 709: input() → input.int()
  • Line 710: input() → input.int()
  • Line 711: input() → input.int()
  • Line 714: input() → input.int()
  • Line 719: input() → input.int()
  • Line 725: input() → input.int()
  • Line 730: input() → input.int()
  • Line 736: input() → input.int()
  • Line 741: input() → input.int()
  • Line 747: input() → input.int()
  • Line 752: input() → input.int()
  • Line 759: input() → input.int()
  • Line 764: input() → input.int()
  • Line 769: input() → input.int()
  • Line 775: input() → input.int()
  • Line 780: input() → input.int()
  • Line 785: input() → input.int()
  • Line 791: input() → input.int()
  • Line 796: input() → input.int()
  • Line 802: input() → input.int()
  • Line 807: input() → input.int()
  • Line 814: input() → input.int()
  • Line 820: input() → input.int()
  • Line 826: input() → input.int()
  • Line 831: input() → input.int()
  • Line 837: input() → input.int()
  • Line 844: input() → input.int()
  • Line 850: input() → input.int()
  • Line 855: input() → input.int()
  • Line 861: input() → input.int()
  • Line 866: input() → input.int()
  • Line 872: input() → input.int()
  • Line 1171: input() → input.bool()
  • Line 1174: input() → input.bool()
  • Line 1177: input() → input.bool()
  • Line 1185: input() → input.source()
  • Line 1186: input() → input.int()
  • Line 1187: input() → input.int()
  • Line 1188: input() → input.int()
  • Line 1189: input() → input.int()
  • Line 1190: input() → input.string()
  • Line 1194: input() → input.bool()
  • Line 1195: input() → input.bool()
  • Line 1196: input() → input.bool()
  • Line 1197: input() → input.bool()
⋯tttradetrend = "Only place BUY or SELL orders with the direction of the Trend EMA."-tradetrendoption = input(false, title="Only Tade with Trend", tooltip=tttradetrend)+tradetrendoption = input.bool(false, title="Only Tade with Trend", tooltip=tttradetrend)-len111 = input(defval=200, minval=0, maxval=2000, title="Trend EMA Length")+len111 = input.int(defval=200, minval=0, maxval=2000, title="Trend EMA Length")src111 = close⋯//Alternate Signals Option-alternatesignals = input(title="Alternate Signals", defval=true)+alternatesignals = input.bool(title="Alternate Signals", defval=true)//Position Options-longpositions = input(title="Long Positions", defval=true)+longpositions = input.bool(title="Long Positions", defval=true)-shortpositions = input(title="Short Positions", defval=true)+shortpositions = input.bool(title="Short Positions", defval=true)//Stop Loss Warning Option⋯//Score Requirements-stronglongscore = input(defval=6, minval=0, maxval=1000, title="Required Strong LONG Score")+stronglongscore = input.int(defval=6, minval=0, maxval=1000, title="Required Strong LONG Score")-strongshortscore = input(defval=6, minval=0, maxval=1000, title="Required Strong SHORT Score")+strongshortscore = input.int(defval=6, minval=0, maxval=1000, title="Required Strong SHORT Score")-weaklongscore = input(defval=6, minval=0, maxval=1000, title="Required Weak LONG Score")+weaklongscore = input.int(defval=6, minval=0, maxval=1000, title="Required Weak LONG Score")-weakshortscore = input(defval=6, minval=0, maxval=1000, title="Required Weak SHORT Score")+weakshortscore = input.int(defval=6, minval=0, maxval=1000, title="Required Weak SHORT Score")//Trend Indicator Signals/////////////////////////////////////////////////////////EMA Signals-emadirectionimportance = input(defval=2, minval=0, maxval=100, title="EMA Trend Direction Importance")+emadirectionimportance = input.int(defval=2, minval=0, maxval=100, title="EMA Trend Direction Importance")emadirectionup = out5 < close ? emadirectionimportance : 0⋯emadirectiondownstatus = emadirectiondown ? "EMA Trend Direction Down" : na-emapushpullimportance = input(defval=2, minval=0, maxval=100, title="EMA Pressure Importance")+emapushpullimportance = input.int(defval=2, minval=0, maxval=100, title="EMA Pressure Importance")emapushup = out2 > out2[1] and out3 < out3[1] ? emapushpullimportance : 0⋯//Super Trend Signals-supertrenddirimportance = input(defval=0, minval=0, maxval=100, title="SuperTrend Direction Importance")+supertrenddirimportance = input.int(defval=0, minval=0, maxval=100, title="SuperTrend Direction Importance")supertrendup = direction < 0 ? supertrenddirimportance : 0⋯supertrenddownstatus = supertrenddown ? "SuperTrend Direction Down" : na-supertrendrevimportance = input(defval=4, minval=0, maxval=100, title="SuperTrend Reversal Importance")+supertrendrevimportance = input.int(defval=4, minval=0, maxval=100, title="SuperTrend Reversal Importance")supertrendrevup = direction < 0 and direction[1] > 0[1] ? supertrendrevimportance : 0⋯//Parabolic SAR Signals-psardirimportance = input(defval=0, minval=0, maxval=100, title="Parabolic SAR Direction Importance")+psardirimportance = input.int(defval=0, minval=0, maxval=100, title="Parabolic SAR Direction Importance")psardirup = psar < close ? psardirimportance : 0⋯psardirdownstatus = psardirdown ? "PSAR Direction Down" : na-psarrevimportance = input(defval=3, minval=0, maxval=100, title="Parabolic SAR Reversal Importance")+psarrevimportance = input.int(defval=3, minval=0, maxval=100, title="Parabolic SAR Reversal Importance")psarrevup = psar < close and psar[1] > close[1] ? psarrevimportance : 0⋯//HMA Signals-hmacloseposimportance = input(defval=1, minval=0, maxval=100, title="HMA Trend Direction Importance")+hmacloseposimportance = input.int(defval=1, minval=0, maxval=100, title="HMA Trend Direction Importance")hmacloseposup = hma < close and hma[1] ? hmacloseposimportance : 0⋯hmacloseposdownstatus = hmacloseposdown ? "Price Crossed Under HMA" : na-hmapivotimportance = input(defval=3, minval=0, maxval=100, title="HMA Pivot Importance")+hmapivotimportance = input.int(defval=3, minval=0, maxval=100, title="HMA Pivot Importance")hmapivotup = hma > hma[1] and hma[1] < hma[2] ? hmapivotimportance : 0⋯//RSI Signals-rsidivimportance = input(defval=4, minval=0, maxval=100, title="RSI Divergence Importance")+rsidivimportance = input.int(defval=4, minval=0, maxval=100, title="RSI Divergence Importance")rsidivup = bullCond11 or bullCond11[1] or bullCond11[2] ? rsidivimportance : 0⋯rsidivdownstatus = rsidivdown ? "Bearish RSI Divergence" : na-rsilevelimportance = input(defval=0, minval=0, maxval=100, title="RSI Level Importance")+rsilevelimportance = input.int(defval=0, minval=0, maxval=100, title="RSI Level Importance")rsioversold = osc11 < 30 ? rsilevelimportance : 0⋯rsioverboughtstatus = rsioverbought ? "RSI Overbought" : na-rsidirectionimportance = input(defval=1, minval=0, maxval=100, title="RSI Cross 50-Line Importance")+rsidirectionimportance = input.int(defval=1, minval=0, maxval=100, title="RSI Cross 50-Line Importance")rsicrossup = (osc11 > 50 and osc11[1] < 50) or (osc11 > 50 and osc11[2] < 50) ? rsidirectionimportance : 0⋯//MACD Signals-macddivimportance = input(defval=0, minval=0, maxval=100, title="MACD Divergence Importance")+macddivimportance = input.int(defval=0, minval=0, maxval=100, title="MACD Divergence Importance")macddivup = bullCond12 or bullCond12[1] or bullCond12[2] ? macddivimportance : 0⋯macddivdownstatus = macddivdown ? "Bearish MACD Divergence" : na-histpivotimportance = input(defval=1, minval=0, maxval=100, title="MACD Histogram Pivot Importance")+histpivotimportance = input.int(defval=1, minval=0, maxval=100, title="MACD Histogram Pivot Importance")histpivotup = hist > hist[1] and hist[1] < hist[2] and hist < 0 ? histpivotimportance : 0⋯histpivotdownstatus = histpivotdown ? "MACD Histogram Pivot Down" : na-macdcrosssignalimportance = input(defval=1, minval=0, maxval=100, title="MACD Cross Signal Importance")+macdcrosssignalimportance = input.int(defval=1, minval=0, maxval=100, title="MACD Cross Signal Importance")macdcrosssignalup = macd > signal and macd[1] < signal[1] and signal < 0 ? macdcrosssignalimportance : 0⋯//WaveTrend Signals-wtdivimportance = input(defval=0, minval=0, maxval=100, title="WaveTrend Divergence Importance")+wtdivimportance = input.int(defval=0, minval=0, maxval=100, title="WaveTrend Divergence Importance")wtdivup = bullCond13 or bullCond13[1] or bullCond13[2] ? wtdivimportance : 0⋯wtdivdownstatus = wtdivdown ? "Bearish WaveTrend Divergence" : na-wtcrosssignalimportance = input(defval=4, minval=0, maxval=100, title="WaveTrend Cross Signal Importance")+wtcrosssignalimportance = input.int(defval=4, minval=0, maxval=100, title="WaveTrend Cross Signal Importance")wtcrosssignalup = wt1 > wt2 and wt1[1] < wt2[1] and wt2 < -10 ? wtcrosssignalimportance : 0⋯//Stochastic Signals-sdivimportance = input(defval=1, minval=0, maxval=100, title="Stochastic Divergence Importance")+sdivimportance = input.int(defval=1, minval=0, maxval=100, title="Stochastic Divergence Importance")sdivup = bullCond14 or bullCond14[1] or bullCond14[2] ? sdivimportance : 0⋯sdivdownstatus = sdivdown ? "Bearish Stoch Divergence" : na-scrosssignalimportance = input(defval=1, minval=0, maxval=100, title="Stoch Cross Signal Importance")+scrosssignalimportance = input.int(defval=1, minval=0, maxval=100, title="Stoch Cross Signal Importance")scrosssignalup = k14 > d14 and k14[1] < d14[1] ? scrosssignalimportance : 0⋯//Bollinger Bands Signals-bbcontimportance = input(defval=0, minval=0, maxval=100, title="BollingerBands Contact Importance")+bbcontimportance = input.int(defval=0, minval=0, maxval=100, title="BollingerBands Contact Importance")bbcontup = close < lower ? bbcontimportance : 0⋯//Average True Range Signals-atrrevimportance = input(defval=1, minval=0, maxval=100, title="ATR Reversal Importance")+atrrevimportance = input.int(defval=1, minval=0, maxval=100, title="ATR Reversal Importance")atrrevup = buySignal ? atrrevimportance : 0⋯//Relative Volatility Index Signals-rviposimportance = input(defval=3, minval=0, maxval=100, title="RVI Position Importance")+rviposimportance = input.int(defval=3, minval=0, maxval=100, title="RVI Position Importance")rviposup = rvi > 25 and rvi[1] < 40 ? rviposimportance : 0⋯rviposdownstatus = rviposdown ? "RVI Volatility Decreasing" : na-rvidivimportance = input(defval=4, minval=0, maxval=100, title="RVI Divergence Importance")+rvidivimportance = input.int(defval=4, minval=0, maxval=100, title="RVI Divergence Importance")rvidivup = bullCond15 or bullCond15[1] or bullCond15[2] ? rvidivimportance : 0⋯//Support and Resistance Signals-srcrossimportance = input(defval=4, minval=0, maxval=100, title="Support/Resistance Cross Importance")+srcrossimportance = input.int(defval=4, minval=0, maxval=100, title="Support/Resistance Cross Importance")srcrossup = buy1 or buy2 or buy3 or buy4 or buy5 or buy6 or buy7 or buy8 ? srcrossimportance : 0⋯//On Balance Volume Divergence Signals-obvdivimportance = input(defval=0, minval=0, maxval=100, title="OBV Divergence Importance")+obvdivimportance = input.int(defval=0, minval=0, maxval=100, title="OBV Divergence Importance")obvdivup = bullCond18 or bullCond18[1] or bullCond18[2] ? obvdivimportance : 0⋯//Chaikin Money Flow Signals-cmfcrossimportance = input(defval=0, minval=0, maxval=100, title="CMF Cross 50-Line Importance")+cmfcrossimportance = input.int(defval=0, minval=0, maxval=100, title="CMF Cross 50-Line Importance")cmfcrossup = cmf > 0 and cmf[1] < 0 ? cmfcrossimportance : 0⋯cmfcrossdownstatus = cmfcrossdown ? "CMF Crossed 50-Line Down" : na-cmflevimportance = input(defval=0, minval=0, maxval=100, title="CMF Level Importance")+cmflevimportance = input.int(defval=0, minval=0, maxval=100, title="CMF Level Importance")cmflevup = cmf > 0 ? cmflevimportance : 0⋯//VWAP Signals-vwapcrossimportance = input(defval=0, minval=0, maxval=100, title="VWAP Cross HMA Importance")+vwapcrossimportance = input.int(defval=0, minval=0, maxval=100, title="VWAP Cross HMA Importance")vwapcrossup = hma < vwapValue and hma[1] > vwapValue[1] ? vwapcrossimportance : 0⋯vwapcrossdownstatus = vwapcrossdown ? "VWAP Crossed Below HMA" : na-vwaptrendimportance = input(defval=0, minval=0, maxval=100, title="VWAP Trend Importance")+vwaptrendimportance = input.int(defval=0, minval=0, maxval=100, title="VWAP Trend Importance")vwaptrendup = out2 > vwapValue ? vwaptrendimportance : 0⋯//Candle Patterns Signals-engulfingcandleimportance = input(defval=0, minval=0, maxval=100, title="Engulfing Candle Importance")+engulfingcandleimportance = input.int(defval=0, minval=0, maxval=100, title="Engulfing Candle Importance")bulleng = C_EngulfingBullish ? engulfingcandleimportance : 0⋯ttstopstring = "Input your custom alert message here. In the Alert settings, choose \"Neural Network\" and \"Alert() functionc calls only\"\nIf you're using a 3Commas Bot, make sure to format your message correctly with forward slashes in front of each quotation, you can find videos about how to do this on YouTube. Or ask 3Commas support about how to format the message for PineScript."-usebuyalert = input(defval=true, title="Use BUY Alert", group="Alert Messages")+usebuyalert = input.bool(defval=true, title="Use BUY Alert", group="Alert Messages")//buystring  = input(title="Buy Alert Message",  defval="ENTER-LONG_OKEX-FUTURES_LINK-USDT-220805_my-trading-view_10M_80eba43b2348716e",  type=input.string, confirm=false, group="Alert Messages", tooltip=ttbuystring)buystring  = "ENTER-LONG_BYBIT_LINKUSDT_mybybite-bot_10M_403d210eb46a9bd3"-usesellalert = input(defval=true, title="Use SELL Alert", group="Alert Messages")+usesellalert = input.bool(defval=true, title="Use SELL Alert", group="Alert Messages")//sellstring = input(title="Sell Alert Message", defval="ENTER-SHORT_OKEX-FUTURES_LINK-USDT-220805_my-trading-view_10M_80eba43b2348716e", type=input.string, confirm=false, group="Alert Messages", tooltip=ttsellstring)sellstring = "ENTER-SHORT_BYBIT_LINKUSDT_mybybite-bot_10M_403d210eb46a9bd3"-usestopalert = input(defval=true, title="Use STOP Alert", group="Alert Messages")+usestopalert = input.bool(defval=true, title="Use STOP Alert", group="Alert Messages")stopstring = input.string(title="Stop Alert Message", defval="CLOSE", confirm=false, group="Alert Messages", tooltip=ttstopstring)⋯// shooroe cod haye indicatore cci_s.....  -source = input(close)+source = input.source(close)-cci_period = input(20, "CCI Period")+cci_period = input.int(20, "CCI Period")-stoch_period = input(20, "Stoch Period")+stoch_period = input.int(20, "Stoch Period")-stoch_smooth_k = input(7, "Stoch Smooth K")+stoch_smooth_k = input.int(7, "Stoch Smooth K")-stoch_smooth_d = input(3, "Stoch Smooth D")+stoch_smooth_d = input.int(3, "Stoch Smooth D")-d_or_k = input(defval="D", options=["D", "K"])+d_or_k = input.string(defval="D", options=["D", "K"])OB = input.int(80, "Overbought")⋯midline= input.int(50, "Mid line")-showArrows = input(true, "Show Arrows")+showArrows = input.bool(true, "Show Arrows")-showArrowsEnter = input(true, "Show Arrows on Enter zone")+showArrowsEnter = input.bool(true, "Show Arrows on Enter zone")-showArrowsCenter = input(false, "Show Arrows on Center zone")+showArrowsCenter = input.bool(false, "Show Arrows on Center zone")-showArrowsExit = input(true, "Show Arrows on Exit zone")+showArrowsExit = input.bool(true, "Show Arrows on Exit zone")cci = ta.cci(source, cci_period)⋯

Does it run in Pine Script v6?

Not tested

The v5 script does not run in Zeal Terminal's engine ([Context.call] Execution error for ID "earnings@L607:C15": The provided reference is not a function. Check if the function exists in the stdlib.), so this step could not be checked. The v6 version is shown for reference and is not offered as a download. It differs from the v5 version by 1 edit.

⋯// © ahhanegin-//@version=5+//@version=6//study("Haeri")⋯

Settings

Every input the script declares, with its default and what it feeds. Bounds are the ones the script enforces.

SettingDefaultType and rangeFeeds
Only Tade with TrendOnly place BUY or SELL orders with the direction of the Trend EMA.falseboolStrong Long Label Strong Short Label
Trend EMA Length200int · min 0 · max 2000out111
Alternate Signalstrueboolalternatelong alternateshort
Long Positionstrueboollongentry0
Short Positionstrueboolshortentry0
Stop Loss Warning (%)-2.5float · min -50 · max 0 · step .1longstoploss shortstoploss
Required Strong LONG Score6int · min 0 · max 1000stronglongentrysignal
Required Strong SHORT Score6int · min 0 · max 1000strongshortentrysignal
Required Weak LONG Score6int · min 0 · max 1000weaklongentrysignal
Required Weak SHORT Score6int · min 0 · max 1000weakshortentrysignal
EMA Trend Direction Importance2int · min 0 · max 100emadirectionup emadirectiondown
EMA Pressure Importance2int · min 0 · max 100emapushup emapulldown
SuperTrend Direction Importance0int · min 0 · max 100supertrendup supertrenddown
SuperTrend Reversal Importance4int · min 0 · max 100supertrendrevup supertrendrevdown
Parabolic SAR Direction Importance0int · min 0 · max 100psardirup psardirdown
Parabolic SAR Reversal Importance3int · min 0 · max 100psarrevup psarrevdown
HMA Trend Direction Importance1int · min 0 · max 100hmacloseposup hmacloseposdown
HMA Pivot Importance3int · min 0 · max 100hmapivotup hmapivotdown
RSI Divergence Importance4int · min 0 · max 100rsidivup rsidivdown
RSI Level Importance0int · min 0 · max 100rsioversold rsioverbought
RSI Cross 50-Line Importance1int · min 0 · max 100rsicrossup rsicrossdown
MACD Divergence Importance0int · min 0 · max 100macddivup macddivdown
MACD Histogram Pivot Importance1int · min 0 · max 100histpivotup histpivotdown
MACD Cross Signal Importance1int · min 0 · max 100macdcrosssignalup macdcrosssignaldown
WaveTrend Divergence Importance0int · min 0 · max 100wtdivup wtdivdown
WaveTrend Cross Signal Importance4int · min 0 · max 100wtcrosssignalup wtcrosssignaldown
Stochastic Divergence Importance1int · min 0 · max 100sdivup sdivdown
Stoch Cross Signal Importance1int · min 0 · max 100scrosssignalup scrosssignaldown
BollingerBands Contact Importance0int · min 0 · max 100bbcontup bbcontdown
ATR Reversal Importance1int · min 0 · max 100atrrevup atrrevdown
RVI Position Importance3int · min 0 · max 100rviposup rviposdown
RVI Divergence Importance4int · min 0 · max 100rvidivup rvidivdown
Support/Resistance Cross Importance4int · min 0 · max 100srcrossup srcrossdown
OBV Divergence Importance0int · min 0 · max 100obvdivup obvdivdown
CMF Cross 50-Line Importance0int · min 0 · max 100cmfcrossup cmfcrossdown
CMF Level Importance0int · min 0 · max 100cmflevup cmflevdown
VWAP Cross HMA Importance0int · min 0 · max 100vwapcrossup vwapcrossdown
VWAP Trend Importance0int · min 0 · max 100vwaptrendup vwaptrenddown
Engulfing Candle Importance0int · min 0 · max 100bulleng beareng
Source (no label in the script)closesourcecci
CCI Period20intcci
Stoch Period20intstoch_cci_k
Stoch Smooth K7intstoch_cci_k
Stoch Smooth D3intstoch_cci_d
D or k (no label in the script)Dstring · options ["D", "K"]ma
Overbought80int (written input.integer)trend_enter trend_exit Upper Line color_fill_os ShortFlage
Oversold20int (written input.integer)trend_enter trend_exit Lower Line color_fill_ob LongFlage
Mid line50int (written input.integer)unused
Show Arrowstrueboolunused
Show Arrows on Enter zonetruebooltrend_enter
Show Arrows on Center zonefalsebooltrend_center
Show Arrows on Exit zonetruebooltrend_exit
Alert Messages
Use BUY Alerttrueboollongentry0
Use SELL Alerttrueboolshortentry0
Use STOP Alerttrueboolunused
Stop Alert MessageInput your custom alert message here. In the Alert settings, choose \"Neural Network\" and \"Alert() functionc calls only\"\nIf you're using a 3Commas Bot, make sure to format your message correctly with forward slashes in front of each quotation, you can find videos about how to do this on YouTube. Or ask 3Commas support about how to format the message for PineScript.CLOSEstringunused

What it calculates

  • EMA (ema, ta.ema in v5)src111, Trend EMA Length (200)out111 · line 14
  • EMA (ema, ta.ema in v5)src1, len1out1 · line 21
  • EMA (ema, ta.ema in v5)src2, len2out2 · line 27
  • EMA (ema, ta.ema in v5)src3, len3out3 · line 33
  • EMA (ema, ta.ema in v5)src4, len4out4 · line 39
  • EMA (ema, ta.ema in v5)src5, len5out5 · line 45
  • Supertrend (supertrend, ta.supertrend in v5)factor, atrPeriodsupertrend · line 52
  • Supertrend (supertrend, ta.supertrend in v5)factor, atrPerioddirection · line 52
  • WMA (wma, ta.wma in v5)2*wma(src6, len6/2)-wma(src6, len6), floor(sqrt(len6))hma · line 63
  • SAR (sar, ta.sar in v5)start, increment, maximumpsar · line 70
  • RSI (rsi, ta.rsi in v5)src11, len11osc11 · line 92
  • Pivotlow (pivotlow, ta.pivotlow in v5)osc11, lbL11, lbR11plFound11 · line 98
  • Pivothigh (pivothigh, ta.pivothigh in v5)osc11, lbL11, lbR11phFound11 · line 99
  • SMA / EMA (sma, ta.sma in v5)src12, fast_length12fast_ma12 · line 152
  • SMA / EMA (sma, ta.sma in v5)src12, slow_length12slow_ma12 · line 153
  • SMA / EMA (sma, ta.sma in v5)macd, signal_length12signal · line 155
  • Pivotlow (pivotlow, ta.pivotlow in v5)osc12, lbL12, lbR12plFound12 · line 176
  • Pivothigh (pivothigh, ta.pivothigh in v5)osc12, lbL12, lbR12phFound12 · line 177
  • Highest (highest, ta.highest in v5)osc12, lbL12+lbR12+5priceHHZero12 · line 187
  • Lowest (lowest, ta.lowest in v5)osc12, lbL12+lbR12+5priceLLZero12 · line 206
  • EMA (ema, ta.ema in v5)ap, n1esa · line 229
  • EMA (ema, ta.ema in v5)abs(ap - esa), n1d1 · line 230
  • EMA (ema, ta.ema in v5)ci, n2tci · line 232
  • SMA (sma, ta.sma in v5)wt1, 4wt2 · line 235
  • Pivotlow (pivotlow, ta.pivotlow in v5)osc13, lbL13, lbR13plFound13 · line 257
  • Pivothigh (pivothigh, ta.pivothigh in v5)osc13, lbL13, lbR13phFound13 · line 258
  • SMA / Stoch (sma, ta.sma in v5)stoch(close, high, low, periodK14), smoothK14k14 · line 299
  • SMA (sma, ta.sma in v5)k14, periodD14d14 · line 300
  • Pivotlow (pivotlow, ta.pivotlow in v5)osc14, lbL14, lbR14plFound14 · line 322
  • Pivothigh (pivothigh, ta.pivothigh in v5)osc14, lbL14, lbR14phFound14 · line 323
  • SMA (sma, ta.sma in v5)src7, length1basis · line 367
  • Stdev (stdev, ta.stdev in v5)src7, length1dev · line 368
  • ATR (atr, ta.atr in v5)length2atr · line 382
  • Highest (highest, ta.highest in v5)close, length2longStop · line 383
  • Lowest (lowest, ta.lowest in v5)close, length2shortStop · line 386
  • Stdev (stdev, ta.stdev in v5)src15, length15stddev15 · line 401
  • EMA / Change (ema, ta.ema in v5)change(src15) <= 0 ? 0 : stddev15, len15upper15 · line 402
  • EMA / Change (ema, ta.ema in v5)change(src15) > 0 ? 0 : stddev15, len15lower15 · line 403
  • Pivotlow (pivotlow, ta.pivotlow in v5)osc15, lbL15, lbR15plFound15 · line 426
  • Pivothigh (pivothigh, ta.pivothigh in v5)osc15, lbL15, lbR15phFound15 · line 427
  • WMA (wma, ta.wma in v5)2*wma(src17, length17/2)-wma(src17, length17), floor(sqrt(length17))hma17 · line 491
  • Change (change, ta.change in v5)src18csrc · line 528
  • EMA (ema, ta.ema in v5)os, len18obv_osc · line 531
  • Pivotlow (pivotlow, ta.pivotlow in v5)obv_osc, lbL18, lbR18plFound18 · line 536
  • Pivothigh (pivothigh, ta.pivothigh in v5)obv_osc, lbL18, lbR18phFound18 · line 537
  • SMA (sma, ta.sma in v5)close, 50priceAvg · line 649
  • SMA (sma, ta.sma in v5)close, 200sma200 · line 653
  • SMA (sma, ta.sma in v5)close, 50sma50 · line 654
  • EMA (ema, ta.ema in v5)C_Body, C_LenC_BodyAvg · line 665
  • ATR (atr, ta.atr in v5)30patternLabelPosLow · line 680
  • ATR (atr, ta.atr in v5)30patternLabelPosHigh · line 681
  • CCI (cci, ta.cci in v5)Source (close), CCI Period (20)cci · line 1198
  • SMA / Stoch (sma, ta.sma in v5)stoch(cci, cci, cci, stoch_period), Stoch Smooth K (7)stoch_cci_k · line 1199
  • SMA (sma, ta.sma in v5)stoch_cci_k, Stoch Smooth D (3)stoch_cci_d · line 1200
  • Crossunder / Crossover (crossunder, ta.crossunder in v5)ma, Oversold (20)trend_enter · line 1202
  • Crossunder / Crossover (crossunder, ta.crossunder in v5)ma, Overbought (80)trend_exit · line 1210
  • RMA / Change (rma, ta.rma in v5)max(change(close), 0), 20up11 · line 1288
  • RMA / Change (rma, ta.rma in v5)-min(change(close), 0), 20down11 · line 1289
  • EMA (ema, ta.ema in v5)rsi11, 40emaRSI11 · line 1291
  • RSI (rsi, ta.rsi in v5)close, 14rsi55 · line 1292
  • SMA / Stoch (sma, ta.sma in v5)stoch(rsi55, rsi55, rsi55, 14), 3k55 · line 1293
  • SMA (sma, ta.sma in v5)k55, 3d55 · line 1294
  • RMA / Change (rma, ta.rma in v5)max(change(close), 0), 12up22 · line 1324
  • RMA / Change (rma, ta.rma in v5)-min(change(close), 0), 12down22 · line 1325
  • EMA (ema, ta.ema in v5)rsi22, 12emaRSI22 · line 1327
  • RSI (rsi, ta.rsi in v5)close, 14rsi33 · line 1328
  • SMA / Stoch (sma, ta.sma in v5)stoch(rsi33, rsi33, rsi33, 14), 3k33 · line 1329
  • SMA (sma, ta.sma in v5)k33, 3d33 · line 1330
  • Barssince / Crossover / Crossunder (barssince, ta.barssince in v5)crossover(k33,d33)StochRsiUpSignal · line 1333
  • Barssince / Crossunder / Crossover (barssince, ta.barssince in v5)crossunder(k33,d33)StochRsiDownSignal · line 1334
  • Barssince / Crossover / Crossunder (barssince, ta.barssince in v5)crossover(rsi22,emaRSI22)RsiMa1212UpSignal · line 1337
  • Barssince / Crossunder / Crossover (barssince, ta.barssince in v5)crossunder(rsi22,emaRSI22)RsiMa1212DownSignal · line 1338
  • CCI (cci, ta.cci in v5)close, 10cci4410 · line 1355
  • CCI (cci, ta.cci in v5)close, 20cci4420 · line 1356
  • EMA (ema, ta.ema in v5)cci4420, 5emacci4420 · line 1357
  • ATR (atr, ta.atr in v5)100atr2 · line 1376
  • Highestbars (highestbars, ta.highestbars in v5)amplitude22highPrice · line 1378
  • Lowestbars (lowestbars, ta.lowestbars in v5)amplitude22lowPrice · line 1379
  • SMA (sma, ta.sma in v5)high, amplitude22highma · line 1380
  • SMA (sma, ta.sma in v5)low, amplitude22lowma · line 1381
  • Barssince (barssince, ta.barssince in v5)buySignal55halfTrend · line 1417
  • RSI (rsi, ta.rsi in v5)close, 2rsi66 · line 1438
  • RSI (rsi, ta.rsi in v5)close[1], 2rsi661 · line 1473
  • CCI (cci, ta.cci in v5)close, 2cci66 · line 1440
  • CCI (cci, ta.cci in v5)close[0], 2cci07 · line 1444
  • CCI (cci, ta.cci in v5)close[1], 2cci17 · line 1445
  • CCI (cci, ta.cci in v5)close[2], 2cci27 · line 1446
  • EMA (ema, ta.ema in v5)cci07, 2maCCI · line 1447
  • CCI (cci, ta.cci in v5)close[0], 2rsi07 · line 1457
  • CCI (cci, ta.cci in v5)close[1], 2rsi17 · line 1458
  • CCI (cci, ta.cci in v5)close[2], 2rsi27 · line 1459
  • EMA (ema, ta.ema in v5)rsi07, 2maRSI · line 1460
  • RSI (rsi, ta.rsi in v5)close, 21rsi44 · line 1527
  • EMA / Stoch (ema, ta.ema in v5)stoch(rsi44, rsi44, rsi44, 21), 3k44 · line 1528
  • EMA (ema, ta.ema in v5)k44, 3d44 · line 1529

Signal flow

How price data and settings reach the orders. Each box is a name in the script, or several computed the same way; each arrow is a value one of them reads. Hover a box for its members.

The script has 429 named inputs, calculations, conditions and outputs, too many to draw legibly here; the tables above list them.

Order rules

OrderFires whenBy defaultLine
Open LONG longevery barOn1539
Open SHORT shortevery barOn1545
Close LONGExitLong() and not FinalLongSignal()On1550
Close SHORTExitShort() and not FinalShortSignal()On1556

Each order is guarded by the setting shown. “Off” orders never fire unless that setting is switched on.

Alerts

AlertCallMessageLine
(no title)alertEXIT-SHORT_BYBIT_LINKUSDT_mybybite-bot_10M_403d210eb46a9bd31535
(no title)alertENTER-LONG_BYBIT_LINKUSDT_mybybite-bot_10M_403d210eb46a9bd31536
(no title)alertEXIT-LONG_BYBIT_LINKUSDT_mybybite-bot_10M_403d210eb46a9bd31541
(no title)alertENTER-SHORT_BYBIT_LINKUSDT_mybybite-bot_10M_403d210eb46a9bd31542
(no title)alertEXIT-LONG_BYBIT_LINKUSDT_mybybite-bot_10M_403d210eb46a9bd31548
(no title)alertEXIT-SHORT_BYBIT_LINKUSDT_mybybite-bot_10M_403d210eb46a9bd31554

Does it repaint?

No

No repainting patterns in the source.

The live replay needs a run, and this script does not run in Zeal Terminal yet; the answer comes from the checks on the source alone.

  • ClearHigher-timeframe dataThe script requests no other symbol or timeframe.
  • ClearFuture-bar referencesNo negative history offsets such as close[-1].
  • ClearIntrabar recalculationNo varip, calc_on_every_tick or realtime-only state. Orders are decided once per closed bar.
  • ClearOrder timingOrders fill at the next bar's open, after the signal bar has closed.

The checks read the source; the replay runs it. Together they catch the common causes, not every possible one.

Similar scripts

Indicators and strategies built from the same calculations.

ScriptSharesTypeNetTradesMax drawdown
X48 - Strategy - BreakOut & Consecutive (11in1) + Alert - V.1.2 by X4815162342sma ema highest lowest stdev pivothigh pivotlow atr rma highestbars lowestbars rsiv5 strategydoes not run in Zeal Terminal
supertrend with multiple filter strategy by mathlabelsupertrend sma highest lowest ema cci atr stdev stoch pivothigh pivotlow wma rsiv5 strategydoes not run in Zeal Terminal
TICK Scalping strategy, SPY 1 min by PtGamblerrma ema wma sma pivotlow pivothigh rsi barssince lowest highestv5 strategyNo trades on this market
VXD Supercycle by Vvaz_supertrend ema sma pivothigh pivotlow highest lowest rsiv5 strategydoes not run in Zeal Terminal

Where it runs

EngineCompilesRunsMatches TradingView
Zeal Terminal · OpenPineScript v2No Pine Script v4 Error at @L607:C15: Undeclared identifier 'earnings'.Not measured
PineTSNo v5 and v6 only—Not measured

Zeal Terminal's engine currently reads an order side written as 1, 0 as a short, whatever it says; this page passes the same side as strategy.long or strategy.short (lines 1539, 1545) so the engine trades the way the script says.

“Matches TradingView” needs this script's own output exported from TradingView and compared bar by bar, which has not been done for this script. The engine is built on OpenPineScript, whose conformance results are in its conformance report. PineTS runs Pine Script v5 and v6 only.

Source

Copied verbatim from the author's published script, with its licence header intact. The author may have updated the original since this snapshot.

// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/// © ahhanegin//@version=4//study("Haeri")strategy("HAERI 𝐍𝐄𝐓𝐖𝐎𝐑𝐊", overlay=true, initial_capital=1000, default_qty_type=strategy.percent_of_equity, default_qty_value=15)price = plot(close, title="Close Line", color=color.blue, display=display.none)//////////////////////////////////////////////////////////////////////////////////TREND INDICATORS▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼//Trend EMAtttradetrend = "Only place BUY or SELL orders with the direction of the Trend EMA."tradetrendoption = input(false, title="Only Tade with Trend", tooltip=tttradetrend)len111 = input(defval=200, minval=0, maxval=2000, title="Trend EMA Length")src111 = closeout111 = ema(src111, len111)ma111  = plot(out111, title="EMA 200", linewidth=2, color=color.blue, offset=0)mabuy  = out111 > out111[1]masell = out111 < out111[1]//5 EMAs////////////////////////////////////////////////////////////////////////len1 = 9src1 = closeout1 = ema(src1, len1)ema1color = (out1 > out1[1] ? #00bcd4 : #e91e63)ema1 = plot(out1, title="EMA 9", linewidth=3, color=color.new(ema1color, 50), offset=0, display=display.none)fill(price, ema1, title="EMA 9 Fill", color=color.new(ema1color, 90), editable=true)len2 = 21src2 = closeout2 = ema(src2, len2)ema2color = (out2 > out2[1] ? #00bcd4 : #e91e63)ema2 = plot(out2, title="EMA 21", linewidth=3, color=color.new(ema2color, 50), offset=0, display=display.none)fill(price, ema2, title="EMA 21 Fill", color=color.new(ema2color, 90), editable=true)len3 = 55src3 = closeout3 = ema(src3, len3)ema3color = (out3 > out3[1] ? #00bcd4 : #e91e63)ema3 = plot(out3, title="EMA 55", linewidth=3, color=color.new(ema3color, 50), offset=0, display=display.none)fill(price, ema3, title="EMA 55 Fill", color=color.new(ema3color, 90), editable=true)len4 = 100src4 = closeout4 = ema(src4, len4)ema4color = (out4 > out4[1] ? #00bcd4 : #e91e63)ema4 = plot(out4, title="EMA 100", linewidth=3, color=color.new(ema4color, 50), offset=0, display=display.none)fill(price, ema4, title="EMA 100 Fill", color=color.new(ema4color, 90), editable=true)len5 = 200src5 = closeout5 = ema(src5, len5)ema5color = (out5 > out5[1] ? #00bcd4 : #e91e63)ema5 = plot(out5, title="EMA 200", linewidth=3, color=color.new(ema5color, 50), offset=0, display=display.none)fill(price, ema5, title="EMA 200 Fill", color=color.new(ema5color, 90), editable=true)//Supertrend////////////////////////////////////////////////////////////////////atrPeriod = 10factor = 3[supertrend, direction] = supertrend(factor, atrPeriod)bodyMiddle = plot((open + close) / 2, display=display.none, title="Body Middle Line")uptrend = direction < 0 and direction[1] > 0[1] ? supertrend : nadowntrend = direction > 0 and direction[1] < 0[1] ? supertrend : na//fill(bodyMiddle, upTrend, color.new(color.green, 90), fillgaps=false)//fill(bodyMiddle, downTrend, color.new(color.red, 90), fillgaps=false)//bullishsupertrend = supertrend < close and supertrend[1] > close//plotshape(uptrend, style=shape.labelup, color=color.green, location=location.belowbar, size=size.large)//HMA///////////////////////////////////////////////////////////////////////////len6 = 100src6 = closehma = wma(2*wma(src6, len6/2)-wma(src6, len6), floor(sqrt(len6)))hmacolor = close > hma ? #00bcd4 : #e91e63plot(hma, title="HMA Line", color=color.new(hmacolor, 25), linewidth=5)//Parabolic SAR/////////////////////////////////////////////////////////////////start = 0.02increment = 0.01maximum = 0.2psar = sar(start, increment, maximum)//plot(psar, "ParabolicSAR", style=plot.style_circles, color=#ffffff)//END▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲//////////////////////////////////////////////////////////////////////////////////MOMENTUM INCIDATORS▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼//RSI Divergence////////////////////////////////////////////////////////////////len11 = 14src11 = closelbR11 = 2lbL11 = 6rangeUpper11 = 60rangeLower11 = 5plotBull11 = trueplotHiddenBull11 = falseplotBear11 = trueplotHiddenBear11 = falsebearColor11 = color.redbullColor11 = color.greenhiddenBullColor11 = color.new(color.green, 80)hiddenBearColor11 = color.new(color.red, 80)textColor11 = color.whitenoneColor11 = color.new(color.white, 100)osc11 = rsi(src11, len11)//plot(osc11, title="RSI", linewidth=2, color=#2962FF)//hline(50, title="Middle Line", color=#787B86, linestyle=hline.style_dotted)//obLevel11 = hline(70, title="Overbought", color=#787B86, linestyle=hline.style_dotted)//osLevel11 = hline(30, title="Oversold", color=#787B86, linestyle=hline.style_dotted)//fill(obLevel11, osLevel11, title="Background", color=color.rgb(33, 150, 243, 90))plFound11 = na(pivotlow(osc11, lbL11, lbR11)) ? false : truephFound11 = na(pivothigh(osc11, lbL11, lbR11)) ? false : true_inRange11(cond) =>    bars11 = barssince(cond == true)    rangeLower11 <= bars11 and bars11 <= rangeUpper11//Regular Bullish Divergence//Osc: Higher LowoscHL11 = osc11[lbR11] > valuewhen(plFound11, osc11[lbR11], 1) and _inRange11(plFound11[1])//Price: Lower LowpriceLL11 = low[lbR11] < valuewhen(plFound11, low[lbR11], 1)bullCond11 = plotBull11 and priceLL11 and oscHL11 and plFound11//plot(plFound11 ? osc11[lbR11] : na, offset=-lbR11, title="Regular Bullish", linewidth=2, color=(bullCond11 ? bullColor11 : noneColor11))//plotshape(bullCond11 ? osc11[lbR11] : na, offset=-lbR11, title="Regular Bullish Label", text=" Bull ", style=shape.labelup, location=location.absolute, color=bullColor11, textcolor=textColor11)//Hidden Bullish Divergence//Osc: Lower LowoscLL11 = osc11[lbR11] < valuewhen(plFound11, osc11[lbR11], 1) and _inRange11(plFound11[1])//Price: Higher LowpriceHL11 = low[lbR11] > valuewhen(plFound11, low[lbR11], 1)hiddenBullCond11 = plotHiddenBull11 and priceHL11 and oscLL11 and plFound11//plot(plFound11 ? osc11[lbR11] : na, offset=-lbR11, title="Hidden Bullish", linewidth=2, color=(hiddenBullCond11 ? hiddenBullColor11 : noneColor11))//plotshape(hiddenBullCond11 ? osc11[lbR11] : na, offset=-lbR11, title="Hidden Bullish Label", text=" H Bull ", style=shape.labelup, location=location.absolute, color=bullColor11, textcolor=textColor11)     //Regular Bearish Divergence//Osc: Lower HighoscLH11 = osc11[lbR11] < valuewhen(phFound11, osc11[lbR11], 1) and _inRange11(phFound11[1])//Price: Higher HighpriceHH11 = high[lbR11] > valuewhen(phFound11, high[lbR11], 1)bearCond11 = plotBear11 and priceHH11 and oscLH11 and phFound11//plot(phFound11 ? osc11[lbR11] : na, offset=-lbR11, title="Regular Bearish", linewidth=2, color=(bearCond11 ? bearColor11 : noneColor11))//plotshape(bearCond11 ? osc11[lbR11] : na, offset=-lbR11, title="Regular Bearish Label", text=" Bear ", style=shape.labeldown, location=location.absolute, color=bearColor11, textcolor=textColor11)     //Hidden Bearish Divergence//Osc: Higher HighoscHH11 = osc11[lbR11] > valuewhen(phFound11, osc11[lbR11], 1) and _inRange11(phFound11[1])// Price: Lower HighpriceLH11 = high[lbR11] < valuewhen(phFound11, high[lbR11], 1)hiddenBearCond11 = plotHiddenBear11 and priceLH11 and oscHH11 and phFound11//plot(phFound11 ? osc11[lbR11] : na, offset=-lbR11, title="Hidden Bearish", linewidth=2, color=(hiddenBearCond11 ? hiddenBearColor11 : noneColor11))//plotshape(hiddenBearCond11 ? osc11[lbR11] : na, offset=-lbR11, title="Hidden Bearish Label", text=" H Bear ", style=shape.labeldown, location=location.absolute, color=bearColor11, textcolor=textColor11)//MACD Divergence///////////////////////////////////////////////////////////////fast_length12 = 12slow_length12 = 26src12 = closesignal_length12 = 9sma_source12 = "EMA"sma_signal12 = "EMA"//Plot colorscol_macd12 = #2962FFcol_signal12 = #FF6D00col_grow_above12 = #26A69Acol_fall_above12 = #B2DFDBcol_grow_below12 = #FFCDD2col_fall_below12 = #FF5252//Calculatingfast_ma12 = sma_source12 == "SMA" ? sma(src12, fast_length12) : ema(src12, fast_length12)slow_ma12 = sma_source12 == "SMA" ? sma(src12, slow_length12) : ema(src12, slow_length12)macd = fast_ma12 - slow_ma12signal = sma_signal12 == "SMA" ? sma(macd, signal_length12) : ema(macd, signal_length12)hist = macd - signal//plot(hist, title="Histogram", style=plot.style_columns, color=(hist>=0 ? (hist[1] < hist ? col_grow_above12 : col_fall_above12) : (hist[1] < hist ? col_grow_below12 : col_fall_below12)))//plot(macd, title="MACD", color=col_macd12)//plot(signal, title="Signal", color=col_signal12)donttouchzero12 = truelbR12 = 2lbL12 = 6rangeUpper12 = 60rangeLower12 = 5plotBull12 = trueplotHiddenBull12 = falseplotBear12 = trueplotHiddenBear12 = falsebearColor12 = color.redbullColor12 = color.greenhiddenBullColor12 = color.new(color.green, 80)hiddenBearColor12 = color.new(color.red, 80)textColor12 = color.whitenoneColor12 = color.new(color.white, 100)osc12 = macdplFound12 = na(pivotlow(osc12, lbL12, lbR12)) ? false : truephFound12 = na(pivothigh(osc12, lbL12, lbR12)) ? false : true_inRange12(cond) =>    bars12 = barssince(cond == true)    rangeLower12 <= bars12 and bars12 <= rangeUpper12    //Regular Bullish Divergence//Osc: Higher LowoscHL12 = osc12[lbR12] > valuewhen(plFound12, osc12[lbR12], 1) and _inRange12(plFound12[1]) and  osc12[lbR12] < 0// Price: Lower LowpriceLL12 = low[lbR12] < valuewhen(plFound12, low[lbR12], 1)priceHHZero12 =  highest(osc12, lbL12+lbR12+5) //plot(priceHHZero,title="priceHHZero",color=color.green)blowzero12 = donttouchzero12 ? priceHHZero12 < 0 : truebullCond12 = plotBull12 and priceLL12 and oscHL12 and plFound12 and blowzero12//plot(plFound12 ? osc12[lbR12] : na, offset=-lbR12, title="Regular Bullish", linewidth=2, color=(bullCond12 ? bullColor12 : noneColor12))//plotshape(bullCond12 ? osc12[lbR12] : na, offset=-lbR12, title="Regular Bullish Label", text=" Bull ", style=shape.labelup, location=location.absolute, color=bullColor12, textcolor=textColor12)     //Hidden Bullish Divergence//Osc: Lower LowoscLL12 = osc12[lbR12] < valuewhen(plFound12, osc12[lbR12], 1) and _inRange12(plFound12[1])//Price: Higher LowpriceHL12 = low[lbR12] > valuewhen(plFound12, low[lbR12], 1)hiddenBullCond12 = plotHiddenBull12 and priceHL12 and oscLL12 and plFound12//plot(plFound12 ? osc12[lbR12] : na, offset=-lbR12, title="Hidden Bullish", linewidth=2, color=(hiddenBullCond12 ? hiddenBullColor12 : noneColor12))//plotshape(hiddenBullCond12 ? osc12[lbR12] : na, offset=-lbR12, title="Hidden Bullish Label", text=" H Bull ", style=shape.labelup, location=location.absolute, color=bullColor12, textcolor=textColor12)     //Regular Bearish Divergence//Osc: Lower HighoscLH12 = osc12[lbR12] < valuewhen(phFound12, osc12[lbR12], 1) and _inRange12(phFound12[1])  and osc12[lbR12] > 0priceLLZero12 =  lowest(osc12, lbL12+lbR12+5) //plot(priceLLZero,title="priceLLZero", color=color.red)bearzero12 = donttouchzero12 ? priceLLZero12 > 0 : true//Price: Higher HighpriceHH12 = high[lbR12] > valuewhen(phFound12, high[lbR12], 1)bearCond12 = plotBear12 and priceHH12 and oscLH12 and phFound12 and bearzero12//plot(phFound12 ? osc12[lbR12] : na, offset=-lbR12, title="Regular Bearish", linewidth=2, color=(bearCond12 ? bearColor12 : noneColor12))//plotshape(bearCond12 ? osc12[lbR12] : na, offset=-lbR12, title="Regular Bearish Label", text=" Bear ", style=shape.labeldown, location=location.absolute, color=bearColor12, textcolor=textColor12)     //Hidden Bearish Divergence//Osc: Higher HighoscHH12 = osc12[lbR12] > valuewhen(phFound12, osc12[lbR12], 1) and _inRange12(phFound12[1])//Price: Lower HighpriceLH12 = high[lbR12] < valuewhen(phFound12, high[lbR12], 1)hiddenBearCond12 = plotHiddenBear12 and priceLH12 and oscHH12 and phFound12//plot(phFound12 ? osc12[lbR12] : na, offset=-lbR12, title="Hidden Bearish", linewidth=2, color=(hiddenBearCond12 ? hiddenBearColor12 : noneColor12))//plotshape(hiddenBearCond12 ? osc12[lbR12] : na, offset=-lbR12, title="Hidden Bearish Label", text=" H Bear ", style=shape.labeldown, location=location.absolute, color=bearColor12, textcolor=textColor12)          //Wave Trend Divergence/////////////////////////////////////////////////////////n1 = 9n2 = 12ap = hlc3 esa = ema(ap, n1)d1 = ema(abs(ap - esa), n1)ci = (ap - esa) / (0.015 * d1)tci = ema(ci, n2)hline = 0wt1 = tciwt2 = sma(wt1, 4)//plot(hline, color=color.gray)//plot(wt1, color=color.white)//plot(wt2, color=color.blue)//DivergencelbR13 = 2lbL13 = 6rangeUpper13 = 60rangeLower13 = 5plotBull13 = trueplotHiddenBull13 = falseplotBear13 = trueplotHiddenBear13 = falsebearColor13 = color.redbullColor13 = color.greenhiddenBullColor13 = color.greenhiddenBearColor13 = color.redtextColor13 = color.whitenoneColor13 = color.new(color.white, 100)k13 = wt1d13 = wt2osc13 = k13plFound13 = na(pivotlow(osc13, lbL13, lbR13)) ? false : truephFound13 = na(pivothigh(osc13, lbL13, lbR13)) ? false : true_inRange13(cond) =>    bars13 = barssince(cond == true)    rangeLower13 <= bars13 and bars13 <= rangeUpper13//Regular Bullish//Osc: Higher LowoscHL13 = osc13[lbR13] > valuewhen(plFound13, osc13[lbR13], 1) and _inRange13(plFound13[1])//Price: Lower LowpriceLL13 = low[lbR13] < valuewhen(plFound13, low[lbR13], 1)bullCond13 = plotBull13 and priceLL13 and oscHL13 and plFound13//plot(plFound13 ? osc13[lbR13] : na, offset=-lbR13, title="Regular Bullish", linewidth=2, color=(bullCond13 ? bullColor13 : noneColor13))//plotshape(bullCond13 ? osc13[lbR13] : na, offset=-lbR13, title="Regular Bullish Label", text=" Bull ", style=shape.labelup, location=location.absolute, color=bullColor13, textcolor=textColor13)//Hidden Bullish//Osc: Lower LowoscLL13 = osc13[lbR13] < valuewhen(plFound13, osc13[lbR13], 1) and _inRange13(plFound13[1])//Price: Higher LowpriceHL13 = low[lbR13] > valuewhen(plFound13, low[lbR13], 1)hiddenBullCond13 = plotHiddenBull13 and priceHL13 and oscLL13 and plFound13//plot(plFound13 ? osc13[lbR13] : na, offset=-lbR13, title="Hidden Bullish", linewidth=2, color=(hiddenBullCond13 ? hiddenBullColor13 : noneColor13))//plotshape(hiddenBullCond13 ? osc13[lbR13] : na, offset=-lbR13, title="Hidden Bullish Label", text=" H Bull ", style=shape.labelup, location=location.absolute, color=bullColor13, textcolor=textColor13)     //Regular Bearish//Osc: Lower HighoscLH13 = osc13[lbR13] < valuewhen(phFound13, osc13[lbR13], 1) and _inRange13(phFound13[1])//Price: Higher HighpriceHH13 = high[lbR13] > valuewhen(phFound13, high[lbR13], 1)bearCond13 = plotBear13 and priceHH13 and oscLH13 and phFound13//plot(phFound13 ? osc13[lbR13] : na, offset=-lbR13, title="Regular Bearish", linewidth=2, color=(bearCond13 ? bearColor13 : noneColor13))//plotshape(bearCond13 ? osc13[lbR13] : na, offset=-lbR13, title="Regular Bearish Label", text=" Bear ", style=shape.labeldown, location=location.absolute, color=bearColor13, textcolor=textColor13)//Hidden Bearish//Osc: Higher HighoscHH13 = osc13[lbR13] > valuewhen(phFound13, osc13[lbR13], 1) and _inRange13(phFound13[1])//Price: Lower HighpriceLH13 = high[lbR13] < valuewhen(phFound13, high[lbR13], 1)hiddenBearCond13 = plotHiddenBear13 and priceLH13 and oscHH13 and phFound13//plot(phFound13 ? osc13[lbR13] : na, offset=-lbR13, title="Hidden Bearish", linewidth=2, color=(hiddenBearCond13 ? hiddenBearColor13 : noneColor13))//plotshape(hiddenBearCond13 ? osc13[lbR13] : na, offset=-lbR13, title="Hidden Bearish Label", text=" H Bear ", style=shape.labeldown, location=location.absolute, color=bearColor13, textcolor=textColor13)//Stochastic Divergence/////////////////////////////////////////////////////////periodK14 = 14smoothK14 = 3periodD14 = 3k14 = sma(stoch(close, high, low, periodK14), smoothK14)d14 = sma(k14, periodD14)//plot(k14, title="%K", color=#2962FF)//plot(d14, title="%D", color=#FF6D00)//h0 = hline(80, "Upper Band", color=#787B86)//h1 = hline(20, "Lower Band", color=#787B86)//fill(h0, h1, color=color.rgb(33, 150, 243, 90), title="Background")//DivergencelbR14 = 2lbL14 = 6rangeUpper14 = 60rangeLower14 = 5plotBull14 = trueplotHiddenBull14 = falseplotBear14 = trueplotHiddenBear14 = falsebearColor14 = color.redbullColor14 = color.greenhiddenBullColor14 = color.greenhiddenBearColor14 = color.redtextColor14 = color.whitenoneColor14 = color.new(color.white, 100)osc14 = k14plFound14 = na(pivotlow(osc14, lbL14, lbR14)) ? false : truephFound14 = na(pivothigh(osc14, lbL14, lbR14)) ? false : true_inRange14(cond) =>    bars14 = barssince(cond == true)    rangeLower14 <= bars14 and bars14 <= rangeUpper14//Regular Bullish//Osc: Higher LowoscHL14 = osc14[lbR14] > valuewhen(plFound14, osc14[lbR14], 1) and _inRange14(plFound14[1])//Price: Lower LowpriceLL14 = low[lbR14] < valuewhen(plFound14, low[lbR14], 1)bullCond14 = plotBull14 and priceLL14 and oscHL14 and plFound14//plot(plFound14 ? osc14[lbR14] : na, offset=-lbR14, title="Regular Bullish", linewidth=2, color=(bullCond14 ? bullColor14 : noneColor14))//plotshape(bullCond14 ? osc14[lbR14] : na, offset=-lbR14, title="Regular Bullish Label", text=" Bull ", style=shape.labelup, location=location.absolute, color=bullColor14, textcolor=textColor14)//Hidden Bullish//Osc: Lower LowoscLL14 = osc14[lbR14] < valuewhen(plFound14, osc14[lbR14], 1) and _inRange14(plFound14[1])//Price: Higher LowpriceHL14 = low[lbR14] > valuewhen(plFound14, low[lbR14], 1)hiddenBullCond14 = plotHiddenBull14 and priceHL14 and oscLL14 and plFound14//plot(plFound14 ? osc14[lbR14] : na, offset=-lbR14, title="Hidden Bullish", linewidth=2, color=(hiddenBullCond14 ? hiddenBullColor14 : noneColor14))//plotshape(hiddenBullCond14 ? osc14[lbR14] : na, offset=-lbR14, title="Hidden Bullish Label", text=" H Bull ", style=shape.labelup, location=location.absolute, color=bullColor14, textcolor=textColor14)//Regular Bearish//Osc: Lower HighoscLH14 = osc14[lbR14] < valuewhen(phFound14, osc14[lbR14], 1) and _inRange14(phFound14[1])//Price: Higher HighpriceHH14 = high[lbR14] > valuewhen(phFound14, high[lbR14], 1)bearCond14 = plotBear14 and priceHH14 and oscLH14 and phFound14//plot(phFound14 ? osc14[lbR14] : na, offset=-lbR14, title="Regular Bearish", linewidth=2, color=(bearCond14 ? bearColor14 : noneColor14))//plotshape(bearCond14 ? osc14[lbR14] : na, offset=-lbR14, title="Regular Bearish Label", text=" Bear ", style=shape.labeldown, location=location.absolute, color=bearColor14, textcolor=textColor14)     //Hidden Bearish//Osc: Higher HighoscHH14 = osc14[lbR14] > valuewhen(phFound14, osc14[lbR14], 1) and _inRange14(phFound14[1])//Price: Lower HighpriceLH14 = high[lbR14] < valuewhen(phFound14, high[lbR14], 1)hiddenBearCond14 = plotHiddenBear14 and priceLH14 and oscHH14 and phFound14//plot(phFound14 ? osc14[lbR14] : na, offset=-lbR14, title="Hidden Bearish", linewidth=2, color=(hiddenBearCond14 ? hiddenBearColor14 : noneColor14))//plotshape(hiddenBearCond14 ? osc14[lbR14] : na, offset=-lbR14, title="Hidden Bearish Label", text=" H Bear ", style=shape.labeldown, location=location.absolute, color=bearColor14, textcolor=textColor14)//END▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲//////////////////////////////////////////////////////////////////////////////////VOLATILITY INDICATORS▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼//Bollinger Bands///////////////////////////////////////////////////////////////length1 = 20src7 = closemult1 = 2.0basis = sma(src7, length1)dev = mult1 * stdev(src7, length1)upper = basis + devlower = basis - devoffset = 0//plot(basis, "Basis", color=#FF6D00, offset = offset)//p1 = plot(upper, "Upper", color=#2962FF, offset = 0)//p2 = plot(lower, "Lower", color=#2962FF, offset = 0)//fill(p1, p2, title = "Background", color=color.rgb(33, 150, 243, 95))//Average True Range /////////////////////////////////////////////////length2 = 1mult2 = 1.85showLabels = trueuseClose = falsehighlightState = falseatr = mult2 * atr(length2)longStop = (useClose ? highest(close, length2) : highest(length2)) - atrlongStopPrev = nz(longStop[1], longStop) longStop := close[1] > longStopPrev ? max(longStop, longStopPrev) : longStopshortStop = (useClose ? lowest(close, length2) : lowest(length2)) + atrshortStopPrev = nz(shortStop[1], shortStop)shortStop := close[1] < shortStopPrev ? min(shortStop, shortStopPrev) : shortStopvar int dir = 1dir := close > shortStopPrev ? 1 : close < longStopPrev ? -1 : dirvar color longColor = color.greenvar color shortColor = color.redbuySignal = dir == 1 and dir[1] == -1//plotshape(buySignal and showLabels ? longStop : na, title="Gold Buy", text="Buy", location=location.belowbar, style=shape.labelup, size=size.tiny, color=longColor, textcolor=color.new(color.white, 0))sellSignal = dir == -1 and dir[1] == 1//plotshape(sellSignal and showLabels ? shortStop : na, title="Gold Sell", text="Sell", location=location.abovebar, style=shape.labeldown, size=size.tiny, color=shortColor, textcolor=color.new(color.white, 0))//Relative Volatility Index Divergence//////////////////////////////////////////length15 = 12src15 = closelen15 = 14stddev15 = stdev(src15, length15)upper15 = ema(change(src15) <= 0 ? 0 : stddev15, len15)lower15 = ema(change(src15) > 0 ? 0 : stddev15, len15)rvi = upper15 / (upper15 + lower15) * 100//h0 = hline(80, "Upper Band", color=#787B86)//h1 = hline(20, "Lower Band", color=#787B86)//fill(h0, h1, color=color.rgb(126, 87, 194, 90), title="Background")//plot(rvi15, title="RVI", color=#7E57C2, offset = offset)//DivergencelbR15 = 2lbL15 = 6rangeUpper15 = 60rangeLower15 = 5plotBull15 = trueplotHiddenBull15 = falseplotBear15 = trueplotHiddenBear15 = falsebearColor15 = color.redbullColor15 = color.greenhiddenBullColor15 = color.greenhiddenBearColor15 = color.redtextColor15 = color.whitenoneColor15 = color.new(color.white, 100)d15 = rviosc15 = d15plFound15 = na(pivotlow(osc15, lbL15, lbR15)) ? false : truephFound15 = na(pivothigh(osc15, lbL15, lbR15)) ? false : true_inRange15(cond) =>    bars15 = barssince(cond == true)    rangeLower15 <= bars15 and bars15 <= rangeUpper15//Regular Bullish//Osc: Higher LowoscHL15 = osc15[lbR15] > valuewhen(plFound15, osc15[lbR15], 1) and _inRange15(plFound15[1])//Price: Lower LowpriceLL15 = low[lbR15] < valuewhen(plFound15, low[lbR15], 1)bullCond15 = plotBull15 and priceLL15 and oscHL15 and plFound15//plot(plFound15 ? osc15[lbR15] : na, offset=-lbR15, title="Regular Bullish", linewidth=2, color=(bullCond15 ? bullColor15 : noneColor15))//plotshape(bullCond15 ? osc15[lbR15] : na, offset=-lbR15, title="Regular Bullish Label", text=" Bull ", style=shape.labelup, location=location.absolute, color=bullColor15, textcolor=textColor15)//Hidden Bullish//Osc: Lower LowoscLL15 = osc15[lbR15] < valuewhen(plFound15, osc15[lbR15], 1) and _inRange15(plFound15[1])//Price: Higher LowpriceHL15 = low[lbR15] > valuewhen(plFound15, low[lbR15], 1)hiddenBullCond15 = plotHiddenBull15 and priceHL15 and oscLL15 and plFound15//plot(plFound15 ? osc15[lbR15] : na, offset=-lbR15, title="Hidden Bullish", linewidth=2, color=(hiddenBullCond15 ? hiddenBullColor15 : noneColor15))//plotshape(hiddenBullCond15 ? osc15[lbR15] : na, offset=-lbR15, title="Hidden Bullish Label", text=" H Bull ", style=shape.labelup, location=location.absolute, color=bullColor15, textcolor=textColor15)     //Regular Bearish//Osc: Lower HighoscLH15 = osc15[lbR15] < valuewhen(phFound15, osc15[lbR15], 1) and _inRange15(phFound15[1])//Price: Higher HighpriceHH15 = high[lbR15] > valuewhen(phFound15, high[lbR15], 1)bearCond15 = plotBear15 and priceHH15 and oscLH15 and phFound15//plot(phFound15 ? osc15[lbR15] : na, offset=-lbR15, title="Regular Bearish", linewidth=2, color=(bearCond15 ? bearColor15 : noneColor15))//plotshape(bearCond15 ? osc15[lbR15] : na, offset=-lbR15, title="Regular Bearish Label", text=" Bear ", style=shape.labeldown, location=location.absolute, color=bearColor15, textcolor=textColor15)//Hidden Bearish//Osc: Higher HighoscHH15 = osc15[lbR15] > valuewhen(phFound15, osc15[lbR15], 1) and _inRange15(phFound15[1])//Price: Lower HighpriceLH15 = high[lbR15] < valuewhen(phFound15, high[lbR15], 1)hiddenBearCond15 = plotHiddenBear15 and priceLH15 and oscHH15 and phFound15//plot(phFound15 ? osc15[lbR15] : na, offset=-lbR15, title="Hidden Bearish", linewidth=2, color=(hiddenBearCond15 ? hiddenBearColor15 : noneColor15))//plotshape(hiddenBearCond15 ? osc15[lbR15] : na, offset=-lbR15, title="Hidden Bearish Label", text=" H Bear ", style=shape.labeldown, location=location.absolute, color=bearColor15, textcolor=textColor15)//Support and Resistance////////////////////////////////////////////////////////left16 = 200right16 = 20quick_right16 = 5src16 = "Close"pivot_high16 = iff(src16=="Close",pivothigh(close,left16,right16),pivothigh(high,left16,right16))pivot_lows16 = iff(src16=="Close",pivotlow(close, left16,right16),pivotlow(low,left16,right16))quick_pivot_high16 = iff(src16=="Close",pivothigh(close,left16,quick_right16),pivothigh(high,left16,quick_right16))quick_pivot_lows16 = iff(src16=="Close",pivotlow(close, left16,quick_right16),pivotlow(low, left16,quick_right16))level1 = iff(src16=="Close",valuewhen(quick_pivot_high16, close[quick_right16], 0),valuewhen(quick_pivot_high16, high[quick_right16], 0))level2 = iff(src16=="Close",valuewhen(quick_pivot_lows16, close[quick_right16], 0),valuewhen(quick_pivot_lows16, low[quick_right16], 0))level3 = iff(src16=="Close",valuewhen(pivot_high16, close[right16], 0),valuewhen(pivot_high16, high[right16], 0))level4 = iff(src16=="Close",valuewhen(pivot_lows16, close[right16], 0),valuewhen(pivot_lows16, low[right16], 0))level5 = iff(src16=="Close",valuewhen(pivot_high16, close[right16], 1),valuewhen(pivot_high16, high[right16], 1))level6 = iff(src16=="Close",valuewhen(pivot_lows16, close[right16], 1),valuewhen(pivot_lows16, low[right16], 1))level7 = iff(src16=="Close",valuewhen(pivot_high16, close[right16], 2),valuewhen(pivot_high16, high[right16], 2))level8 = iff(src16=="Close",valuewhen(pivot_lows16, close[right16], 2),valuewhen(pivot_lows16, low[right16], 2))level1_col = close >= level1 ? color.green : color.redlevel2_col = close >= level2 ? color.green : color.redlevel3_col = close >= level3 ? color.green : color.redlevel4_col = close >= level4 ? color.green : color.redlevel5_col = close >= level5 ? color.green : color.redlevel6_col = close >= level6 ? color.green : color.redlevel7_col = close >= level7 ? color.green : color.redlevel8_col = close >= level8 ? color.green : color.redlength17 = 9src17 = closehma17 = wma(2*wma(src17, length17/2)-wma(src17, length17), floor(sqrt(length17)))buy1 = hma17 > level1 and hma17[1] < level1[1] and close > close[2]buy2 = hma17 > level2 and hma17[1] < level2[1] and close > close[2]buy3 = hma17 > level3 and hma17[1] < level3[1] and close > close[2]buy4 = hma17 > level4 and hma17[1] < level4[1] and close > close[2]buy5 = hma17 > level5 and hma17[1] < level5[1] and close > close[2]buy6 = hma17 > level6 and hma17[1] < level6[1] and close > close[2]buy7 = hma17 > level7 and hma17[1] < level7[1] and close > close[2]buy8 = hma17 > level8 and hma17[1] < level8[1] and close > close[2]sell1 = hma17 < level1 and hma17[1] > level1[1] and close < close[2]sell2 = hma17 < level2 and hma17[1] > level2[1] and close < close[2]sell3 = hma17 < level3 and hma17[1] > level3[1] and close < close[2]sell4 = hma17 < level4 and hma17[1] > level4[1] and close < close[2]sell5 = hma17 < level5 and hma17[1] > level5[1] and close < close[2]sell6 = hma17 < level6 and hma17[1] > level6[1] and close < close[2]sell7 = hma17 < level7 and hma17[1] > level7[1] and close < close[2]sell8 = hma17 < level8 and hma17[1] > level8[1] and close < close[2]//END▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲//////////////////////////////////////////////////////////////////////////////////VOLUME INDICATORS▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼//OBV Divergence////////////////////////////////////////////////////////////////len18 = 20src18 = closelbR18 = 2lbL18 = 6rangeUpper18 = 60rangeLower18 = 5plotBull18 = trueplotHiddenBull18 = falseplotBear18 = trueplotHiddenBear18 = falsebearColor18 = color.redbullColor18 = color.greenhiddenBullColor18 = color.greenhiddenBearColor18 = color.new(color.red, 80)textColor18 = color.whitenoneColor18 = color.new(color.white, 100)csrc = change(src18)obv1(src18) => cum(change(src18) > 0 ? volume : csrc < 0 ? -volume : 0*volume)os = obv1(src18)obv_osc = (os - ema(os,len18))obc_color=obv_osc > 0 ? color.green : color.red//plot(obv_osc, color=obc_color, style=plot.style_line,title="OBV-Points", linewidth=2)//plot(obv_osc, color=color.silver, transp=70, title="OBV", style=plot.style_area)//hline(0)plFound18 = na(pivotlow(obv_osc, lbL18, lbR18)) ? false : truephFound18 = na(pivothigh(obv_osc, lbL18, lbR18)) ? false : true_inRange(cond) =>    bars = barssince(cond == true)    rangeLower18 <= bars and bars <= rangeUpper18// Regular Bullish// Osc: Higher LowoscHL18 = obv_osc[lbR18] > valuewhen(plFound18, obv_osc[lbR18], 1) and _inRange(plFound18[1])// Price: Lower LowpriceLL18 = low[lbR18] < valuewhen(plFound18, low[lbR18], 1)bullCond18 = plotBull18 and priceLL18 and oscHL18 and plFound18//plot(plFound18 ? obv_osc[lbR18] : na,offset=-lbR18,title="Regular Bullish",linewidth=2,color=(bullCond18 ? bullColor18 : noneColor18))//plotshape(bullCond18 ? obv_osc[lbR18] : na,offset=-lbR18,title="Regular Bullish Label",text=" Bull ",style=shape.labelup,location=location.absolute,color=bullColor18,textcolor=textColor18)// Hidden Bullish// Osc: Lower LowoscLL18 = obv_osc[lbR18] < valuewhen(plFound18, obv_osc[lbR18], 1) and _inRange(plFound18[1])// Price: Higher LowpriceHL18 = low[lbR18] > valuewhen(plFound18, low[lbR18], 1)hiddenBullCond18 = plotHiddenBull18 and priceHL18 and oscLL18 and plFound18//plot(plFound18 ? obv_osc[lbR18] : na,offset=-lbR18,title="Hidden Bullish",linewidth=2,color=(hiddenBullCond18 ? hiddenBullColor18 : noneColor18))//plotshape(hiddenBullCond18 ? obv_osc[lbR18] : na,offset=-lbR18,title="Hidden Bullish Label",text=" H Bull ",style=shape.labelup,location=location.absolute,color=bullColor18,textcolor=textColor18)// Regular Bearish// Osc: Lower HighoscLH18 = obv_osc[lbR18] < valuewhen(phFound18, obv_osc[lbR18], 1) and _inRange(phFound18[1])// Price: Higher HighpriceHH18 = high[lbR18] > valuewhen(phFound18, high[lbR18], 1)bearCond18 = plotBear18 and priceHH18 and oscLH18 and phFound18//plot(phFound18 ? obv_osc[lbR18] : na,offset=-lbR18,title="Regular Bearish",linewidth=2,color=(bearCond18 ? bearColor18 : noneColor18))//plotshape(bearCond18 ? obv_osc[lbR18] : na,offset=-lbR18,title="Regular Bearish Label",text=" Bear ",style=shape.labeldown,location=location.absolute,color=bearColor18,textcolor=textColor18)// Hidden Bearish// Osc: Higher HighoscHH18 = obv_osc[lbR18] > valuewhen(phFound18, obv_osc[lbR18], 1) and _inRange(phFound18[1])// Price: Lower HighpriceLH18 = high[lbR18] < valuewhen(phFound18, high[lbR18], 1)hiddenBearCond18 = plotHiddenBear18 and priceLH18 and oscHH18 and phFound18//plot(phFound18 ? obv_osc[lbR18] : na,offset=-lbR18,title="Hidden Bearish",linewidth=2,color=(hiddenBearCond18 ? hiddenBearColor18 : noneColor18))//plotshape(hiddenBearCond18 ? obv_osc[lbR18] : na,offset=-lbR18,title="Hidden Bearish Label",text=" H Bear ",style=shape.labeldown,location=location.absolute,color=bearColor18,textcolor=textColor18)//Chaikin Money Flow////////////////////////////////////////////////////////////length19 = 50ad19 = close==high and close==low or high==low ? 0 : ((2*close-low-high)/(high-low))*volumecmf = sum(ad19, length19) / sum(volume, length19)//plot(cmf, color=#43A047, title="MF")//hline(0, color=#787B86, title="Zero", linestyle=hline.style_dashed)//VWAP//////////////////////////////////////////////////////////////////////////computeVWAP(src20, isNewPeriod, stDevMultiplier) =>    var float sumSrcVol = na    var float sumVol = na    var float sumSrcSrcVol = na        sumSrcVol := isNewPeriod ? src20 * volume : src20 * volume + sumSrcVol[1]    sumVol := isNewPeriod ? volume : volume + sumVol[1]    // sumSrcSrcVol calculates the dividend of the equation that is later used to calculate the standard deviation    sumSrcSrcVol := isNewPeriod ? volume * pow(src20, 2) : volume * pow(src20, 2) + sumSrcSrcVol[1]        _vwap = sumSrcVol / sumVol    variance = sumSrcSrcVol / sumVol - pow(_vwap, 2)    variance := variance < 0 ? 0 : variance    stDev = sqrt(variance)        lowerBand20 = _vwap - stDev * stDevMultiplier    upperBand20 = _vwap + stDev * stDevMultiplier        [_vwap, lowerBand20, upperBand20]hideonDWM = falsevar anchor = "Session"src20 = hlc3offset20 = 0showBands = truestdevMult = 1.0timeChange(period) =>    change(time(period))new_earnings = earnings(syminfo.tickerid, earnings.actual, barmerge.gaps_on, barmerge.lookahead_on)new_dividends = dividends(syminfo.tickerid, dividends.gross, barmerge.gaps_on, barmerge.lookahead_on)new_split = splits(syminfo.tickerid, splits.denominator, barmerge.gaps_on, barmerge.lookahead_on)tcD = timeChange("D")tcW = timeChange("W")tcM = timeChange("M")tc3M = timeChange("3M")tc12M = timeChange("12M")isNewPeriod = anchor == "Earnings" ? new_earnings : anchor == "Dividends" ? new_dividends : anchor == "Splits" ? new_split : na(src20[1]) ? true : anchor == "Session" ? tcD : anchor == "Week" ? tcW : anchor == "Month" ? tcM : anchor == "Quarter" ? tc3M : anchor == "Year" ? tc12M : anchor == "Decade" ? tc12M and year % 10 == 0 : anchor == "Century" ? tc12M and year % 100 == 0 : false    float vwapValue = nafloat std = nafloat upperBandValue = nafloat lowerBandValue = naif not (hideonDWM and timeframe.isdwm)    [_vwap, bottom, top] = computeVWAP(src20, isNewPeriod, stdevMult)    vwapValue := _vwap    upperBandValue := showBands ? top : na    lowerBandValue := showBands ? bottom : na//plot(vwapValue, title="VWAP", color=#2962FF, offset=offset)//upperBand20 = plot(upperBandValue, title="Upper Band", color=color.green, offset=offset)//lowerBand20 = plot(lowerBandValue, title="Lower Band", color=color.green, offset=offset)//fill(upperBand20, lowerBand20, title="Bands Fill", color= showBands ? color.new(color.green, 95) : na)//Candle Patterns/////////////////////////////////////////////////////////////////Bullish EngulfingC_DownTrend = trueC_UpTrend = truevar trendRule1 = "SMA50"var trendRule2 = "SMA50, SMA200"var trendRule = trendRule1if trendRule == trendRule1    priceAvg = sma(close, 50)    C_DownTrend := close < priceAvg    C_UpTrend := close > priceAvgif trendRule == trendRule2    sma200 = sma(close, 200)    sma50 = sma(close, 50)    C_DownTrend := close < sma50 and sma50 < sma200    C_UpTrend := close > sma50 and sma50 > sma200C_Len = 14 // ema depth for bodyAvgC_ShadowPercent = 5.0 // size of shadowsC_ShadowEqualsPercent = 100.0C_DojiBodyPercent = 5.0C_Factor = 2.0 // shows the number of times the shadow dominates the candlestick bodyC_BodyHi = max(close, open)C_BodyLo = min(close, open)C_Body = C_BodyHi - C_BodyLoC_BodyAvg = ema(C_Body, C_Len)C_SmallBody = C_Body < C_BodyAvgC_LongBody = C_Body > C_BodyAvgC_UpShadow = high - C_BodyHiC_DnShadow = C_BodyLo - lowC_HasUpShadow = C_UpShadow > C_ShadowPercent / 100 * C_BodyC_HasDnShadow = C_DnShadow > C_ShadowPercent / 100 * C_BodyC_WhiteBody = open < closeC_BlackBody = open > closeC_Range = high-lowC_IsInsideBar = C_BodyHi[1] > C_BodyHi and C_BodyLo[1] < C_BodyLoC_BodyMiddle = C_Body / 2 + C_BodyLoC_ShadowEquals = C_UpShadow == C_DnShadow or (abs(C_UpShadow - C_DnShadow) / C_DnShadow * 100) < C_ShadowEqualsPercent and (abs(C_DnShadow - C_UpShadow) / C_UpShadow * 100) < C_ShadowEqualsPercentC_IsDojiBody = C_Range > 0 and C_Body <= C_Range * C_DojiBodyPercent / 100C_Doji = C_IsDojiBody and C_ShadowEqualspatternLabelPosLow = low - (atr(30) * 0.6)patternLabelPosHigh = high + (atr(30) * 0.6)label_color_bullish = color.blueC_EngulfingBullishNumberOfCandles = 2C_EngulfingBullish = C_DownTrend and C_WhiteBody and C_LongBody and C_BlackBody[1] and C_SmallBody[1] and close >= open[1] and open <= close[1] and ( close > open[1] or open < close[1] )if C_EngulfingBullish    var ttBullishEngulfing = "Engulfing\nAt the end of a given downward trend, there will most likely be a reversal pattern. To distinguish the first day, this candlestick pattern uses a small body, followed by a day where the candle body fully overtakes the body from the day before, and closes in the trend’s opposite direction. Although similar to the outside reversal chart pattern, it is not essential for this pattern to completely overtake the range (high to low), rather only the open and the close."    //label.new(bar_index, patternLabelPosLow, text="BE", style=label.style_label_up, color = label_color_bullish, textcolor=color.white, tooltip = ttBullishEngulfing)//bgcolor(highest(C_EngulfingBullish?1:0, C_EngulfingBullishNumberOfCandles)!=0 ? color.blue : na, offset=-(C_EngulfingBullishNumberOfCandles-1))//Bearish Engulfinglabel_color_bearish = color.redC_EngulfingBearishNumberOfCandles = 2C_EngulfingBearish = C_UpTrend and C_BlackBody and C_LongBody and C_WhiteBody[1] and C_SmallBody[1] and close <= open[1] and open >= close[1] and ( close < open[1] or open > close[1] )if C_EngulfingBearish    var ttBearishEngulfing = "Engulfing\nAt the end of a given uptrend, a reversal pattern will most likely appear. During the first day, this candlestick pattern uses a small body. It is then followed by a day where the candle body fully overtakes the body from the day before it and closes in the trend’s opposite direction. Although similar to the outside reversal chart pattern, it is not essential for this pattern to fully overtake the range (high to low), rather only the open and the close."    //label.new(bar_index, patternLabelPosHigh, text="BE", style=label.style_label_down, color = label_color_bearish, textcolor=color.white, tooltip = ttBearishEngulfing)//bgcolor(highest(C_EngulfingBearish?1:0, C_EngulfingBearishNumberOfCandles)!=0 ? color.red : na, offset=-(C_EngulfingBearishNumberOfCandles-1))//END▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲//////////////////////////////////////////////////////////////////////////////////SIGNAL SCORES▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼//Alternate Signals Optionalternatesignals = input(title="Alternate Signals", defval=true)//Position Optionslongpositions = input(title="Long Positions", defval=true)shortpositions = input(title="Short Positions", defval=true)//Stop Loss Warning Optionstoplosspercent = input(title="Stop Loss Warning (%)", type=input.float, defval=-2.5, minval=-50, maxval=0, step=.1) / 100//Score Requirementsstronglongscore = input(defval=6, minval=0, maxval=1000, title="Required Strong LONG Score")strongshortscore = input(defval=6, minval=0, maxval=1000, title="Required Strong SHORT Score")weaklongscore = input(defval=6, minval=0, maxval=1000, title="Required Weak LONG Score")weakshortscore = input(defval=6, minval=0, maxval=1000, title="Required Weak SHORT Score")//Trend Indicator Signals/////////////////////////////////////////////////////////EMA Signalsemadirectionimportance = input(defval=2, minval=0, maxval=100, title="EMA Trend Direction Importance")emadirectionup = out5 < close ? emadirectionimportance : 0emadirectionupstatus = emadirectionup ? "EMA Trend Direction Up" : naemadirectiondown = out5 > close ? emadirectionimportance : 0emadirectiondownstatus = emadirectiondown ? "EMA Trend Direction Down" : naemapushpullimportance = input(defval=2, minval=0, maxval=100, title="EMA Pressure Importance")emapushup = out2 > out2[1] and out3 < out3[1] ? emapushpullimportance : 0emapushupstatus = emapushup ? "EMA Pushing Up" : naemapulldown = out2 < out2[1] and out3 > out3[1] ? emapushpullimportance : 0emapulldownstatus = emapulldown ? "EMA Pulling Down" : na//Super Trend Signalssupertrenddirimportance = input(defval=0, minval=0, maxval=100, title="SuperTrend Direction Importance")supertrendup = direction < 0 ? supertrenddirimportance : 0supertrendupstatus = supertrendup ? "SuperTrend Direction Up" : nasupertrenddown = direction > 0 ? supertrenddirimportance : 0supertrenddownstatus = supertrenddown ? "SuperTrend Direction Down" : nasupertrendrevimportance = input(defval=4, minval=0, maxval=100, title="SuperTrend Reversal Importance")supertrendrevup = direction < 0 and direction[1] > 0[1] ? supertrendrevimportance : 0supertrendrevupstatus = supertrendrevup ? "SuperTrend Reversed Up" : nasupertrendrevdown = direction > 0 and direction[1] < 0[1] ? supertrendrevimportance : 0supertrendrevdownstatus = supertrendrevdown ? "SuperTrend Reversed Down" : na//Parabolic SAR Signalspsardirimportance = input(defval=0, minval=0, maxval=100, title="Parabolic SAR Direction Importance")psardirup = psar < close ? psardirimportance : 0psardirupstatus = psardirup ? "PSAR Direction Up" : napsardirdown = psar > close ? psardirimportance : 0psardirdownstatus = psardirdown ? "PSAR Direction Down" : napsarrevimportance = input(defval=3, minval=0, maxval=100, title="Parabolic SAR Reversal Importance")psarrevup = psar < close and psar[1] > close[1] ? psarrevimportance : 0psarrevupstatus = psarrevup ? "PSAR Reversed Up" : napsarrevdown = psar > close and psar[1] < close ? psarrevimportance : 0psarrevdownstatus = psarrevdown ? "PSAR Reversed Down" : na//HMA Signalshmacloseposimportance = input(defval=1, minval=0, maxval=100, title="HMA Trend Direction Importance")hmacloseposup = hma < close and hma[1] ? hmacloseposimportance : 0hmacloseposupstatus = hmacloseposup ? "Price Crossed Over HMA" : nahmacloseposdown = hma > close ? hmacloseposimportance : 0hmacloseposdownstatus = hmacloseposdown ? "Price Crossed Under HMA" : nahmapivotimportance = input(defval=3, minval=0, maxval=100, title="HMA Pivot Importance")hmapivotup = hma > hma[1] and hma[1] < hma[2] ? hmapivotimportance : 0hmapivotupstatus = hmapivotup ? "HMA Pivot Up" : nahmapivotdown = hma < hma[1] and hma[1] > hma[2] ? hmapivotimportance : 0hmapivotdownstatus = hmapivotdown ? "HMA Pivot Down" : na//Momentum Indicator Signals//////////////////////////////////////////////////////RSI Signalsrsidivimportance = input(defval=4, minval=0, maxval=100, title="RSI Divergence Importance")rsidivup = bullCond11 or bullCond11[1] or bullCond11[2] ? rsidivimportance : 0rsidivupstatus = rsidivup ? "Bullish RSI Divergence" : narsidivdown = bearCond11 or bearCond11[1] or bearCond11[2] ? rsidivimportance : 0rsidivdownstatus = rsidivdown ? "Bearish RSI Divergence" : narsilevelimportance = input(defval=0, minval=0, maxval=100, title="RSI Level Importance")rsioversold = osc11 < 30 ? rsilevelimportance : 0rsioversoldstatus = rsioversold ? "RSI Oversold" : narsioverbought = osc11 > 70 ? rsilevelimportance : 0rsioverboughtstatus = rsioverbought ? "RSI Overbought" : narsidirectionimportance = input(defval=1, minval=0, maxval=100, title="RSI Cross 50-Line Importance")rsicrossup = (osc11 > 50 and osc11[1] < 50) or (osc11 > 50 and osc11[2] < 50) ? rsidirectionimportance : 0rsicrossupstatus = rsicrossup ? "RSI Crossed 50-Line Up" : narsicrossdown = (osc11 < 50 and osc11[1] > 50) or (osc11 < 50 and osc11[2] > 50) ? rsidirectionimportance : 0rsicrossdownstatus = rsicrossdown ? "RSI Crossed 50-Line Down" : na//MACD Signalsmacddivimportance = input(defval=0, minval=0, maxval=100, title="MACD Divergence Importance")macddivup = bullCond12 or bullCond12[1] or bullCond12[2] ? macddivimportance : 0macddivupstatus = macddivup ? "Bullish MACD Divergence" : namacddivdown = bearCond12 or bearCond12[1] or bearCond12[2] ? macddivimportance : 0macddivdownstatus = macddivdown ? "Bearish MACD Divergence" : nahistpivotimportance = input(defval=1, minval=0, maxval=100, title="MACD Histogram Pivot Importance")histpivotup = hist > hist[1] and hist[1] < hist[2] and hist < 0 ? histpivotimportance : 0histpivotupstatus = histpivotup ? "MACD Histogram Pivot Up" : nahistpivotdown = hist < hist[1] and hist[1] > hist[2] and hist > 0 ? histpivotimportance : 0histpivotdownstatus = histpivotdown ? "MACD Histogram Pivot Down" : namacdcrosssignalimportance = input(defval=1, minval=0, maxval=100, title="MACD Cross Signal Importance")macdcrosssignalup = macd > signal and macd[1] < signal[1] and signal < 0 ? macdcrosssignalimportance : 0macdcrosssignalupstatus = macdcrosssignalup ? "MACD Crossed Signal Up" : namacdcrosssignaldown = macd < signal and macd[1] > signal[1] and signal > 0 ? macdcrosssignalimportance : 0macdcrosssignaldownstatus = macdcrosssignaldown ? "MACD Crossed Signal Down" : na//WaveTrend Signalswtdivimportance = input(defval=0, minval=0, maxval=100, title="WaveTrend Divergence Importance")wtdivup = bullCond13 or bullCond13[1] or bullCond13[2] ? wtdivimportance : 0wtdivupstatus = wtdivup ? "Bullish WaveTrend Divergence" : nawtdivdown = bearCond13 or bearCond13[1] or bearCond13[2] ? wtdivimportance : 0wtdivdownstatus = wtdivdown ? "Bearish WaveTrend Divergence" : nawtcrosssignalimportance = input(defval=4, minval=0, maxval=100, title="WaveTrend Cross Signal Importance")wtcrosssignalup = wt1 > wt2 and wt1[1] < wt2[1] and wt2 < -10 ? wtcrosssignalimportance : 0wtcrosssignalupstatus = wtcrosssignalup ? "WaveTrend Crossed Signal Up" : nawtcrosssignaldown = wt1 < wt2 and wt1[1] > wt2[1] and wt2 > 10 ? wtcrosssignalimportance : 0wtcrosssignaldownstatus = wtcrosssignaldown ? "WaveTrend Crossed Signal Down" : na//Stochastic Signalssdivimportance = input(defval=1, minval=0, maxval=100, title="Stochastic Divergence Importance")sdivup = bullCond14 or bullCond14[1] or bullCond14[2] ? sdivimportance : 0sdivupstatus = sdivup ? "Bullish Stoch Divergence" : nasdivdown = bearCond14 or bearCond14[1] or bearCond14[2] ? sdivimportance : 0sdivdownstatus = sdivdown ? "Bearish Stoch Divergence" : nascrosssignalimportance = input(defval=1, minval=0, maxval=100, title="Stoch Cross Signal Importance")scrosssignalup = k14 > d14 and k14[1] < d14[1] ? scrosssignalimportance : 0scrosssignalupstatus = scrosssignalup ? "Stoch Crossed Signal Up" : nascrosssignaldown = k14 < d14 and k14[1] > d14[1] ? scrosssignalimportance : 0scrosssignaldownstatus = scrosssignaldown ? "Stoch Crossed Signal Down" : na//Volatility Indicators///////////////////////////////////////////////////////////Bollinger Bands Signalsbbcontimportance = input(defval=0, minval=0, maxval=100, title="BollingerBands Contact Importance")bbcontup = close < lower ? bbcontimportance : 0bbcontupstatus = bbcontup ? "Price Contacted Lower BB" : nabbcontdown = open > upper ? bbcontimportance : 0bbcontdownstatus = bbcontdown ? "Price Contacted Upper BB" : na//Average True Range Signalsatrrevimportance = input(defval=1, minval=0, maxval=100, title="ATR Reversal Importance")atrrevup = buySignal ? atrrevimportance : 0atrrevupstatus = atrrevup ? "ATR Reversed Up" : naatrrevdown = sellSignal ? atrrevimportance : 0atrrevdownstatus = atrrevdown ? "ATR Reversed Down" : na//Relative Volatility Index Signalsrviposimportance = input(defval=3, minval=0, maxval=100, title="RVI Position Importance")rviposup = rvi > 25 and rvi[1] < 40 ? rviposimportance : 0rviposupstatus = rviposup ? "RVI Volatility Increasing" : narviposdown = rvi < 75 and rvi[1] > 60 ? rviposimportance : 0rviposdownstatus = rviposdown ? "RVI Volatility Decreasing" : narvidivimportance = input(defval=4, minval=0, maxval=100, title="RVI Divergence Importance")rvidivup = bullCond15 or bullCond15[1] or bullCond15[2] ? rvidivimportance : 0rvidivupstatus = rvidivup ? "Bullish RVI Divergence" : narvidivdown = bearCond15 or bearCond15[1] or bearCond15[2] ? rvidivimportance : 0rvidivdownstatus = rvidivdown ? "Bearish RVI Divergence" : na//Support and Resistance Signalssrcrossimportance = input(defval=4, minval=0, maxval=100, title="Support/Resistance Cross Importance")srcrossup = buy1 or buy2 or buy3 or buy4 or buy5 or buy6 or buy7 or buy8 ? srcrossimportance : 0srcrossupstatus = srcrossup ? "Crossed Key Level Up" : nasrcrossdown = sell1 or sell2 or sell3 or sell4 or sell5 or sell6 or sell7 or sell8 ? srcrossimportance : 0srcrossdownstatus = srcrossdown ? "Crossed Key Level Down" : na//Volume Indicator Signals////////////////////////////////////////////////////////On Balance Volume Divergence Signalsobvdivimportance = input(defval=0, minval=0, maxval=100, title="OBV Divergence Importance")obvdivup = bullCond18 or bullCond18[1] or bullCond18[2] ? obvdivimportance : 0obvdivupstatus = obvdivup ? "Bullish OBV Divergence" : naobvdivdown = bearCond18 or bearCond18[1] or bearCond18[2] ? obvdivimportance : 0obvdivdownstatus = obvdivdown ? "Bearish OBV Divergence" : na//Chaikin Money Flow Signalscmfcrossimportance = input(defval=0, minval=0, maxval=100, title="CMF Cross 50-Line Importance")cmfcrossup = cmf > 0 and cmf[1] < 0 ? cmfcrossimportance : 0cmfcrossupstatus = cmfcrossup ? "CMF Crossed 50-Line Up" : nacmfcrossdown = cmf < 0 and cmf[1] > 0 ? cmfcrossimportance : 0cmfcrossdownstatus = cmfcrossdown ? "CMF Crossed 50-Line Down" : nacmflevimportance = input(defval=0, minval=0, maxval=100, title="CMF Level Importance")cmflevup = cmf > 0 ? cmflevimportance : 0cmflevupstatus = cmflevup ? "CMF Level Up" : nacmflevdown = cmf < 0 ? cmflevimportance : 0cmflevdownstatus = cmflevdown ? "CMF Level Down" : na//VWAP Signalsvwapcrossimportance = input(defval=0, minval=0, maxval=100, title="VWAP Cross HMA Importance")vwapcrossup = hma < vwapValue and hma[1] > vwapValue[1] ? vwapcrossimportance : 0vwapcrossupstatus = vwapcrossup ? "VWAP Crossed Above HMA" : navwapcrossdown = hma > vwapValue and hma[1] < vwapValue[1] ? vwapcrossimportance : 0vwapcrossdownstatus = vwapcrossdown ? "VWAP Crossed Below HMA" : navwaptrendimportance = input(defval=0, minval=0, maxval=100, title="VWAP Trend Importance")vwaptrendup = out2 > vwapValue ? vwaptrendimportance : 0vwaptrendupstatus = vwaptrendup ? "VWAP Up Trend" : navwaptrenddown = out2 < vwapValue ? vwaptrendimportance : 0vwaptrenddownstatus = vwaptrenddown ? "VWAP Down Trend" : na//Candle Patterns Signalsengulfingcandleimportance = input(defval=0, minval=0, maxval=100, title="Engulfing Candle Importance")bulleng = C_EngulfingBullish ? engulfingcandleimportance : 0bullengstatus = bulleng ? "Bullish Engulfing Candle" : nabeareng = C_EngulfingBearish ? engulfingcandleimportance : 0bearengstatus = beareng ? "Bearish Engulfing Candle" : na//END▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲//////////////////////////////////////////////////////////////////////////////////COLLECT SIGNALS▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼//Classify Entriesstronglongentrysignal  = emadirectionup   + emapushup   + supertrendup   + supertrendrevup   + psardirup   + psarrevup   + hmacloseposup   + hmapivotup   + rsidivup   + rsioversold   + rsicrossup   + macddivup   + histpivotup   + macdcrosssignalup   + wtdivup   + wtcrosssignalup   + sdivup   + scrosssignalup   + bbcontup   + atrrevup   + rviposup   + rvidivup   + srcrossup   + obvdivup   + cmfcrossup   + cmflevup   + vwapcrossup   + vwaptrendup   + bulleng >= stronglongscorestrongshortentrysignal = emadirectiondown + emapulldown + supertrenddown + supertrendrevdown + psardirdown + psarrevdown + hmacloseposdown + hmapivotdown + rsidivdown + rsioverbought + rsicrossdown + macddivdown + histpivotdown + macdcrosssignaldown + wtdivdown + wtcrosssignaldown + sdivdown + scrosssignaldown + bbcontdown + atrrevdown + rviposdown + rvidivdown + srcrossdown + obvdivdown + cmfcrossdown + cmflevdown + vwapcrossdown + vwaptrenddown + beareng >= strongshortscoreweaklongentrysignal    = emadirectionup   + emapushup   + supertrendup   + supertrendrevup   + psardirup   + psarrevup   + hmacloseposup   + hmapivotup   + rsidivup   + rsioversold   + rsicrossup   + macddivup   + histpivotup   + macdcrosssignalup   + wtdivup   + wtcrosssignalup   + sdivup   + scrosssignalup   + bbcontup   + atrrevup   + rviposup   + rvidivup   + srcrossup   + obvdivup   + cmfcrossup   + cmflevup   + vwapcrossup   + vwaptrendup   + bulleng >= weaklongscoreweakshortentrysignal   = emadirectiondown + emapulldown + supertrenddown + supertrendrevdown + psardirdown + psarrevdown + hmacloseposdown + hmapivotdown + rsidivdown + rsioverbought + rsicrossdown + macddivdown + histpivotdown + macdcrosssignaldown + wtdivdown + wtcrosssignaldown + sdivdown + scrosssignaldown + bbcontdown + atrrevdown + rviposdown + rvidivdown + srcrossdown + obvdivdown + cmfcrossdown + cmflevdown + vwapcrossdown + vwaptrenddown + beareng >= weakshortscore//Alternate Entry Signalsvar pos = 0if stronglongentrysignal and pos <= 0    pos := 1if strongshortentrysignal and pos >= 0    pos := -1longentry = pos == 1 and (pos != 1)[1]shortentry = pos == -1 and (pos != -1)[1]alternatelong  = alternatesignals ? longentry  : stronglongentrysignalalternateshort = alternatesignals ? shortentry : strongshortentrysignal//END▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲//////////////////////////////////////////////////////////////////////////////////PLOT SIGNALS▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼plotshape(tradetrendoption ? alternatelong and mabuy : alternatelong, title="Strong Long Label", style=shape.labelup, location=location.belowbar, color=#00bcd4, text="𝐋𝐎𝐍𝐆", textcolor=color.white, size=size.small)plotshape(tradetrendoption ? alternateshort and masell : alternateshort, title="Strong Short Label", style=shape.labeldown, location=location.abovebar, color=#e91e63, text="𝐒𝐇𝐎𝐑𝐓", textcolor=color.white, size=size.small)plotshape(weaklongentrysignal, title="Weak Long Triangle", style=shape.triangleup, location=location.belowbar, color=color.new(#00bcd4, 50), size=size.tiny)plotshape(weakshortentrysignal, title="Weak Short Triangle", style=shape.triangledown, location=location.abovebar, color=color.new(#e91e63, 50), size=size.tiny)//END▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲//////////////////////////////////////////////////////////////////////////////////PLOT STATUS▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼var table statuswindow = table.new(position.top_right, 100, 100, border_width=2)//Trend Status//////////////////////////////////////////////////////////////////txt1 = "🡇            TREND             🡇"table.cell(statuswindow, 3, 0, text=txt1, bgcolor=color.new(#000000, 50), text_color=color.white, text_size=size.small)//EMA Statusif emadirectionup    table.cell(statuswindow, 3, 1, text=tostring(emadirectionupstatus), bgcolor=color.new(#00bcd4, 50), text_color=color.white, text_size=size.small)if emadirectiondown    table.cell(statuswindow, 3, 1, text=tostring(emadirectiondownstatus), bgcolor=color.new(#e91e63, 50), text_color=color.white, text_size=size.small)if emapushup ? 1 : na    table.cell(statuswindow, 3, 2, text=tostring(emapushupstatus), bgcolor=color.new(#00bcd4, 50), text_color=color.white, text_size=size.small)if emapushup ? na : 1    table.clear(statuswindow, 3, 2)if emapulldown ? 1 : na    table.cell(statuswindow, 3, 3, text=tostring(emapulldownstatus), bgcolor=color.new(#e91e63, 50), text_color=color.white, text_size=size.small)if emapulldown ? na : 1    table.clear(statuswindow, 3, 3)//SuperTrend Statusif supertrendup    table.cell(statuswindow, 3, 4, text=tostring(supertrendupstatus), bgcolor=color.new(#00bcd4, 50), text_color=color.white, text_size=size.small)if supertrenddown    table.cell(statuswindow, 3, 4, text=tostring(supertrenddownstatus), bgcolor=color.new(#e91e63, 50), text_color=color.white, text_size=size.small)if supertrendrevup ? 1 : na    table.cell(statuswindow, 3, 5, text=tostring(supertrendrevupstatus), bgcolor=color.new(#00bcd4, 50), text_color=color.white, text_size=size.small)if supertrendrevup ? na : 1    table.clear(statuswindow, 3, 5)if supertrendrevdown ? 1 : na    table.cell(statuswindow, 3, 6, text=tostring(supertrendrevdownstatus), bgcolor=color.new(#e91e63, 50), text_color=color.white, text_size=size.small)if supertrendrevdown ? na : 1    table.clear(statuswindow, 3, 6)    //Parabolic SAR Statusif psardirup    table.cell(statuswindow, 3, 7, text=tostring(psardirupstatus), bgcolor=color.new(#00bcd4, 50), text_color=color.white, text_size=size.small)if psardirdown    table.cell(statuswindow, 3, 7, text=tostring(psardirdownstatus), bgcolor=color.new(#e91e63, 50), text_color=color.white, text_size=size.small)if psarrevup ? 1 : na    table.cell(statuswindow, 3, 8, text=tostring(psarrevupstatus), bgcolor=color.new(#00bcd4, 50), text_color=color.white, text_size=size.small)if psarrevup ? na : 1    table.clear(statuswindow, 3, 8)if psarrevdown ? 1 : na    table.cell(statuswindow, 3, 9, text=tostring(psarrevdownstatus), bgcolor=color.new(#e91e63, 50), text_color=color.white, text_size=size.small)if psarrevdown ? na : 1    table.clear(statuswindow, 3, 9)//HMA Statusif hmacloseposup    table.cell(statuswindow, 3, 10, text=tostring(hmacloseposupstatus), bgcolor=color.new(#00bcd4, 50), text_color=color.white, text_size=size.small)if hmacloseposdown    table.cell(statuswindow, 3, 10, text=tostring(hmacloseposdownstatus), bgcolor=color.new(#e91e63, 50), text_color=color.white, text_size=size.small)if hmapivotup ? 1 : na    table.cell(statuswindow, 3, 11, text=tostring(hmapivotupstatus), bgcolor=color.new(#00bcd4, 50), text_color=color.white, text_size=size.small)if hmapivotup ? na : 1    table.clear(statuswindow, 3, 11)if hmapivotdown ? 1 : na    table.cell(statuswindow, 3, 12, text=tostring(hmapivotdownstatus), bgcolor=color.new(#e91e63, 50), text_color=color.white, text_size=size.small)if hmapivotdown ? na : 1    table.clear(statuswindow, 3, 12)//Momentum Status///////////////////////////////////////////////////////////////txt2 = "🡇         MOMENTUM         🡇"table.cell(statuswindow, 2, 0, text=txt2, bgcolor=color.new(#000000, 50), text_color=color.white, text_size=size.small)    //RSI Statusif rsidivup ? 1 : na    table.cell(statuswindow, 2, 1, text=tostring(rsidivupstatus), bgcolor=color.new(#00bcd4, 50), text_color=color.white, text_size=size.small)if rsidivup ? na : 1    table.clear(statuswindow, 2, 1)if rsidivdown ? 1 : na    table.cell(statuswindow, 2, 2, text=tostring(rsidivdownstatus), bgcolor=color.new(#e91e63, 50), text_color=color.white, text_size=size.small)if rsidivdown ? na : 1    table.clear(statuswindow, 2, 2)if rsioversold ? 1 : na    table.cell(statuswindow, 2, 3, text=tostring(rsioversoldstatus), bgcolor=color.new(#00bcd4, 50), text_color=color.white, text_size=size.small)if rsioversold ? na : 1    table.clear(statuswindow, 2, 3)if rsioverbought ? 1 : na    table.cell(statuswindow, 2, 4, text=tostring(rsioverboughtstatus), bgcolor=color.new(#e91e63, 50), text_color=color.white, text_size=size.small)if rsioverbought ? na : 1    table.clear(statuswindow, 2, 4)if rsicrossup ? 1 : na    table.cell(statuswindow, 2, 5, text=tostring(rsicrossupstatus), bgcolor=color.new(#00bcd4, 50), text_color=color.white, text_size=size.small)if rsicrossup ? na : 1    table.clear(statuswindow, 2, 5)if rsicrossdown ? 1 : na    table.cell(statuswindow, 2, 6, text=tostring(rsicrossdownstatus), bgcolor=color.new(#e91e63, 50), text_color=color.white, text_size=size.small)if rsicrossdown ? na : 1    table.clear(statuswindow, 2, 6)//MACD Statusif macddivup ? 1 : na    table.cell(statuswindow, 2, 7, text=tostring(macddivupstatus), bgcolor=color.new(#00bcd4, 50), text_color=color.white, text_size=size.small)if macddivup ? na : 1    table.clear(statuswindow, 2, 7)if macddivdown ? 1 : na    table.cell(statuswindow, 2, 8, text=tostring(macddivdownstatus), bgcolor=color.new(#e91e63, 50), text_color=color.white, text_size=size.small)if macddivdown ? na : 1    table.clear(statuswindow, 2, 8)if histpivotup ? 1 : na    table.cell(statuswindow, 2, 9, text=tostring(histpivotupstatus), bgcolor=color.new(#00bcd4, 50), text_color=color.white, text_size=size.small)if histpivotup ? na : 1    table.clear(statuswindow, 2, 9)if histpivotdown ? 1 : na    table.cell(statuswindow, 2, 10, text=tostring(histpivotdownstatus), bgcolor=color.new(#e91e63, 50), text_color=color.white, text_size=size.small)if histpivotdown ? na : 1    table.clear(statuswindow, 2, 10)if macdcrosssignalup ? 1 : na    table.cell(statuswindow, 2, 11, text=tostring(macdcrosssignalupstatus), bgcolor=color.new(#00bcd4, 50), text_color=color.white, text_size=size.small)if macdcrosssignalup ? na : 1    table.clear(statuswindow, 2, 11)if macdcrosssignaldown ? 1 : na    table.cell(statuswindow, 2, 12, text=tostring(macdcrosssignaldownstatus), bgcolor=color.new(#e91e63, 50), text_color=color.white, text_size=size.small)if macdcrosssignaldown ? na : 1    table.clear(statuswindow, 2, 12)//Wave Trend Statusif wtdivup ? 1 : na    table.cell(statuswindow, 2, 13, text=tostring(wtdivupstatus), bgcolor=color.new(#00bcd4, 50), text_color=color.white, text_size=size.small)if wtdivup ? na : 1    table.clear(statuswindow, 2, 13)if wtdivdown ? 1 : na    table.cell(statuswindow, 2, 14, text=tostring(wtdivdownstatus), bgcolor=color.new(#e91e63, 50), text_color=color.white, text_size=size.small)if wtdivdown ? na : 1    table.clear(statuswindow, 2, 14)if wtcrosssignalup ? 1 : na    table.cell(statuswindow, 2, 15, text=tostring(wtcrosssignalupstatus), bgcolor=color.new(#00bcd4, 50), text_color=color.white, text_size=size.small)if wtcrosssignalup ? na : 1    table.clear(statuswindow, 2, 15)if wtcrosssignaldown ? 1 : na    table.cell(statuswindow, 2, 16, text=tostring(wtcrosssignaldownstatus), bgcolor=color.new(#e91e63, 50), text_color=color.white, text_size=size.small)if wtcrosssignaldown ? na : 1    table.clear(statuswindow, 2, 16)    //Stochastic Statusif sdivup ? 1 : na    table.cell(statuswindow, 2, 17, text=tostring(sdivupstatus), bgcolor=color.new(#00bcd4, 50), text_color=color.white, text_size=size.small)if sdivup ? na : 1    table.clear(statuswindow, 2, 17)if sdivdown ? 1 : na    table.cell(statuswindow, 2, 18, text=tostring(sdivdownstatus), bgcolor=color.new(#e91e63, 50), text_color=color.white, text_size=size.small)if sdivdown ? na : 1    table.clear(statuswindow, 2, 18)if scrosssignalup ? 1 : na    table.cell(statuswindow, 2, 19, text=tostring(scrosssignalupstatus), bgcolor=color.new(#00bcd4, 50), text_color=color.white, text_size=size.small)if scrosssignalup ? na : 1    table.clear(statuswindow, 2, 19)if scrosssignaldown ? 1 : na    table.cell(statuswindow, 2, 20, text=tostring(scrosssignaldownstatus), bgcolor=color.new(#e91e63, 50), text_color=color.white, text_size=size.small)if scrosssignaldown ? na : 1    table.clear(statuswindow, 2, 20)    //Volatility Status/////////////////////////////////////////////////////////////////txt3 = "🡇         VOLATILITY         🡇"table.cell(statuswindow, 1, 0, text=txt3, bgcolor=color.new(#000000, 50), text_color=color.white, text_size=size.small)//Bollinger Bands Statusif bbcontup ? 1 : na    table.cell(statuswindow, 1, 1, text=tostring(bbcontupstatus), bgcolor=color.new(#00bcd4, 50), text_color=color.white, text_size=size.small)if bbcontup ? na : 1    table.clear(statuswindow, 1, 1)if bbcontup ? 1 : na    table.cell(statuswindow, 1, 2, text=tostring(bbcontdownstatus), bgcolor=color.new(#e91e63, 50), text_color=color.white, text_size=size.small)if bbcontdown ? na : 1    table.clear(statuswindow, 1, 2)    //ATR Statusif atrrevup ? 1 : na    table.cell(statuswindow, 1, 3, text=tostring(atrrevupstatus), bgcolor=color.new(#00bcd4, 50), text_color=color.white, text_size=size.small)if atrrevup ? na : 1    table.clear(statuswindow, 1, 3)if atrrevdown ? 1 : na    table.cell(statuswindow, 1, 4, text=tostring(atrrevdownstatus), bgcolor=color.new(#e91e63, 50), text_color=color.white, text_size=size.small)if atrrevdown ? na : 1    table.clear(statuswindow, 1, 4)    //RVI Statusif rviposup ? 1 : na    table.cell(statuswindow, 1, 5, text=tostring(rviposupstatus), bgcolor=color.new(#00bcd4, 50), text_color=color.white, text_size=size.small)if rviposup ? na : 1    table.clear(statuswindow, 1, 5)if rviposdown ? 1 : na    table.cell(statuswindow, 1, 6, text=tostring(rviposdownstatus), bgcolor=color.new(#e91e63, 50), text_color=color.white, text_size=size.small)if rviposdown ? na : 1    table.clear(statuswindow, 1, 6)if rvidivup ? 1 : na    table.cell(statuswindow, 1, 7, text=tostring(rvidivupstatus), bgcolor=color.new(#00bcd4, 50), text_color=color.white, text_size=size.small)if rvidivup ? na : 1    table.clear(statuswindow, 1, 7)if rvidivdown ? 1 : na    table.cell(statuswindow, 1, 8, text=tostring(rvidivdownstatus), bgcolor=color.new(#e91e63, 50), text_color=color.white, text_size=size.small)if rvidivdown ? na : 1    table.clear(statuswindow, 1, 8)//Support and Resistance Statusif srcrossup ? 1 : na    table.cell(statuswindow, 1, 9, text=tostring(srcrossupstatus), bgcolor=color.new(#00bcd4, 50), text_color=color.white, text_size=size.small)if srcrossup ? na : 1    table.clear(statuswindow, 1, 9)if srcrossdown ? 1 : na    table.cell(statuswindow, 1, 10, text=tostring(srcrossdownstatus), bgcolor=color.new(#e91e63, 50), text_color=color.white, text_size=size.small)if srcrossdown ? na : 1    table.clear(statuswindow, 1, 10)        //Volume Status/////////////////////////////////////////////////////////////////txt4 = "🡇           VOLUME           🡇"table.cell(statuswindow, 0, 0, text=txt4, bgcolor=color.new(#000000, 50), text_color=color.white, text_size=size.small)//On Balance Volume Statusif obvdivup ? 1 : na    table.cell(statuswindow, 0, 1, text=tostring(obvdivupstatus), bgcolor=color.new(#00bcd4, 50), text_color=color.white, text_size=size.small)if obvdivup ? na : 1    table.clear(statuswindow, 0, 1)if obvdivdown ? 1 : na    table.cell(statuswindow, 0, 2, text=tostring(obvdivdownstatus), bgcolor=color.new(#e91e63, 50), text_color=color.white, text_size=size.small)if obvdivdown ? na : 1    table.clear(statuswindow, 0, 2)    //Chaikin Money Flow Statusif cmfcrossup ? 1 : na    table.cell(statuswindow, 0, 3, text=tostring(cmfcrossupstatus), bgcolor=color.new(#00bcd4, 50), text_color=color.white, text_size=size.small)if cmfcrossup ? na : 1    table.clear(statuswindow, 0, 3)if cmfcrossdown ? 1 : na    table.cell(statuswindow, 0, 4, text=tostring(cmfcrossdownstatus), bgcolor=color.new(#e91e63, 50), text_color=color.white, text_size=size.small)if cmfcrossdown ? na : 1    table.clear(statuswindow, 0, 4)if cmflevup ? 1 : na    table.cell(statuswindow, 0,5, text=tostring(cmflevupstatus), bgcolor=color.new(#00bcd4, 50), text_color=color.white, text_size=size.small)if cmflevdown ? 1 : na    table.cell(statuswindow, 0, 5, text=tostring(cmflevdownstatus), bgcolor=color.new(#e91e63, 50), text_color=color.white, text_size=size.small)    //VWAP Statusif vwapcrossup ? 1 : na    table.cell(statuswindow, 0, 6, text=tostring(vwapcrossupstatus), bgcolor=color.new(#00bcd4, 50), text_color=color.white, text_size=size.small)if vwapcrossup ? na : 1    table.clear(statuswindow, 0, 6)if vwapcrossdown ? 1 : na    table.cell(statuswindow, 0, 7, text=tostring(vwapcrossdownstatus), bgcolor=color.new(#e91e63, 50), text_color=color.white, text_size=size.small)if vwapcrossdown ? na : 1    table.clear(statuswindow, 0, 7)if vwaptrendup ? 1 : na    table.cell(statuswindow, 0,8, text=tostring(vwaptrendupstatus), bgcolor=color.new(#00bcd4, 50), text_color=color.white, text_size=size.small)if vwaptrenddown ? 1 : na    table.cell(statuswindow, 0, 8, text=tostring(vwaptrenddownstatus), bgcolor=color.new(#e91e63, 50), text_color=color.white, text_size=size.small)    //Candle Pattern Statusif bulleng ? 1 : na    table.cell(statuswindow, 0, 9, text=tostring(bullengstatus), bgcolor=color.new(#00bcd4, 50), text_color=color.white, text_size=size.small)if bulleng ? na : 1    table.clear(statuswindow, 0, 9)if beareng ? 1 : na    table.cell(statuswindow, 0, 10, text=tostring(bearengstatus), bgcolor=color.new(#e91e63, 50), text_color=color.white, text_size=size.small)if beareng ? na : 1    table.clear(statuswindow, 0, 10)//END▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲//////////////////////////////////////////////////////////////////////////////////STOP LOSS WARNINGS▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼//Stop Loss Criterialongstoploss = strategy.position_avg_price * (1 + stoplosspercent)shortstoploss = strategy.position_avg_price * (1 - stoplosspercent)printstoplong = longstoploss > close and longstoploss[1] < close[1] and strategy.position_size > 0printstopshort = shortstoploss < close and shortstoploss[1] > close[1] and strategy.position_size < 0//Stop Loss Linesplot(strategy.position_size > 0 ? longstoploss : na, style=plot.style_line, color=color.new(color.yellow, 50), linewidth=1, title="Stop Long Line", display=display.none)plot(strategy.position_size < 0 ? shortstoploss : na, style=plot.style_line, color=color.new(color.yellow, 50), linewidth=1, title="Stop Short Line", display=display.none)//Stop Loss Labelsplotshape(printstoplong, title="Stop Long Label", style=shape.labelup, location=location.belowbar, color=color.yellow, text="𝐒𝐓𝐎𝐏", textcolor=color.black, size=size.tiny)plotshape(printstopshort, title="Stop Short Label", style=shape.labeldown, location=location.abovebar, color=color.yellow, text="𝐒𝐓𝐎𝐏", textcolor=color.black, size=size.tiny)//Alertsttbuystring  = "Input your custom alert message here. In the Alert settings, choose \"Neural Network\" and \"Alert() functionc calls only\"\nIf you're using a 3Commas Bot, make sure to format your message correctly with forward slashes in front of each quotation, you can find videos about how to do this on YouTube. Or ask 3Commas support about how to format the message for PineScript."ttsellstring = "Input your custom alert message here. In the Alert settings, choose \"Neural Network\" and \"Alert() functionc calls only\"\nIf you're using a 3Commas Bot, make sure to format your message correctly with forward slashes in front of each quotation, you can find videos about how to do this on YouTube. Or ask 3Commas support about how to format the message for PineScript."ttstopstring = "Input your custom alert message here. In the Alert settings, choose \"Neural Network\" and \"Alert() functionc calls only\"\nIf you're using a 3Commas Bot, make sure to format your message correctly with forward slashes in front of each quotation, you can find videos about how to do this on YouTube. Or ask 3Commas support about how to format the message for PineScript."usebuyalert = input(defval=true, title="Use BUY Alert", group="Alert Messages")//buystring  = input(title="Buy Alert Message",  defval="ENTER-LONG_OKEX-FUTURES_LINK-USDT-220805_my-trading-view_10M_80eba43b2348716e",  type=input.string, confirm=false, group="Alert Messages", tooltip=ttbuystring)buystring  = "ENTER-LONG_BYBIT_LINKUSDT_mybybite-bot_10M_403d210eb46a9bd3"usesellalert = input(defval=true, title="Use SELL Alert", group="Alert Messages")//sellstring = input(title="Sell Alert Message", defval="ENTER-SHORT_OKEX-FUTURES_LINK-USDT-220805_my-trading-view_10M_80eba43b2348716e", type=input.string, confirm=false, group="Alert Messages", tooltip=ttsellstring)sellstring = "ENTER-SHORT_BYBIT_LINKUSDT_mybybite-bot_10M_403d210eb46a9bd3"usestopalert = input(defval=true, title="Use STOP Alert", group="Alert Messages")stopstring = input(title="Stop Alert Message", defval="CLOSE", type=input.string, confirm=false, group="Alert Messages", tooltip=ttstopstring)//buystring  = "ENTER-LONG_BYBIT_LINKUSDT_mybybite-bot_10M_403d210eb46a9bd3"//sellstring = "ENTER-SHORT_BYBIT_LINKUSDT_mybybite-bot_10M_403d210eb46a9bd3"var LongPos = truevar ShortPos= true//*********************************************************************************************************// shooroe cod haye indicatore cci_s.....  source = input(close)cci_period = input(20, "CCI Period")stoch_period = input(20, "Stoch Period")stoch_smooth_k = input(7, "Stoch Smooth K")stoch_smooth_d = input(3, "Stoch Smooth D")d_or_k = input(defval="D", options=["D", "K"])OB = input(80, "Overbought", type=input.integer)OS = input(20, "Oversold", type=input.integer)midline= input(50, "Mid line", type=input.integer)showArrows = input(true, "Show Arrows")showArrowsEnter = input(true, "Show Arrows on Enter zone")showArrowsCenter = input(false, "Show Arrows on Center zone")showArrowsExit = input(true, "Show Arrows on Exit zone")cci = cci(source, cci_period)stoch_cci_k = sma(stoch(cci, cci, cci, stoch_period), stoch_smooth_k)stoch_cci_d = sma(stoch_cci_k, stoch_smooth_d)ma = (d_or_k == "D") ? stoch_cci_d : stoch_cci_ktrend_enter = if showArrowsEnter    if crossunder(ma, OS)        1    else        if crossover(ma, OB)            -1    //plot(trend_enter, title="trend_enter", transp=100)trend_exit = if showArrowsExit    if crossunder(ma, OB)        -1    else        if crossover(ma, OS)            1trend_center = if showArrowsCenter    if crossunder(ma, 50)        -1    else        if crossover(ma, 50)            1// plot the OB and OS leveloverbought = hline(OB, title="Upper Line", linestyle=hline.style_solid, linewidth=1, color=color.red)oversold = hline(OS, title="Lower Line", linestyle=hline.style_solid, linewidth=1, color=color.lime)band2 = hline(50, title="Mid Line", linestyle=hline.style_solid, linewidth=1, color=color.gray)// Plot the moving average//ma_color = ma > OB ? color.red : ma < OS ? color.green : color.gray//plot(ma, "Moving Average", linewidth=3, color=ma_color, transp=0)maxLevelPlot = hline(100, title="Max Level", linestyle=hline.style_dotted, color=color.new(color.white, 100))minLevelPlot = hline(0, title="Min Level", linestyle=hline.style_dotted, color=color.new(color.white, 100))//overbought = hline(OB, title="Hline Overbought", linestyle=hline.style_solid, color=color.new(color.white, 100))//oversold = hline(OS, title="Hline Oversold", linestyle=hline.style_solid, color=color.new(color.white, 100))color_fill_os = ma > OB ? color.new(color.red,80) : color.new(color.white, 100)  // ShortShortFlage = ma > OB ? 1 : 0  // Shortcolor_fill_ob = ma < OS ? color.new(color.green,80) : color.new(color.white, 100) // LongLongFlage= ma < OS ? 1 : 0 // Longfill(maxLevelPlot, overbought, color=color_fill_os) // Short fill(minLevelPlot, oversold, color=color_fill_ob)  // Long//table.cell(LongPos, 1, 0, text=" LONG ", bgcolor=color.new(color.green, 50), text_color=color.red, text_size=size.small)//table.cell(LongPos, 2, 0, text=" SHORT", bgcolor=color.new(color.green, 50), text_color=color.red, text_size=size.small)//table.cell(LongPos, 1, 1, text=tostring(barssince(LongFlage==1)), bgcolor=color.new(color.green, 50), text_color=color.red, text_size=size.small)//table.cell(LongPos, 2, 1, text=tostring(barssince(ShortFlage==1)), bgcolor=color.new(color.green, 50), text_color=color.red, text_size=size.small)if open[1]-close[1]> 0 and open[1]-close[1]> 0.15     LongFlage=0 if open[1]-close[1]> 0 and open[1]-close[1]> 0.15     ShortFlage=0   if close[1]-open[1]> 0 and close[1]-open[1]> 0.15     LongFlage=0    if close[1]-open[1]> 0 and close[1]-open[1]> 0.15     ShortFlage=0        //close_Long_pos= color_fill_ob == "white"  ? 1 : 0//close_Short_pos= color_fill_os == "white"  ? 1 : 0//if close_Long_pos//   alert("exitLONGstring", alert.freq_once_per_bar)//if close_Short_pos //       alert(exitSHORTstring, alert.freq_once_per_bar)// Show the arrows// Trend Enter//plotshape((showArrows and showArrowsEnter and trend_enter == 1) ? 0 : na, color=color.green, transp=20, style=shape.arrowup, size=size.normal,  location=location.absolute, title="Trend Enter Buy")//plotshape((showArrows and showArrowsEnter and trend_enter == -1) ? 100 : na, color=color.red, transp=20, style=shape.arrowdown, size=size.normal, location=location.absolute, title="Trend Enter Sell")// Trend Center//plotshape((showArrows and showArrowsCenter and trend_center == 1) ? 35 : na, color=color.aqua, transp=20, style=shape.arrowup, size=size.normal, location=location.absolute, title="Trend Center Buy")//plotshape((showArrows and showArrowsCenter and trend_center == -1) ? 65 : na, color=color.fuchsia, transp=20, style=shape.arrowdown, size=size.normal, location=location.absolute, title="Trend Center Sell")// Trend Exit//plotshape((showArrows and showArrowsExit and trend_exit == 1) ? 0 : na, color=color.orange, transp=20, style=shape.arrowup, size=size.normal, location=location.absolute, title="Trend Exit Buy")//plotshape((showArrows and showArrowsExit and trend_exit == -1) ? 100 : na, color=color.maroon, transp=20, style=shape.arrowdown, size=size.normal, location=location.absolute, title="Trend Exit Sell")//*****************************************     RSI,16   EMA,50    LongFlage & ShortFlage #2  is set here  ****************************************************************LongFL2() => //src = close//len21 = input(16, minval=1, title="RSI Length")//len22 = input(50, minval=1, title="EMA of RSI Length")    up11 = rma(max(change(close), 0), 20)    down11 = rma(-min(change(close), 0), 20)    rsi11 = down11 == 0 ? 100 : up11 == 0 ? 0 : 100 - (100 / (1 + up11 / down11))    emaRSI11 = ema(rsi11,40)    rsi55 = rsi(close, 14)    k55 = sma(stoch(rsi55, rsi55, rsi55, 14), 3)    d55 = sma(k55, 3)    rsi11+1.8 > emaRSI11  ? 1 : 0 ShortFL2() => //src = close//len21 = input(16, minval=1, title="RSI Length")//len22 = input(50, minval=1, title="EMA of RSI Length")    up11 = rma(max(change(close), 0), 20)    down11 = rma(-min(change(close), 0), 20)    rsi11 = down11 == 0 ? 100 : up11 == 0 ? 0 : 100 - (100 / (1 + up11 / down11))    emaRSI11 = ema(rsi11,40)    rsi55 = rsi(close, 14)    k55 = sma(stoch(rsi55, rsi55, rsi55, 14), 3)    d55 = sma(k55, 3)    rsi11-1.8 < emaRSI11  ? 1 : 0 //LongFlage2= barssince(crossover(rsi11,emaRSI11)) < barssince(crossunder(rsi11,emaRSI11)) and rsi11-emaRSI11>1.5 and k55>d55 ? 1 : 0 // LongFlage #2//ShortFlage2= barssince(crossunder(rsi11,emaRSI11)) < barssince(crossover(rsi11,emaRSI11)) and emaRSI11-rsi11>1.5 and d55>k55? 1 : 0 // ShortFlage #2//LongFlage2= rsi11+1.8 > emaRSI11  ? 1 : 0 // LongFlage #2//ShortFlage2= rsi11-1.8 < emaRSI11  ? 1 : 0 // ShortFlage #2//***********************************************************************        END         *****************************************************************************//*****************************************  Crossing of RSI,12   EMA,12 PLUSE Crossing fo Stoch-Rsi 14,3,3) ---> LongFlage & ShortFlage #3  is set here  ****************************************************************LongFL3() =>//len21 = input(16, minval=1, title="RSI Length")//len22 = input(50, minval=1, title="EMA of RSI Length")    up22 = rma(max(change(close), 0), 12)    down22 = rma(-min(change(close), 0), 12)    rsi22 = down22 == 0 ? 100 : up22 == 0 ? 0 : 100 - (100 / (1 + up22 / down22))    emaRSI22 = ema(rsi22,12)    rsi33 = rsi(close, 14)    k33 = sma(stoch(rsi33, rsi33, rsi33, 14), 3)    d33 = sma(k33, 3)    StochRsiUP = k33>d33  ? 1 : 0    StochRsiDOWN = k33<d33 ?  1 : 0     StochRsiUpSignal = StochRsiUP and  barssince(crossover(k33,d33)) < barssince(crossunder(k33,d33)) and barssince(crossover(k33,d33)) <3     and k33-d33>0.7  ? 1 : 0//and d33<40 ? 1 : 0     StochRsiDownSignal = StochRsiDOWN and  barssince(crossunder(k33,d33)) < barssince(crossover(k33,d33)) and barssince(crossunder(k33,d33)) <3  and d33-k33>0.7 ?  1 : 0//and k33 > 60 ?  1 : 0     RsiMa1212UP= rsi22>emaRSI22 ? 1:0    RsiMa1212DOWN= rsi22<emaRSI22 ? 1:0    RsiMa1212UpSignal = RsiMa1212UP and barssince(crossover(rsi22,emaRSI22)) < barssince(crossunder(rsi22,emaRSI22)) and barssince(crossover(rsi22,emaRSI22)) <3   and rsi22-emaRSI22>0.7  ? 1 : 0//and d33<40 ? 1 : 0     RsiMa1212DownSignal = RsiMa1212DOWN and barssince(crossunder(rsi22,emaRSI22)) < barssince(crossover(rsi22,emaRSI22)) and barssince(crossunder(rsi22,emaRSI22)) <3  and emaRSI22-rsi22>0.7 ?  1 : 0//and k33 > 60 ?  1 : 0     StochRsiUpSignal and RsiMa1212UpSignal ? 1 : 0 // LongFlage #3ShortFL3() =>//len21 = input(16, minval=1, title="RSI Length")//len22 = input(50, minval=1, title="EMA of RSI Length")    up22 = rma(max(change(close), 0), 12)    down22 = rma(-min(change(close), 0), 12)    rsi22 = down22 == 0 ? 100 : up22 == 0 ? 0 : 100 - (100 / (1 + up22 / down22))    emaRSI22 = ema(rsi22,12)    rsi33 = rsi(close, 14)    k33 = sma(stoch(rsi33, rsi33, rsi33, 14), 3)    d33 = sma(k33, 3)    StochRsiUP = k33>d33  ? 1 : 0    StochRsiDOWN = k33<d33 ?  1 : 0     StochRsiUpSignal = StochRsiUP and  barssince(crossover(k33,d33)) < barssince(crossunder(k33,d33)) and barssince(crossover(k33,d33)) <3     and k33-d33>0.7  ? 1 : 0//and d33<40 ? 1 : 0     StochRsiDownSignal = StochRsiDOWN and  barssince(crossunder(k33,d33)) < barssince(crossover(k33,d33)) and barssince(crossunder(k33,d33)) <3  and d33-k33>0.7 ?  1 : 0//and k33 > 60 ?  1 : 0     RsiMa1212UP= rsi22>emaRSI22 ? 1:0    RsiMa1212DOWN= rsi22<emaRSI22 ? 1:0    RsiMa1212UpSignal = RsiMa1212UP and barssince(crossover(rsi22,emaRSI22)) < barssince(crossunder(rsi22,emaRSI22)) and barssince(crossover(rsi22,emaRSI22)) <3   and rsi22-emaRSI22>0.7  ? 1 : 0//and d33<40 ? 1 : 0     RsiMa1212DownSignal = RsiMa1212DOWN and barssince(crossunder(rsi22,emaRSI22)) < barssince(crossover(rsi22,emaRSI22)) and barssince(crossunder(rsi22,emaRSI22)) <3  and emaRSI22-rsi22>0.7 ?  1 : 0//and k33 > 60 ?  1 : 0     StochRsiDownSignal and RsiMa1212DownSignal ? 1 : 0 // ShortFlage #3//LongFlage3= barssince(crossover(rsi22,emaRSI22)) < barssince(crossunder(rsi22,emaRSI22)) and barssince(crossover(rsi22,emaRSI22))<3  and StochRsiUP ? 1 : 0 // LongFlage #3//ShortFlage3= barssince(crossunder(rsi22,emaRSI22)) < barssince(crossover(rsi22,emaRSI22))  and barssince(crossunder(rsi22,emaRSI22))<3  and StochRsiDOWN ? 1 : 0 // ShortFlage #3//LongFlage3= rsi22 > emaRSI22  ?1 : 0 // LongFlage #3 //ShortFlage3= rsi22 < emaRSI22  ? 1 : 0 // ShortFlage #3//table.cell(LongPos, 1, 3, text=tostring(LongFlage3), bgcolor=color.new(color.green, 50), text_color=color.red, text_size=size.small)//table.cell(LongPos, 2, 3, text=tostring(ShortFlage3), bgcolor=color.new(color.green, 50), text_color=color.red, text_size=size.small)//***********************************************************************        END         *****************************************************************************//*****************************************  Crossing of CCI 10  with, EMA 5  of  CCI 20  ---> LongFlage & ShortFlage #4  is set here  ****************************************************************LongFL4() =>    cci4410= cci(close,10)    cci4420= cci(close,20)    emacci4420= ema(cci4420,5)//Cci4410EmaCci4420Up = emacci4420>cci4410 and  barssince(crossover(emacci4420,cci4410)<3 ?1 :0      cci4410>emacci4420 and  barssince(crossover(cci4410,emacci4420))<barssince(crossunder(cci4410,emacci4420)) and  barssince(crossover(cci4410,emacci4420))<3 ?1 :0ShortFL4() =>    cci4410= cci(close,10)    cci4420= cci(close,20)    emacci4420= ema(cci4420,5)//Cci4410EmaCci4420Up = emacci4420>cci4410 and  barssince(crossover(emacci4420,cci4410)<3 ?1 :0      emacci4420>cci4410 and  barssince(crossunder(cci4410,emacci4420))<barssince(crossover(cci4410,emacci4420))  and  barssince(crossunder(cci4410,emacci4420))<3 ?1 :0//***********************************************************************        END         *****************************************************************************//*****************************************     HALFTREND & RSI 83,17  LongFlage & ShortFlage #5  is set here        ****************************************************************amplitude22 =1// input(title="Amplitude", defval=2)channelDeviation22 =2 //input(title="Channel Deviation", defval=2)//showArrows22 = input(title="Show Arrows", defval=true)//showChannels22 = input(title="Show Channels", defval=true)var int trend = 0var int nextTrend = 0var float maxLowPrice = nz(low[1], low)var float minHighPrice = nz(high[1], high)var float up = 0.0var float down = 0.0float atrHigh = 0.0float atrLow = 0.0float arrowUp = nafloat arrowDown = naatr2 = atr(100) / 2dev22 = channelDeviation22 * atr2highPrice = high[abs(highestbars(amplitude22))]lowPrice = low[abs(lowestbars(amplitude22))]highma = sma(high, amplitude22)lowma = sma(low, amplitude22)if nextTrend == 1    maxLowPrice := max(lowPrice, maxLowPrice)    if highma < maxLowPrice and close < nz(low[1], low)        trend := 1        nextTrend := 0        minHighPrice := highPriceelse    minHighPrice := min(highPrice, minHighPrice)    if lowma > minHighPrice and close > nz(high[1], high)        trend := 0        nextTrend := 1        maxLowPrice := lowPriceif trend == 0    if not na(trend[1]) and trend[1] != 0        up := na(down[1]) ? down : down[1]        arrowUp := up - atr2    else        up := na(up[1]) ? maxLowPrice : max(maxLowPrice, up[1])    atrHigh := up + dev22    atrLow := up - dev22else    if not na(trend[1]) and trend[1] != 1         down := na(up[1]) ? up : up[1]        arrowDown := down + atr2    else        down := na(down[1]) ? minHighPrice : min(minHighPrice, down[1])    atrHigh := down + dev22    atrLow := down - dev22ht = trend == 0 ? up : downvar color buyColor = color.bluevar color sellColor = color.redhtColor = trend == 0 ? buyColor : sellColor//htPlot = plot(ht, title="HalfTrend", linewidth=2, color=htColor)buySignal55 = not na(arrowUp) and (trend == 0 and trend[1] == 1)sellSignal55 = not na(arrowDown) and (trend == 1 and trend[1] == 0)halfTrend= barssince(buySignal55)>=0  and barssince(buySignal55) < barssince(sellSignal55) ? "Blue" : "Red" /// 1= Long , 0= Short//LongFlage5=  crossunder(rsi66,30) and  barssince(buySignal55)>0  and barssince(buySignal55) < barssince(sellSignal55) ? 1 :0//ShortFlage5= crossover(rsi66,70)  and  barssince(sellSignal55)>0  and  barssince(sellSignal55) < barssince(buySignal55) ? 1 :0//LongFlage5=  (rsi66<30   and  barssince(buySignal55)>0  and barssince(buySignal55) < barssince(sellSignal55)) ? 1 :0  // khate Abi//ShortFlage5= (rsi66>70  and  barssince(sellSignal55)>0  and  barssince(sellSignal55) < barssince(buySignal55))  ? 1 :0 //khate Ghermez//LongFlage5=  (shekasteRSItop and shekastCCItop and  barssince(buySignal55)>0  and barssince(buySignal55) < barssince(sellSignal55)) ? 1 :0  // khate Abi//ShortFlage5= (shekasteRSIkaf and shekastCCIkaf and  barssince(sellSignal55)>0  and  barssince(sellSignal55) < barssince(buySignal55))  ? 1 :0 //khate GhermezSHcciTop() =>    rsi66 = rsi(close,2)    rsi661 = rsi(close[1],2)    cci66= cci(close,2) // 5 bod    cci77 = open[0] > close[0] ? open[0]-close[0]>0.2 ? cci66+25 : 0 : close[0]-open[0]>0.2 ? cci66-25 : 0  // cci taghir yafteh bedelile candle bozorge // tashkise shekaste CCI 5 dar zire -155 va balaye 155     finalCCi= cci77==0 ? cci66 : cci77    cci07=cci(close[0],2)    cci17=cci(close[1],2)    cci27=cci(close[2],2)    maCCI=ema(cci07,2)        crossunder(cci07,maCCI) and cci17>55 and finalCCi==cci66  ? 1 : 0SHcciKaf() =>    rsi66 = rsi(close,2)    rsi661 = rsi(close[1],2)    cci66= cci(close,2) // 5 bod    cci77 = open[0] > close[0] ? open[0]-close[0]>0.2 ? cci66+25 : 0 : close[0]-open[0]>0.2 ? cci66-25 : 0  // cci taghir yafteh bedelile candle bozorge // tashkise shekaste CCI 5 dar zire -155 va balaye 155     finalCCi= cci77==0 ? cci66 : cci77    cci07=cci(close[0],2)    cci17=cci(close[1],2)    cci27=cci(close[2],2)    maCCI=ema(cci07,2)        crossover(cci07,maCCI) and cci17<-55 and finalCCi==cci66 ? 1:0SHrsiTop() =>    rsi07=cci(close[0],2)    rsi17=cci(close[1],2)    rsi27=cci(close[2],2)    maRSI=ema(rsi07,2)    crossunder(rsi07,maRSI) and rsi17>65 ? 1 : 0SHrsiKaf() =>    rsi07=cci(close[0],2)    rsi17=cci(close[1],2)    rsi27=cci(close[2],2)    maRSI=ema(rsi07,2)    crossover(rsi07,maRSI) and rsi17<35 ? 1 : 0LongFL5() =>    SHrsiKaf() and SHcciKaf() and barssince(buySignal55)>0  and barssince(buySignal55) < barssince(sellSignal55) ?1 : 0   // khate AbiShortFL5() =>    SHrsiTop() and SHcciTop() and barssince(sellSignal55)>0  and  barssince(sellSignal55) < barssince(buySignal55) ? 1 :0 //khate Ghermez//LongFlage5=  (shekasteRSIkaf and shekastCCIkaf and  barssince(buySignal55)>0  and barssince(buySignal55) < barssince(sellSignal55)) ? 1 :0  // khate Abi//ShortFlage5= (shekasteRSItop and shekastCCItop and  barssince(sellSignal55)>0  and  barssince(sellSignal55) < barssince(buySignal55))  ? 1 :0 //khate GhermezLongFL6() =>    rsi661 = rsi(close[1],2)    rsi661<33 and SHcciKaf() ?1 :0     ShortFL6() =>    rsi661 = rsi(close[1],2)    rsi661>67 and SHcciTop()//LongFlage6=  rsi661<33 and shekastCCIkaf ? 1 :0//ShortFlage6= rsi661>67 and shekastCCItop ? 1 :0/////Long5() =>    //***********************************************************************        END         *****************************************************************************//if rsi(close,14) < wma(rsi(14),14)  // LongFlage=0 // if open[1]<close[1]  and close[1]-open[1]>0.08 //   alert("OK", )//buystring  = "wrong buy"longentry0=longentry and longpositions and usebuyalert ? 1 :0shortentry0=shortentry and shortpositions and usesellalert ?1 :0 FinalLongSignal() => //FinalLongSignal1 = (longentry0  and LongFlage2 and LongFlage3 ) ? 1:0  // 54% sod ba dowm 42% //FinalLongSignal2 = longentry0 and LongFlage3 and  not ShortFlage5 ? 1 : 0//FinalLongSignal3 = (weaklongentrysignal and LongFlage and LongFlage2 and LongFlage3) and  not ShortFlage5 ? 1: 0 //FinalLongSignal4 = (weaklongentrysignal and LongFlage3) and  not ShortFlage5 ? 1: 0 //FinalLongSignal5 = (longentry0 and LongFlage4 and LongFlage3) and  not ShortFlage5 ? 1:0//FinalLongSignal6 = (weaklongentrysignal and LongFlage4 and LongFlage3) and  not ShortFlage5 ? 1: 0     (LongFL5() or LongFL2()) or LongFL6()//((LongFlage5 and LongFlage2) or LongFlage6)  and not weakshortentrysignal    ? 1: 0 //FinalLongSignal7 = LongFlage5 ? 1: 0 //FinalLongSignal8 = ((longentry0 or weaklongentrysignal) and LongFlage4 and LongFlage2 and LongFlage3) ?1:0 //and  not ShortFlage5 ? 1:0//FinalLongSignal= (FinalLongSignal1 or FinalLongSignal2 or FinalLongSignal3 or FinalLongSignal4 or FinalLongSignal5 or FinalLongSignal6//     or FinalLongSignal7 or FinalLongSignal8) //and rsi66<70 //? 1 : 0 //FinalLongSignal= FinalLongSignal7//FinalLongSignal= FinalLongSignal8//FinalLongSignal5 or FinalLongSignal6 and rsi66<70 //? 1 : 0 FinalShortSignal() =>//FinalShortSignal1 = (shortentry0 and ShortFlage2 and ShortFlage3)  ? 1 : 0//FinalShortSignal2 = (shortentry0 and ShortFlage3) and not LongFlage5 ? 1 : 0 //FinalShortSignal3 = (weakshortentrysignal and ShortFlage and ShortFlage2 and ShortFlage3) and not LongFlage5 ? 1 : 0 //FinalShortSignal4 = (weakshortentrysignal and ShortFlage3) and not LongFlage5 ? 1 : 0 //FinalShortSignal5 = (shortentry0 and ShortFlage4 and ShortFlage3) and not LongFlage5 ? 1 : 0//FinalShortSignal6 = (weakshortentrysignal and ShortFlage4 and ShortFlage3) and not LongFlage5 ? 1 : 0     (ShortFL5() and ShortFL2()) or ShortFL6()//((ShortFlage5 and ShortFlage2 )  or ShortFlage6) and not weaklongentrysignal  ? 1 : 0 //FinalShortSignal7 = ShortFlage5  ? 1 : 0 //FinalShortSignal8 = ((shortentry0 or weakshortentrysignal)and ShortFlage4 and ShortFlage2 and ShortFlage3) ?1:0//and not LongFlage5 ? 1 : 0 //FinalShortSignal = (FinalShortSignal1 or FinalShortSignal2 or FinalShortSignal3 or FinalShortSignal4 or FinalShortSignal5  or FinalShortSignal6//     or FinalShortSignal7 or FinalShortSignal8)// and rsi66>30 //? 1 :0 //FinalShortSignal = FinalShortSignal7//FinalShortSignal = FinalShortSignal5 or FinalShortSignal6  and rsi66>30//? 1 :0 //FinalShortSignal = FinalShortSignal8  //********************************************************* EXIT ************************************************************ExitLong() =>    rsi44 = rsi(close, 21)    k44 = ema(stoch(rsi44, rsi44, rsi44, 21), 3)    d44 = ema(k44, 3)//ExitLong=crossover(ma,70) ? 1:0 //midline=57    weakshortentrysignal and k44<d44 ? 1 : 0  //and FinalLongSignal!=1 ? 1:0 //midline=57//ExitLong = weakshortentrysignal and crossunder(k44,d44) and d44>60 ?1:0 //k44<d44 ? 1:0 //midline=57//if open[0] > close[0]ExitShort() =>    rsi44 = rsi(close, 21)    k44 = ema(stoch(rsi44, rsi44, rsi44, 21), 3)    d44 = ema(k44, 3)//ExitShort= crossunder(ma,30) ? 1:0 //midline=43    weaklongentrysignal and k44>d44 ? 1: 0 //and FinalShortSignal!=1 ? 1:0 //midline=43//ExitShort = weaklongentrysignal and crossover(k44,d44) and d44<40 ?1:0 //k44>d44 ? 1:0 //midline=43//ExitShort = (rsi661<8 and shekastCCIkaf) or buySignal55//and finalCCi<-150  ? 1:0 //midline=43 // for halfTrend exit EnterLong() =>    alert("EXIT-SHORT_BYBIT_LINKUSDT_mybybite-bot_10M_403d210eb46a9bd3", alert.freq_once_per_bar)    alert(buystring, alert.freq_once_per_bar)    LongPos = true    ShortPos= false    strategy.entry("LONG",1)EnterShort() =>    alert("EXIT-LONG_BYBIT_LINKUSDT_mybybite-bot_10M_403d210eb46a9bd3", alert.freq_once_per_bar)    alert(sellstring, alert.freq_once_per_bar)    ShortPos= true    LongPos = false    strategy.entry("SHORT",0)ExitPos() =>    if ExitLong() and not FinalLongSignal()  //and LongPos        alert("EXIT-LONG_BYBIT_LINKUSDT_mybybite-bot_10M_403d210eb46a9bd3", alert.freq_once_per_bar)        LongPos = false        strategy.close("LONG",1)//if ExitLong and not  //and LongPos  //  strategy.close("LONG",1)    if ExitShort() and not FinalShortSignal() //and ShortPos         alert("EXIT-SHORT_BYBIT_LINKUSDT_mybybite-bot_10M_403d210eb46a9bd3", alert.freq_once_per_bar)        ShortPos = false        strategy.close("SHORT",1)//if ExitShort //and ShortPos //    strategy.close("SHORT",1)//if rsi66>92  //    alert("EXIT-LONG_BYBIT_LINKUSDT_mybybite-bot_10M_403d210eb46a9bd3", alert.freq_once_per_bar)    //********************************************************************************************************************************//if FinalLongSignal==FinalShortSignal   //  FinalLongSignal=0   // FinalShortSignal=0//if ExitLong==ExitShort//    ExitLong=0  //  ExitShort=0   //ExitPos()  if  FinalLongSignal() and not ExitLong() //and not FinalShortSignal() // FinalLongSignal1 or FinalLongSignal2 or FinalLongSignal3 or FinalLongSignal4    EnterLong()    //strategy.entry("LONG",1,1,2,strategy.position_avg_price-0.50) //if  FinalLongSignal and not FinalShortSignal//    strategy.entry("LONG",1) //    LongPos = trueif FinalShortSignal() and not ExitShort() //and not FinalLongSignal()//FinalShortSignal1 or FinalShortSignal2 or FinalShortSignal3 or FinalShortSignal4     EnterShort()ExitPos()//    strategy.entry("SHORT",0,1,2,strategy.position_avg_price+0.50) //if FinalShortSignal and not FinalLongSignal//    strategy.entry("SHORT",0) //if (longentry and longpositions and usebuyalert and LongFlage and LongFlage2) or (longentry and longpositions and usebuyalert  and LongFlage3) or (weaklongentrysignal and LongFlage and LongFlage2 )//    alert(buystring, alert.freq_once_per_bar)//if (shortentry and shortpositions and usesellalert and ShortFlage and ShortFlage2 ) or (shortentry and shortpositions and usesellalert  and ShortFlage3 ) or (weakshortentrysignal and ShortFlage and ShortFlage2 )//    alert(sellstring, alert.freq_once_per_bar)//if printstoplong or printstopshort and usestopalert  //  alert(stopstring, alert.freq_once_per_bar)  //***********************************************************************  جدول وضعیت         *****************************************************************************var table LongPoss = table.new(position.bottom_center, 100, 100, border_width=2)//table.cell(LongPoss, 0, 0, text="     ", bgcolor=color.new(color.green, 50), text_color=color.red, text_size=size.small)//table.cell(LongPoss, 0, 1, text="STOCH-RSI", bgcolor=color.new(color.green, 50), text_color=color.red, text_size=size.small)//table.cell(LongPoss, 0, 2, text="RSI-MA 12,12", bgcolor=color.new(color.green, 50), text_color=color.red, text_size=size.small)//table.cell(LongPoss, 0, 3, text="Long Flage #5", bgcolor=color.new(color.green, 50), text_color=color.red, text_size=size.small)//table.cell(LongPoss, 0, 4, text="Short Flage #5", bgcolor=color.new(color.green, 50), text_color=color.red, text_size=size.small)//table.cell(LongPoss, 0, 5, text="Final Long Entery", bgcolor=color.new(color.green, 50), text_color=color.red, text_size=size.small)//table.cell(LongPoss, 0, 6, text="Final Short Entery", bgcolor=color.new(color.green, 50), text_color=color.red, text_size=size.small)//table.cell(LongPoss, 1, 0, text="UP", bgcolor=color.new(color.green, 50), text_color=color.red, text_size=size.small)//table.cell(LongPoss, 2, 0, text="DOWN", bgcolor=color.new(color.green, 50), text_color=color.red, text_size=size.small)//table.cell(LongPoss, 3, 0, text="UP Signal", bgcolor=color.new(color.green, 50), text_color=color.red, text_size=size.small)//table.cell(LongPoss, 4, 0, text="DOWN Signal", bgcolor=color.new(color.green, 50), text_color=color.red, text_size=size.small)//table.cell(LongPoss, 5, 0, text="Bars Since Crossed UP", bgcolor=color.new(color.green, 50), text_color=color.red, text_size=size.small)//table.cell(LongPoss, 6, 0, text="Bars Since Crossed DOWN", bgcolor=color.new(color.green, 50), text_color=color.red, text_size=size.small)//table.cell(LongPoss, 1, 1, text=tostring(StochRsiUP), bgcolor=color.new(color.green, 50), text_color=color.red, text_size=size.small)//table.cell(LongPoss, 1, 2, text=tostring(RsiMa1212UP), bgcolor=color.new(color.green, 50), text_color=color.red, text_size=size.small)//table.cell(LongPoss, 2, 1, text=tostring(StochRsiDOWN), bgcolor=color.new(color.green, 50), text_color=color.red, text_size=size.small)//table.cell(LongPoss, 2, 2, text=tostring(RsiMa1212DOWN), bgcolor=color.new(color.green, 50), text_color=color.red, text_size=size.small)//table.cell(LongPoss, 3, 1, text=tostring(StochRsiUpSignal), bgcolor=color.new(color.green, 50), text_color=color.red, text_size=size.small)//table.cell(LongPoss, 3, 2, text=tostring(RsiMa1212UpSignal), bgcolor=color.new(color.green, 50), text_color=color.red, text_size=size.small)//table.cell(LongPoss, 4, 1, text=tostring(StochRsiDownSignal), bgcolor=color.new(color.green, 50), text_color=color.red, text_size=size.small)//table.cell(LongPoss, 4, 2, text=tostring(RsiMa1212DownSignal), bgcolor=color.new(color.green, 50), text_color=color.red, text_size=size.small)//table.cell(LongPoss, 5, 1, text=tostring(barssince(crossover(k33,d33))), bgcolor=color.new(color.green, 50), text_color=color.red, text_size=size.small)//table.cell(LongPoss, 5, 2, text=tostring(barssince(crossover(rsi22,emaRSI22))), bgcolor=color.new(color.green, 50), text_color=color.red, text_size=size.small)//table.cell(LongPoss, 6, 1, text=tostring(barssince(crossunder(k33,d33))), bgcolor=color.new(color.green, 50), text_color=color.red, text_size=size.small)//table.cell(LongPoss, 6, 2, text=tostring(barssince(crossunder(rsi22,emaRSI22))), bgcolor=color.new(color.green, 50), text_color=color.red, text_size=size.small)//table.cell(LongPoss, 3, 3, text=tostring(LongFlage5), bgcolor=color.new(color.green, 50), text_color=color.red, text_size=size.small)//table.cell(LongPoss, 4, 4, text=tostring(ShortFlage5), bgcolor=color.new(color.green, 50), text_color=color.red, text_size=size.small)//table.cell(LongPoss, 3, 5, text=tostring(FinalLongSignal), bgcolor=color.new(color.green, 50), text_color=color.red, text_size=size.small)//table.cell(LongPoss, 4, 6, text=tostring(FinalShortSignal), bgcolor=color.new(color.green, 50), text_color=color.red, text_size=size.small)//************************************************************************************************************************************************************************  var table Pos = table.new(position.top_right, 100, 100, border_width=2)table.cell(Pos, 0, 0, text="RSI 66 ", bgcolor=color.new(color.green, 50), text_color=color.red, text_size=size.small)//table.cell(Pos, 0, 1, text="Final Long Signal # 1", bgcolor=color.new(color.green, 50), text_color=color.red, text_size=size.small)//table.cell(Pos, 0, 2, text="Final Long Signal # 2", bgcolor=color.new(color.green, 50), text_color=color.red, text_size=size.small)//table.cell(Pos, 0, 3, text="Final Long Signal # 3", bgcolor=color.new(color.green, 50), text_color=color.red, text_size=size.small)//table.cell(Pos, 0, 4, text="Final Long Signal # 4", bgcolor=color.new(color.green, 50), text_color=color.red, text_size=size.small)//table.cell(Pos, 0, 5, text="Final Long Signal # 5", bgcolor=color.new(color.green, 50), text_color=color.red, text_size=size.small)//table.cell(Pos, 0, 6, text="Final Long Signal # 6", bgcolor=color.new(color.green, 50), text_color=color.red, text_size=size.small)table.cell(Pos, 0, 7, text="Final Long Signal ", bgcolor=color.new(color.green, 50), text_color=color.red, text_size=size.small)//table.cell(Pos, 0, 6, text="Final Short Signal # 1", bgcolor=color.new(color.red, 50), text_color=color.white, text_size=size.small)//table.cell(Pos, 0, 7, text="Final Short Signal # 2", bgcolor=color.new(color.red, 50), text_color=color.white, text_size=size.small)//table.cell(Pos, 0, 8, text="Final Short Signal # 3", bgcolor=color.new(color.red, 50), text_color=color.white, text_size=size.small)//table.cell(Pos, 0, 9, text="Final Short Signal # 4", bgcolor=color.new(color.red, 50), text_color=color.white, text_size=size.small)//table.cell(Pos, 0, 10, text="Final Short Signal # 5", bgcolor=color.new(color.red, 50), text_color=color.white, text_size=size.small)//table.cell(Pos, 0, 11, text="Final Short Signal # 6", bgcolor=color.new(color.red, 50), text_color=color.white, text_size=size.small)table.cell(Pos, 0, 12, text="Final Short Signal ", bgcolor=color.new(color.red, 50), text_color=color.white, text_size=size.small)table.cell(Pos, 0, 13, text="Half Trend", bgcolor=color.new(color.red, 50), text_color=color.white, text_size=size.small)table.cell(Pos, 0, 14, text="Exit Long", bgcolor=color.new(color.red, 50), text_color=color.white, text_size=size.small)table.cell(Pos, 0, 15, text="Exit Short", bgcolor=color.new(color.red, 50), text_color=color.white, text_size=size.small)table.cell(Pos, 0, 16, text="Shek CCI TOP", bgcolor=color.new(color.red, 50), text_color=color.white, text_size=size.small)table.cell(Pos, 0, 17, text="Shek CCI Kaf", bgcolor=color.new(color.red, 50), text_color=color.white, text_size=size.small)table.cell(Pos, 0, 18, text="In Long POS", bgcolor=color.new(color.red, 50), text_color=color.white, text_size=size.small)table.cell(Pos, 0, 19, text="In Short POS", bgcolor=color.new(color.red, 50), text_color=color.white, text_size=size.small)//table.cell(Pos, 1, 0, text=tostring(rsi66), bgcolor=color.new(color.green, 50), text_color=color.red, text_size=size.small)//table.cell(Pos, 1, 1, text=tostring(FinalLongSignal1), bgcolor=color.new(color.green, 50), text_color=color.red, text_size=size.small)//table.cell(Pos, 1, 2, text=tostring(FinalLongSignal2), bgcolor=color.new(color.green, 50), text_color=color.red, text_size=size.small)//table.cell(Pos, 1, 3, text=tostring(FinalLongSignal3), bgcolor=color.new(color.green, 50), text_color=color.red, text_size=size.small)//table.cell(Pos, 1, 4, text=tostring(FinalLongSignal4), bgcolor=color.new(color.green, 50), text_color=color.red, text_size=size.small)//table.cell(Pos, 1, 5, text=tostring(FinalLongSignal5), bgcolor=color.new(color.green, 50), text_color=color.red, text_size=size.small)//table.cell(Pos, 1, 6, text=tostring(FinalLongSignal6), bgcolor=color.new(color.green, 50), text_color=color.red, text_size=size.small)//table.cell(Pos, 1, 7, text=tostring(FinalLongSignal), bgcolor=color.new(color.green, 50), text_color=color.red, text_size=size.small)//table.cell(Pos, 1, 6, text=tostring(FinalShortSignal1), bgcolor=color.new(color.green, 50), text_color=color.red, text_size=size.small)//table.cell(Pos, 1, 7, text=tostring(FinalShortSignal2), bgcolor=color.new(color.green, 50), text_color=color.red, text_size=size.small)//table.cell(Pos, 1, 8, text=tostring(FinalShortSignal3), bgcolor=color.new(color.green, 50), text_color=color.red, text_size=size.small)//table.cell(Pos, 1, 9, text=tostring(FinalShortSignal4), bgcolor=color.new(color.green, 50), text_color=color.red, text_size=size.small)//table.cell(Pos, 1, 10, text=tostring(FinalShortSignal5), bgcolor=color.new(color.green, 50), text_color=color.red, text_size=size.small)//table.cell(Pos, 1, 11, text=tostring(FinalShortSignal6), bgcolor=color.new(color.green, 50), text_color=color.red, text_size=size.small)//table.cell(Pos, 1, 12, text=tostring(FinalShortSignal), bgcolor=color.new(color.green, 50), text_color=color.red, text_size=size.small)a28=-129b28=19//table.cell(Pos, 1, 13, text=halfTrend, bgcolor=color.new(color.green, 50), text_color=color.red, text_size=size.small)//table.cell(Pos, 1, 14, text=tostring(ExitLong), bgcolor=color.new(color.green, 50), text_color=color.red, text_size=size.small)//table.cell(Pos, 1, 15, text=tostring(ExitShort), bgcolor=color.new(color.green, 50), text_color=color.red, text_size=size.small)//table.cell(Pos, 1, 16, text=tostring(shekastCCItop), bgcolor=color.new(color.green, 50), text_color=color.red, text_size=size.small)//table.cell(Pos, 1, 17, text=tostring(shekastCCIkaf), bgcolor=color.new(color.green, 50), text_color=color.red, text_size=size.small)//table.cell(Pos, 1, 18, text=tostring(LongPos), bgcolor=color.new(color.green, 50), text_color=color.red, text_size=size.small)//table.cell(Pos, 1, 19, text=tostring(ShortPos), bgcolor=color.new(color.green, 50), text_color=color.red, text_size=size.small)//END▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲////////////////////////////////////////////////////////////////////////////////