How To Import And Offset CSV Data
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © allanster

//@version=5
indicator("How To Import And Offset CSV Data")

bump = input(true, '', inline = '1') // Enable/Disable offset of origin bar.
date = input.time(timestamp("19 Feb 2022 00:00 +0000"), "Shift Origin To", tooltip = 'When enabled use this offset for origin bar of data range.', inline = '1')

indx = not bump ? 0 : ta.valuewhen(time == date, bar_index, 0) // Origin bar index.

var data  = array.new_float() // Create data array.
if bar_index == indx // If current bar is origin of data range populate the array.
    // Paste CSV 👇 Example Normalized Data From Yahoo Finance BTCUSD Daily Close From February 19th, 2022 Thru February 19th, 2023.
    data := array.from(
     40122.15625, 38431.37891, 37075.28125, 38286.02734, 37296.57031, 38332.60938, 39214.21875, 39105.14844, 37709.78516, 43193.23438, 44354.63672, 43924.11719, 42451.78906,
     39137.60547, 39400.58594, 38419.98438, 38062.03906, 38737.26953, 41982.92578, 39437.46094, 38794.97266, 38904.01172, 37849.66406, 39666.75391, 39338.78516, 41143.92969, 
     40951.37891, 41801.15625, 42190.65234, 41247.82422, 41077.99609, 42358.80859, 42892.95703, 43960.93359, 44348.73047, 44500.82813, 46820.49219, 47128.00391, 47465.73047, 
     47062.66406, 45538.67578, 46281.64453, 45868.94922, 46453.56641, 46622.67578, 45555.99219, 43206.73828, 43503.84766, 42287.66406, 42782.13672, 42207.67188, 39521.90234, 
     40127.18359, 41166.73047, 39935.51563, 40553.46484, 40424.48438, 39716.95313, 40826.21484, 41502.75000, 41374.37891, 40527.36328, 39740.32031, 39486.73047, 39469.29297, 
     40458.30859, 38117.46094, 39241.12109, 39773.82813, 38609.82422, 37714.87500, 38469.09375, 38529.32813, 37750.45313, 39698.37109, 36575.14063, 36040.92188, 35501.95313, 
     34059.26563, 30296.95313, 31022.90625, 28936.35547, 29047.75195, 29283.10352, 30101.26563, 31305.11328, 29862.91797, 30425.85742, 28720.27148, 30314.33398, 29200.74023, 
     29432.22656, 30323.72266, 29098.91016, 29655.58594, 29562.36133, 29267.22461, 28627.57422, 28814.90039, 29445.95703, 31726.39063, 31792.31055, 29799.08008, 30467.48828, 
     29704.39063, 29832.91406, 29906.66211, 31370.67188, 31155.47852, 30214.35547, 30111.99805, 29083.80469, 28360.81055, 26762.64844, 22487.38867, 22206.79297, 22572.83984, 
     20381.65039, 20471.48242, 19017.64258, 20553.27148, 20599.53711, 20710.59766, 19987.02930, 21085.87695, 21231.65625, 21502.33789, 21027.29492, 20735.47852, 20280.63477, 
     20104.02344, 19784.72656, 19269.36719, 19242.25586, 19297.07617, 20231.26172, 20190.11523, 20548.24609, 21637.58789, 21731.11719, 21592.20703, 20860.44922, 19970.55664, 
     19323.91406, 20212.07422, 20569.91992, 20836.32813, 21190.31641, 20779.34375, 22485.68945, 23389.43359, 23231.73242, 23164.62891, 22714.97852, 22465.47852, 22609.16406, 
     21361.70117, 21239.75391, 22930.54883, 23843.88672, 23804.63281, 23656.20703, 23336.89648, 23314.19922, 22978.11719, 22846.50781, 22630.95703, 23289.31445, 22961.27930, 
     23175.89063, 23809.48633, 23164.31836, 23947.64258, 23957.52930, 24402.81836, 24424.06836, 24319.33398, 24136.97266, 23883.29102, 23335.99805, 23212.73828, 20877.55273, 
     21166.06055, 21534.12109, 21398.90820, 21528.08789, 21395.01953, 21600.90430, 20260.01953, 20041.73828, 19616.81445, 20297.99414, 19796.80859, 20049.76367, 20127.14063, 
     19969.77148, 19832.08789, 19986.71289, 19812.37109, 18837.66797, 19290.32422, 19329.83398, 21381.15234, 21680.53906, 21769.25586, 22370.44922, 20296.70703, 20241.08984, 
     19701.21094, 19772.58398, 20127.57617, 19419.50586, 19544.12891, 18890.78906, 18547.40039, 19413.55078, 19297.63867, 18937.01172, 18802.09766, 19222.67188, 19110.54688, 
     19426.72070, 19573.05078, 19431.78906, 19312.09570, 19044.10742, 19623.58008, 20336.84375, 20160.71680, 19955.44336, 19546.84961, 19416.56836, 19446.42578, 19141.48438, 
     19051.41797, 19157.44531, 19382.90430, 19185.65625, 19067.63477, 19268.09375, 19550.75781, 19334.41602, 19139.53516, 19053.74023, 19172.46875, 19208.18945, 19567.00781, 
     19345.57227, 20095.85742, 20770.44141, 20285.83594, 20595.35156, 20818.47656, 20635.60352, 20495.77344, 20485.27344, 20159.50391, 20209.98828, 21147.23047, 21282.69141, 
     20926.48633, 20602.81641, 18541.27148, 15880.78027, 17586.77148, 17034.29297, 16799.18555, 16353.36523, 16618.19922, 16884.61328, 16669.43945, 16687.51758, 16697.77734, 
     16711.54688, 16291.83203, 15787.28418, 16189.76953, 16610.70703, 16604.46484, 16521.84180, 16464.28125, 16444.62695, 16217.32227, 16444.98242, 17168.56641, 16967.13281, 
     17088.66016, 16908.23633, 17130.48633, 16974.82617, 17089.50391, 16848.12695, 17233.47461, 17133.15234, 17128.72461, 17104.19336, 17206.43750, 17781.31836, 17815.65039, 
     17364.86523, 16647.48438, 16795.09180, 16757.97656, 16439.67969, 16906.30469, 16817.53516, 16830.34180, 16796.95313, 16847.75586, 16841.98633, 16919.80469, 16717.17383, 
     16552.57227, 16642.34180, 16602.58594, 16547.49609, 16625.08008, 16688.47070, 16679.85742, 16863.23828, 16836.73633, 16951.96875, 16955.07813, 17091.14453, 17196.55469, 
     17446.29297, 17934.89648, 18869.58789, 19909.57422, 20976.29883, 20880.79883, 21169.63281, 21161.51953, 20688.78125, 21086.79297, 22676.55273, 22777.62500, 22720.41602, 
     22934.43164, 22636.46875, 23117.85938, 23032.77734, 23078.72852, 23031.08984, 23774.56641, 22840.13867, 23139.28320, 23723.76953, 23471.87109, 23449.32227, 23331.84766, 
     22955.66602, 22760.10938, 23264.29102, 22939.39844, 21819.03906, 21651.18359, 21870.87500, 21788.20313, 21808.10156, 22220.80469, 24307.84180, na, na, na, 24601.94922
     )
    
    array.reverse(data) // Reverse index the data so that pop may be used instead of shift.

plot(array.size(data) < 1 ? na : array.pop(data), 'csv', #ffff00) // Plot and shrink dataset for bars within data range.