[FriZz]Watermark
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © FFriZz

//@version=5
indicator('[FFriZz]Watermark', '', true)
string ypos         = input.string('top', 'Position', inline='pos', options=['top', 'middle', 'bottom'])
int UTC             = input.int(-5,'UTC',minval=-18,maxval = 18,group = 'Time Adjust')
string xpos         = input.string('right', '', inline='pos', options=['left', 'right', 'center'])
string tok          = input.session('1900-0400','Tokyo',group='Sessions',inline='')
string lon          = input.session('0200-1100','London',group='Sessions',inline='')
string ny           = input.session('0800-1700','New York',group='Sessions',inline='')
string sesclosed    = input.session('1600-1900','Sessions Closed',group='Sessions',inline='')
string tva1         = input.string(text.align_center,'Textbox #1',group = 'Text align/Size',inline = 'tb1',options = [text.align_top, text.align_center, text.align_bottom])
string tha1         = input.string(text.align_center,'',group = 'Text align/Size',inline = 'tb1',options = [text.align_left, text.align_center, text.align_right])
string tva12        = input.string(text.align_center,'Textbox #2',group = 'Text align/Size',inline = 'tb2',options = [text.align_top, text.align_center, text.align_bottom])
string tha12        = input.string(text.align_center,'',group = 'Text align/Size',inline = 'tb2',options = [text.align_left, text.align_center, text.align_right])
string textsize1    = input.string('normal', '',inline = 'tb1',group = 'Text align/Size', options=['tiny', 'small', 'normal', 'large', 'huge', 'auto'])
string textsize2    = input.string('normal', '',inline = 'tb2',group = 'Text align/Size', options=['tiny', 'small', 'normal', 'large', 'huge', 'auto'])
color color         = input(color.new(#000000, transp=0),'TextBox 1',group = 'Text Colors')
color color2        = input(color.new(#000000, transp=0),'TextBox 2',group = 'Text Colors')
//[
string ticker2      = input.symbol('BTCUSDTPERP','Ticker2',group = 'Extra Ticker')
string t2           = array.get(str.split(ticker2,':'),1)
string exampleBox   = input.text_area('EXAMPLES USE BOXES BELOW\nBy: [FrizLabz] | Options▼▼▼ Can use TextBox 1 or 2 all boxes can have different color text\nUse the words at the bottom of this box Case matched and Spelled correctly it will only replace the word so you can use whatever else youd like as long the word is correct\nSpecial Chars. @ Bottom\n\nOptions\n----------------\nTF\nTicker\nTicker2\nVolume\nOpen\nClose\nHigh\nLow\nDay\nDate\nTime\nSession\nSessionTime','EXAMPLES/INTRUCTIONS',group = '')
string textbox1     = input.text_area('@FFriZz | FrizLabz','TextBox 1',group = '')
string textbox2     = input.text_area('Date\nTicker | TF\nSession | Time','TextBox 2',group = '')
string texttt       = input.text_area(
 '𝓪𝓫𝓬𝓭𝓮𝓯𝓰𝓱𝓲𝓳𝓴𝓵𝓶𝓷𝓸𝓹𝓺𝓻𝓼𝓽𝓾𝓿𝔀𝔁𝔂𝔃'+
 'ａｂｃｄｅｆｇｈｉｊｋｌｍｎｏｐｑｒｓｔｕｖｗｘｙｚ'+
 '🇦🇧🇨🇩🇪🇫🇬🇭🇮🇯🇰🇱🇲🇳🇴🇵🇶🇷🇸🇹🇺🇻🇼🇽🇾🇿'+
 '🅐🅑🅒🅓🅔🅕🅖🅗🅘🅙🅚🅛🅜🅝🅞🅟🅠🅡🅢🅣🅤🅥🅦🅧🅨🅩'+
 'ⒶⒷⒸⒹⒺⒻⒼⒽⒾⒿⓀⓁⓂⓃⓄⓅⓆⓇⓈⓉⓊⓋⓌⓍⓎⓏ'+
 '𝒜ℬ𝒞𝒟ℰℱ𝒢ℋℐ𝒥𝒦ℒℳ𝒩𝒪𝒫𝒬ℛ𝒮𝒯𝒰𝒱𝒲𝒳𝒴𝒵'+
 '𝓐𝓑𝓒𝓓𝓔𝓕𝓖𝓗𝓘𝓙𝓚𝓛𝓜𝓝𝓞𝓟𝓠𝓡𝓢𝓣𝓤𝓥𝓦𝓧𝓨𝓩'+
 '𝓪𝓫𝓬𝓭𝓮𝓯𝓰𝓱𝓲𝓳𝓴𝓵𝓶𝓷𝓸𝓹𝓺𝓻𝓽𝓾𝓿𝔀𝔁𝔂𝔃'+
 '𝐚𝐛𝐜𝐝𝐞𝐟𝐠𝐡𝐢𝐣𝐤𝐥𝐦𝐧𝐨𝐩𝐪𝐫𝐬𝐭𝐮𝐯𝐰𝐱𝐲𝐳'+
 '𝕒𝕓𝕔𝕕𝕖𝕗𝕘𝕙𝕚𝕛𝕜𝕝𝕞𝕟𝕠𝕡𝕢𝕣𝕤𝕥𝕦𝕧𝕨𝕩𝕪𝕫'+
 'ᴀʙᴄᴅᴇғɢʜɪᴊᴋʟᴍɴᴏᴘǫʀsᴛᴜᴠᴡxʏᴢ'+
 '𝕬𝕭𝕮𝕯𝕰𝕱𝕲𝕳𝕴𝕵𝕶𝕷𝕸𝕹𝕺𝕻𝕼𝕽𝕾𝕿𝖀𝖁𝖂𝖃𝖄𝖅'+
 '↦↧↨↩↪↫↬↭↮↯↰↱↲↳↴↶↷↸↹↺↻⟳↼↽↾↿⇀⇁⇂⇃⇄⇅⇆⇇㊊㊋㊌㊍㊎㊏㊐㊑㊒㊓㊔㊕㊖㊗㊘㊙㊚㊛㊜㊝㊞㊟㊠㊡㊢㊣㊤㊥㊦㊧㊨㊩㊪㊫㊬㊭㊮㊯㊰☠⚰☤☥☦☧☨☩☪☫☬☮☭☯☸☽☾✙✚✛✜✝▒▓░'+
 '▁▂▄▅▆▇██▇▆▅▄▂▁'+
 '•·∙⊙⊚⊛◉○◌◍◎●◘◦。☉⦾⦿⁃⁌⁍◆◇◈★☆■□☐☑☒✓✔❖'+
 'ϟ☽☾ϟ☽☾〔〕︽︾〖〗〘〙〚〛《》♔♕♖♗♘♙♚♛♜♝♞♟♤♠♧♣♡♥♢♦↕↖↗↘↙↚↛↜↝↞↟↠↡↢↣↤↥↦↧↨↩↪↫↬↭↮↯↰↱↲↳↴↶↷↸↹↺↻↼↽↾↿⇀⇁⇂⇃⇄⇅⇆⇇⇈⇉⇊⇋⇌⇍⇎⇏⇕⇖⇗⇘⇙⇚⇛⇜⇝⇞⇟⇠⇡⇢⇣⇤⇥⇦⇧⇨⇩⇪⌅⌆⌤⏎▶☇☈☊☋☌☍➔➘➙➚➛➜➝➞➟➠➡➢➣➤➥➦'+
 '➧➨➩➪➫➬➭➮➯➱➲➳➴➵➶➷➸➹➺➻➼➽➾⤴⤵↵↓↔←→↑⌦⌫⌧⇰⇫⇬⇭⇳⇮⇯⇱⇲⇴⇵⇷⇸⇹⇺⇑⇓⇽⇾⇿⬳⟿⤉⤈⇻⇼⬴⤀⬵⤁⬹⤔⬺⤕⬶⤅⬻⤖⬷⤐⬼⤗⬽⤘⤝⤞⤟⤠⤡⤢⤣⤤⤥⤦⤪⤨⤧⤩⤭⤮⤯⤰⤱⤲⤫⤬⬐⬎⬑⬏⤶⤷⥂⥃⥄⭀⥱⥶⥸⭂⭈⭊⥵⭁⭇⭉⥲⭋⭌⥳⥴⥆⥅⥹⥻⬰⥈⬾⥇⬲⟴⥷⭃⥺⭄⥉⥰⬿⤳⥊⥋⥌⥍⥎⥏⥐⥑⥒⥓⥔⥕⥖⥗⥘⥙⥚⥛⥜⥝⥞⥟⥠⥡⥢⥤⥣'+
 '⥥⥦⥨⥧⥩⥮⥯⥪⥬⥫⥭⤌⤍⤎⤏⬸⤑⬱⟸⟹⟺⤂⤃⤄⤆⤇⤊⤋⭅⭆⟰⟱⇐⇒⇔⇶⟵⟶⟷⬄⬀⬁⬂⬃⬅⬆⬇⬈⬉⬊⬋⬌⬍⟻⟼⤒⤓⤙⤚⤛⤜⥼⥽⥾⥿⤼⤽⤾⤿⤸⤺⤹⤻⥀⥁⟲⟳☮☸♈♉☪♊♋♌♍♎♏♐♑♒♓☤☥☧☨☩☫☬☭☯☽☾✙✚✛✜✝✞✟†⊹‡♁♆❖♅✠✡✢〷☠☢☣☦π∞Σ√∛∜∫∬∭∮∯∰∱∲∳∀∁∂∃∄∅∆∇∈∉∊∋∌∍∎∏∐∑−∓∔∕∖∗∘∙∝∟∠∡∢∣∤∥∦∧∨∩∪∴∵∶∷∸∹∺∻∼∽∾∿≀≁≂≃≄≅≆≇≈≉≊≋≌≍≎≏≐≑≒≓'+
 '≔≕≖≗≘≙≚≛≜≝≞≟≠≡≢≣≤≥≦≧≨≩≪≫≬≭≮≯≰≱≲≳≴≵≶≷≸≹≺≻≼≽≾≿⊀⊁⊂⊃⊄⊅⊆⊇⊈⊉⊊⊋⊌⊍⊎⊏⊐⊑⊒⊓⊔⊕⊖⊗⊘⊙⊚⊛⊜⊝⊞⊟⊠⊡⊢⊣⊤⊥⊦⊧⊨⊩⊪⊫⊬⊭⊮⊯⊰⊱⊲⊳⊴⊵⊶⊷⊸⊹⊺⊻⊼⊽⊾⊿⋀⋁⋂⋃⋄⋅⋆⋇⋈⋉⋊⋋⋌⋍⋎⋏⋐⋑⋒⋓⋔⋕⋖⋗⋘⋙⋚⋛⋜⋝⋞⋟⋠⋡⋢⋣⋤⋥⋦⋧⋨⋩⋪⋫⋬⋭⋮⋯⋰⋱⁺⁻⁼⁽⁾ⁿ₊₋₌₍₎✖﹢﹣＋－／＝÷±×ⅠⅡⅢⅣⅤⅥⅦⅧⅨⅩⅪⅫⅬⅭⅮⅯⅰⅱⅲⅳⅴⅵⅶⅷⅸⅹⅺⅻⅼⅽⅾⅿↀↁↂ➀➁➂➃➄➅➆➇➈➉➊➋➌➍➎➏➐➑➒➓⓵⓶⓷⓸⓹⓺⓻⓼⓽⓾⓿❶❷❸❹❺❻❼❽❾❿⁰¹²³⁴⁵⁶⁷⁸⁹₀'+
 '₁₂₃₄₅₆₇₈₉⓪①②③④⑤⑥⑦⑧⑨⑩⑪⑫⑬⑭⑮⑯⑰⑱⑲⑳⑴⑵⑶⑷⑸⑹⑺⑻⑼⑽⑾⑿⒀⒁⒂⒃⒄⒅⒆⒇⒈⒉⒊⒋⒌⒍⒎⒏⒐⒑⒒⒓⒔⒕⒖⒗⒘⒙⒚⒛㈠㈡㈢㈣㈤㈥㈦㈧㈨㈩㊀㊁㊂㊃㊄㊅㊆㊇㊈㊉０１２３４'+
 '５６７８９ⁱₐₑₒₓₔ❏❐❑❒▀▁▂▃▄▅▆▇▉▊▋█▌▐▍▎▏▕░▒▓▔▬▢▣▤▥▦▧▨▩▪▫▭▮▯☰☲☱☴☵☶☳☷▰▱◧◨◩◪◫∎■□⊞⊟⊠⊡❘❙❚〓◊◈◇◆⎔⎚☖☗◄▲▼►◀◣◥◤◢▶◂'+
 '▴▾▸◁△▽▷∆∇⊳⊲⊴⊵◅▻▵▿◃▹◭◮⫷⫸⋖⋗⋪⋫⋬⋭⊿◬≜⑅│┃╽'+
 '╿╏║╎┇︱┊︳┋┆╵〡〢╹╻╷〣☰☱☲☳☴☵☶☷≡✕═━─╍┅┉┄┈╌╴╶╸╺╼╾﹉﹍﹊﹎︲⑆'+
 '⑇⑈⑉⑊⑄⑀︴﹏﹌﹋╳╲╱︶︵〵〴〳〆`ᐟ‐⁃⎯〄﹄﹃﹂﹁┕┓└┐┖┒┗┑┍┙┏┛┎┚┌┘「」『』˩˥├┝┞┟┠┡┢┣┤┥┦'+
 '┧┨┩┪┫┬┭┮┯┰┱┲┳┴┵┶┷┸┹┺┻┼┽┾┿╀╁╂╃╄╅╆╇╈╉╊╋╒╕╓╖╔╗╘╛╙╜╚╝╞╡╟╢╠╣╥╨╧╤╦╩╪╫╬〒⊢⊣⊤⊥╭╮╯╰⊦⊧⊨⊩⊪⊫⊬⊭⊮⊯⊺〦〧〨˦˧˨⑁⑂⑃∟◉○◌◍◎●◐◑◒◓◔◕◖◗❂☢⊗⊙◘◙◚◛◜◝◞◟◠◡◯〇〶⚫⬤◦∅∘⊕⊖⊘⊚⊛⊜⊝❍⦿😂😄😃😀😊😉😍😘😚'+
 '😗😙😜😝😛😳😁😔😌😒😞😣😢😭😪😥😰😅😓😩😫😨😱😠😡😤😖😆😋😷😎😴😵😲😟😦😧😈👿😮😬😐😕😯😶😇☺️😏😑🙃🙄☹️🤐🤑🤒🤓🤔🤕🙁🙂🤗🤣🤠🤥🤤🤢🤧🤡🤖🖤💛💙💜💚🧡❤️️💔💗💓💕💖💞💘💝❣️💌💋😺😸😻😽😼🙀😿😹😾🙈🙉🙊💀👽👹👺🤩🤨🥺️🤯🤪🤬🤮🤫🤭🧐🥰️🥵️🥶️🥴️♾️♀️♂️⚧️⚕️➰➿💲💱©️®️™️〰️🔠🔡🔤ℹ️🆗🆕🆙🆒🆓🆖📶🎦🚻🚹🚺🚼🚾🚮🅿️♿️Ⓜ️🛂🛄🛅🛃🆑🆘🆚🚫🚭🔞📵🚯🚱🚳🚷🚸⛔️⚠️🛑🚧✳️❇️❎✅✴️💟📳📴🅰️🅱️🆎🅾️💠♻️🏧🚰💹〽️❌⭕️❗️❓❕❔🕛🕧🕐🕜🕑🕝🕒🕞🕓🕟🕔🕠🕕🕖🕗🕘🕙🕚🕡🕢🕣🕤🕥🕦🔟🔢#️⃣🔣⏭⏮⏯*️⃣⏸⏹⏺⏏️☢️☣️➕➖✖️➗♥️♦️♣️♠️💮💯💫💥💢💦💤💨✔️☑️🔘🔗🔱🔲🔳⬜️⬛️◼️◻️◾️◽️▪️▫️🔺⚫️⚪️🔴🔵🔻🔶🔷🔸🔹⁉️‼️🔰🆔*️⃣🛗☮️🛐🕎✝'+
 '️✡️☦️☪️☯️☸️⚛️♈️♉️♊️♋️♌️♍️♎️♏️♐️♑️♒️♓️⛎🔯🈁🈯️🈳🈵🈴🈲🉐🈹🈺🈶🈚️🈷️🈸🈂️🉑㊙️㊗️☕️🍵🍶🍺🍻🍸🍹🍷🍴🍕🍔🍟🍗🍖🍝🍛🍤🍱🍣🍥🍙🍘🍚🍜🍲🍢🍡🍳🍞🍩🍮🍦🍨🍧🎂🍰🍪🍫🍬🍭🍯🍎🍏🍊🍋🍒🍇🍉🍓🍑🍈🍌🍐🍍🍠🍆🍅🌽🌶🌭🌮🌯🍾🍿🥝🥑🥔🥕🥒🥜🥐🥖🥞🥓🥙🥚🥘🥗🥛🥥🥦🥨🥩🥪🥣🥫🥟🥠🥡🥧🥤🥢🥭️🥬️🥯️🧂️🥮️🦞️🧁️👍👎👌👊✊✌️👋✋👐👆👇👉👈🙌🙏💪🖖🖐☝️👏✍️🤘🖕🤞🤙🤛🤜🤚🤝🤟🤲🏴󠁧󠁢󠁥󠁮󠁧󠁿🏴󠁧󠁢󠁳󠁣󠁴󠁿🏴󠁧󠁢󠁷󠁬󠁳󠁿🇺🇳🚩🏳🏴🏳️‍🌈🏴‍☠️️🎲🎯'+
 '🏈🏀️⚽️⚾️🎾🎱🏉🎳️⛳️🏁🏇🏆⛷⛸🏏🏐🏑🏒🏓🏸🏹🏂🏍🏎🤺🥅🥇🥈🥉🥊🥋🤼🤼‍♂️🎣🥌🐶🐺🐱🐭🐹🐰🐸🐯🐨🐻🐷🐽🐮🐗🐵🐒🐴🐑🐘🐼🐧🐦🐤🐥🐣🐔🐍🐢🐛🐝🐜🐿🐞🐌🐙🐚🐠🐟🐬🐳🐋🐄🐏🐀🐃🐅🐇🐉🐎🐐🐓🐕🐖🐁🐂🐲🐡🐊🐫🐪🐆🐈🐩🐾🦀🦁🦂🕷🦃🦄🦐🦑🦋🦍🦊🦌🦏🦇🦅🦆🦉🦎🦈🦓🦒🦔🦕🦖🦝️🦙️🦛️🦘️🦡️🦢️🦚️🦜️🦟️🐻‍❄️🦭🐃🪱🦬🪳🦣🦤🐈‍⬛'
 ,'Special Chars.',group='')//]

string fDay = input.string('E', 'Formatting | Day:',inline = 'f',group = 'Formatting',tooltip = 'You can google Java Date Formatting for Examples\n 12h clock use hh \n24h clock use HH')
string fDate = input.string('MM/dd/yy', 'Date:',inline = 'f',group = 'Formatting')
string fTime = input.string('hh:mm:ssa', 'Time:',inline = 'f',group = 'Formatting')

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

timeSes(ses,int = 1) =>
    str = ''
    if int == 1
        str := str.substring(ses,0,4)
    if int == 2
        str := str.substring(ses,4,9)
    str
    
Time(Unix, format) => str.format("{0,time," + format + "}", int(Unix))
    
string tfm = ''
tfs = timeframe.in_seconds()
if tfs < 60
    tfm := str.tostring(tfs) + 's'
if tfs >= 60
    tfm := timeframe.period + 'm'
if timeframe.isminutes 
    if tfs >= (60 * 60)
        tfm := str.tostring(str.tonumber(timeframe.period) / 60) + 'h'
if timeframe.isdwm
    tfm := timeframe.period

////////////////////////////////////////////////////////////////////////////////
string utcStr   = ''
if UTC > 0
    utcStr      := 'UTC+' + str.tostring(UTC)
if UTC <= 0
    utcStr      := 'UTC' + str.tostring(UTC)

int Tok         = time('', tok,utcStr)
int Lon         = time('', lon,utcStr)
int Ny          = time('', ny,utcStr)
int Sesclosed   = time('', sesclosed,utcStr)

var Session     = ''
var session     = ''
var sessionTime = ''
if Tok
    Session     := 'Tokyo | ' + tok
    session     := 'Tokyo'
    sessionTime := tok
if Lon 
    Session     := 'London | ' + lon
    session     := 'London'
    sessionTime := lon
if Ny
    Session     := 'New York | ' + ny
    session     := 'New York'
    sessionTime := ny
if Tok and Lon 
    Session     := 'Tokyo/London OverLap | ' + timeSes(tok) + timeSes(lon,2)
    session     := 'Tokyo/London'
    sessionTime := timeSes(lon) + timeSes(tok,2)
if Lon and Ny
    Session     := 'London/New York OverLap | ' + timeSes(lon) + timeSes(ny,2)
    session     := 'London/New York'
    sessionTime := timeSes(ny) + timeSes(lon,2)
if Sesclosed 
    Session     := 'SessionsClosed | ' + sesclosed
    session     := 'Closed'
    sessionTime := sesclosed
    
////////////////////////////////////////////////////////////////////////////////

close2 = request.security(ticker2,'',close)
UTC := UTC * 3600000

strReplace(textbox) =>
    str = textbox
    str := str.replace_all(str,'Volume',str.tostring(volume))
    str := str.replace_all(str,'Open',str.tostring(open))
    str := str.replace_all(str,'Close',str.tostring(close))
    str := str.replace_all(str,'High',str.tostring(high))
    str := str.replace_all(str,'Low',str.tostring(low))
    str := str.replace_all(str,'Ticker2',t2 + ': ' +str.tostring(close2))
    str := str.replace_all(str,'Ticker',syminfo.ticker)
    str := str.replace_all(str,'TF',str.tostring(tfm))
    str := str.replace_all(str,'Day',Time(timenow + UTC,fDay))
    str := str.replace_all(str,'Date',Time(timenow + UTC,fDate))
    str := str.replace_all(str,'Time',Time(timenow + UTC,fTime))
    str := str.replace_all(str,'Session',session)
    str := str.replace_all(str,'SessionTime',sessionTime)
    str

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

tn = Time(timenow + UTC,'HH:mm:ssa') + '\nCurrent Session: ' + Session
var table Table = table.new(ypos + '_' + xpos, 2, 1)
if barstate.islast
    table.cell(Table, 0, 0,strReplace(textbox1), 0, 0, color, text_size = textsize1 ,text_valign = tva1,text_halign = tha1)
    table.cell(Table, 1, 0,strReplace(textbox2), 0, 0,text_color = color2,text_halign = tha12,text_valign = tva12,text_size = textsize2,
     tooltip = '------------------- Sessions🕧 -----------------\n' +
     '-- Tokyo: '+ tok + 
     '\n-- Tokyo/London overlap: '+ timeSes(lon) + timeSes(tok,2) +
     '\n-- London: '+ lon +
     '\n-- NY/London overlap: '+ timeSes(ny) + timeSes(lon,2) +
     '\n-- New York: '+ ny +
     '\n-- Sessions Closed: '+ sesclosed +
     '\n------------------------------------\nTime: ' + 
     tn + '\n------------------------------------') 
























