-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstock_test.go
More file actions
35 lines (25 loc) · 32.6 KB
/
stock_test.go
File metadata and controls
35 lines (25 loc) · 32.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
package main
import (
"testing"
)
var st Stock
func BenchmarkStock(b *testing.B) {
price := "name: 'Price',\n data: [[1642723200000,4.66],[1642982400000,4.6],[1643068800000,4.6],[1643155200000,4.2],[1643241600000,4.25],[1643328000000,4.5],[1643587200000,4.5],[1643673600000,4.6],[1643760000000,4.533122],[1643846400000,4.586861],[1643932800000,4.293487],[1644192000000,4.553975],[1644278400000,4.715466],[1644364800000,4.921166],[1644451200000,4.934958],[1644537600000,7.324934],[1644796800000,8.048739],[1644883200000,7.416208],[1644969600000,6.44341],[1645056000000,7.418727],[1645142400000,5.593384],[1645401600000,5.126693],[1645488000000,5.248479],[1645574400000,5.25],[1645660800000,5.005635],[1645747200000,5.088323],[1646006400000,5.215401],[1646092800000,5.145707],[1646265600000,5.197782],[1646352000000,5.2],[1646611200000,5.05],[1646697600000,5.139978],[1646784000000,5.222668],[1646870400000,5.247093],[1646956800000,5.238723],[1647216000000,5.233972],[1647302400000,5.25],[1647388800000,5.25],[1647475200000,5.024122],[1647561600000,5],[1647820800000,5],[1647907200000,4.999964],[1647993600000,5],[1648080000000,5],[1648166400000,4.999511],[1648425600000,5],[1648512000000,5],[1648598400000,5],[1648684800000,4.999839],[1648771200000,4.990013],[1649030400000,5],[1649116800000,5.000002],[1649203200000,5.204359],[1649289600000,5.002977],[1649376000000,5.000653],[1649635200000,5.000309],[1649721600000,5.239027],[1649808000000,5.245976],[1649894400000,5.001312],[1650326400000,5.25],[1650412800000,5.107814],[1650499200000,5.012408],[1650585600000,5],[1650844800000,5.134851],[1650931200000,5.044736],[1651017600000,5.209941],[1651104000000,5.25],[1651190400000,5.032441],[1651449600000,5.25],[1651536000000,5.136588],[1651622400000,5.23006],[1651708800000,5.2],[1651795200000,5.15319],[1652054400000,4.805436],[1652140800000,5.237451],[1652227200000,5.243328],[1652313600000,4.409349],[1652400000000,5],[1652659200000,5.247731],[1652745600000,5.25],[1652832000000,5.24],[1652918400000,4.746818],[1653004800000,5.17],[1653350400000,5.166982],[1653436800000,5.18],[1653523200000,4.760266],[1653609600000,5.225647],[1653868800000,5.157363],[1653955200000,5.19],[1654041600000,5.19],[1654128000000,5.19],[1654214400000,5.19],[1654473600000,5.19],[1654560000000,5.19],[1654646400000,5.19],[1654732800000,5.19],[1654819200000,5.19],[1655078400000,4.825861],[1655164800000,5.162534],[1655251200000,4.927003],[1655337600000,4.91],[1655424000000,4.76],[1655683200000,4.781828],[1655769600000,4.904043],[1655856000000,4.787327],[1655942400000,4.787327],[1656028800000,5.052],[1656288000000,4.83007],[1656374400000,5.1],[1656460800000,5.1],[1656547200000,5.189674],[1656633600000,5.1],[1656892800000,4.82],[1656979200000,5.09],[1657065600000,4.794732],[1657152000000,5.175222],[1657238400000,4.780031],[1657497600000,4.96217],[1657584000000,4.988947],[1657670400000,4.77],[1657756800000,5.012834],[1657843200000,5.16],[1658102400000,5.013714],[1658188800000,5.15],[1658275200000,4.394379],[1658361600000,4.394379],[1658448000000,4.394379],[1658707200000,4.342139],[1658793600000,4.389895],[1658880000000,5.0001],[1658966400000,5.00439],[1659052800000,5.002015],[1659398400000,5.000312],[1659484800000,5.05],[1659571200000,4.833126],[1659657600000,4.90192],[1659916800000,4.924918],[1660003200000,5.103788],[1660089600000,5.005754],[1660176000000,5.014286],[1660262400000,5.025034],[1660521600000,5.003115],[1660608000000,5.099647],[1660694400000,5.14],[1660780800000,5.076029],[1660867200000,5.14],[1661126400000,5.174677],[1661212800000,5.195583],[1661299200000,5.909985],[1661385600000,5.930768],[1661472000000,7.0106],[1661731200000,7.225188],[1661817600000,5.3],[1661904000000,4.760331],[1661990400000,5.275127],[1662076800000,6.65898],[1662336000000,6.072951],[1662422400000,6.97396],[1662508800000,6.786618],[1662595200000,6.921286],[1662681600000,6.853725],[1662940800000,6.800824],[1663027200000,6.447236],[1663113600000,6.726598],[1663200000000,5.687479],[1663286400000,5.55547],[1663545600000,5.56],[1663632000000,6.286856],[1663718400000,6.29],[1663804800000,6.410861],[1663891200000,6.218919],[1664150400000,5.54],[1664236800000,5.736383],[1664323200000,5.671377],[1664409600000,5.500058],[1664496000000,5.333074],[1664755200000,5.972549],[1664841600000,5.530992],[1664928000000,5.948979],[1665014400000,6],[1665100800000,5.963045],[1665360000000,5.56],[1665446400000,5.509317],[1665532800000,5.592647],[1665619200000,5.53],[1665705600000,5.52],[1666051200000,5.04],[1666137600000,5.12],[1666224000000,5.17],[1666310400000,5.6],[1666569600000,5.24],[1666656000000,5.52],[1666742400000,5.6],[1666828800000,5.6],[1666915200000,5.63],[1667174400000,5.96],[1667260800000,6.52],[1667347200000,5.52],[1667433600000,5.5],[1667520000000,4.92],[1667779200000,4.09],[1667865600000,4.74],[1667952000000,4.26],[1668038400000,4.5],[1668124800000,4.51],[1668384000000,5.11],[1668470400000,4.69],[1668556800000,4.55],[1668643200000,4.58],[1668729600000,4.5],[1668988800000,4.7],[1669075200000,4.39],[1669161600000,4.35],[1669248000000,4.57],[1669334400000,4.58],[1669593600000,4.88],[1669680000000,4.98],[1669766400000,5],[1669852800000,5.05],[1669939200000,5.2],[1670198400000,4.99],[1670284800000,5.18],[1670371200000,5.09],[1670457600000,5.11],[1670544000000,5.1],[1670803200000,5.1],[1670889600000,5.42],[1670976000000,5.73],[1671062400000,5],[1671148800000,5.71],[1671408000000,5.65],[1671494400000,5.01],[1671580800000,5],[1671667200000,5],[1671753600000,5],[1672185600000,5],[1672272000000,5],[1672358400000,5],[1672704000000,5],[1672790400000,5],[1672876800000,5],[1672963200000,5],[1673222400000,4.96],[1673308800000,4.95],[1673395200000,4.99],[1673481600000,4.99],[1673568000000,4.97],[1673827200000,4.96],[1673913600000,4.98],[1674000000000,4.54],[1674086400000,4.78],[1674172800000,4.97],[1674432000000,4.93],[1674518400000,4.67],[1674604800000,4.92],[1674691200000,4.94],[1674777600000,4.91],[1675036800000,5],[1675123200000,5],[1675209600000,5],[1675296000000,5.06],[1675382400000,5.78],[1675641600000,5.8],[1675728000000,5.88],[1675814400000,5.72],[1675900800000,4.85],[1675987200000,4.69],[1676246400000,4.52],[1676332800000,4.83],[1676419200000,4.9],[1676505600000,4.86],[1676592000000,4.58],[1676851200000,4.97],[1676937600000,4.76],[1677110400000,5],[1677196800000,5.01],[1677456000000,5.19],[1677542400000,5.01],[1677628800000,5.46],[1677715200000,5.5],[1677801600000,5.49],[1678060800000,5.33],[1678147200000,5.49],[1678233600000,5.46],[1678320000000,5.27],[1678406400000,5.18],[1678665600000,5.17],[1678752000000,5.44],[1678838400000,5.27],[1678924800000,5.49],[1679011200000,5.5],[1679270400000,5.42],[1679356800000,5.47],[1679443200000,5.11],[1679529600000,5.4],[1679616000000,5.4],[1679875200000,5.32],[1679961600000,5.05],[1680048000000,5.24],[1680134400000,5.16],[1680220800000,5.03],[1680480000000,5.36],[1680566400000,5.09],[1680652800000,5.02],[1680739200000,5],[1681171200000,5.26],[1681257600000,5.3],[1681344000000,5.29],[1681430400000,5.29],[1681689600000,5.29],[1681776000000,5.29],[1681862400000,5.02],[1681948800000,5.06],[1682035200000,5.28],[1682294400000,5.27],[1682380800000,5.27],[1682467200000,5.28],[1682553600000,5.03],[1682640000000,5.03],[1682899200000,5.27],[1682985600000,5.29],[1683072000000,5.31],[1683158400000,5.06],[1683244800000,5.35],[1683504000000,5.34],[1683590400000,5.35],[1683676800000,5.35],[1683763200000,5.28],[1683849600000,5.39],[1684108800000,5.44],[1684195200000,5.49],[1684281600000,5.45],[1684368000000,5.05],[1684454400000,5.49],[1684713600000,4.97],[1684886400000,4.97],[1684972800000,5.6],[1685059200000,5.6],[1685318400000,4.76],[1685404800000,5.5],[1685491200000,5.47],[1685577600000,5.52],[1685664000000,5.21],[1685923200000,5],[1686009600000,5.48],[1686096000000,5.5],[1686182400000,5.27],[1686268800000,5.46],[1686528000000,5.27],[1686614400000,4.53],[1686700800000,4.54],[1686787200000,4.59],[1686873600000,4.6],[1687132800000,4.6],[1687219200000,4.62],[1687305600000,4.96],[1687392000000,4.6],[1687478400000,4.6],[1687737600000,4.56],[1687824000000,4.6],[1687910400000,4.59],[1687996800000,4.6],[1688083200000,4.6],[1688342400000,4.6],[1688428800000,4.59],[1688515200000,4.59],[1688601600000,4.61],[1688688000000,4.64],[1688947200000,4.6],[1689033600000,4.61],[1689120000000,4.55],[1689206400000,4.64],[1689292800000,4.6],[1689552000000,4.6],[1689638400000,4.35],[1689724800000,4.36],[1689811200000,4.14],[1689897600000,4.64]],\n marker: {\n enabled: true,"
volume := " type: 'column',\n name: 'Volume',\n data: [[1642723200000,1175],[1642982400000,4250],[1643068800000,2051],[1643155200000,662],[1643241600000,200],[1643328000000,100],[1643587200000,200],[1643673600000,1000],[1643760000000,2524],[1643846400000,137],[1643932800000,1305],[1644192000000,8691],[1644278400000,39625],[1644364800000,5747],[1644451200000,601],[1644537600000,6027],[1644796800000,32271],[1644883200000,14854],[1644969600000,29187],[1645056000000,17000],[1645142400000,22811],[1645401600000,26855],[1645488000000,1315],[1645574400000,11633],[1645660800000,7503],[1645747200000,2188],[1646006400000,13730],[1646092800000,12262],[1646265600000,257],[1646352000000,593],[1646611200000,700],[1646697600000,1342],[1646784000000,11459],[1646870400000,5947],[1646956800000,7046],[1647216000000,54653],[1647302400000,3000],[1647388800000,0],[1647475200000,1953],[1647561600000,3348],[1647820800000,3060],[1647907200000,13416],[1647993600000,13508],[1648080000000,15471],[1648166400000,31290],[1648425600000,1062],[1648512000000,995],[1648598400000,14050],[1648684800000,16892],[1648771200000,738963],[1649030400000,2278270],[1649116800000,655534],[1649203200000,1170],[1649289600000,67919],[1649376000000,1576014],[1649635200000,1000184],[1649721600000,58550],[1649808000000,1188],[1649894400000,2035628],[1650326400000,980],[1650412800000,2511],[1650499200000,10316],[1650585600000,1000],[1650844800000,23304],[1650931200000,2445],[1651017600000,9001],[1651104000000,396],[1651190400000,12254],[1651449600000,149842],[1651536000000,4056],[1651622400000,336],[1651708800000,4656],[1651795200000,3846],[1652054400000,8363],[1652140800000,97496],[1652227200000,1956],[1652313600000,898887],[1652400000000,1],[1652659200000,505646],[1652745600000,5096],[1652832000000,155],[1652918400000,1760],[1653004800000,1045],[1653350400000,98926],[1653436800000,400],[1653523200000,1578],[1653609600000,15946],[1653868800000,9457],[1653955200000,1310],[1654041600000,251],[1654128000000,500],[1654214400000,190],[1654473600000,83],[1654560000000,200],[1654646400000,100],[1654732800000,44],[1654819200000,623],[1655078400000,3271],[1655164800000,801],[1655251200000,794],[1655337600000,398],[1655424000000,1000],[1655683200000,5247],[1655769600000,5696],[1655856000000,5544],[1655942400000,0],[1656028800000,250],[1656288000000,2000],[1656374400000,622],[1656460800000,14],[1656547200000,552],[1656633600000,8520],[1656892800000,611],[1656979200000,50],[1657065600000,6276],[1657152000000,2300],[1657238400000,33165],[1657497600000,4272],[1657584000000,1254],[1657670400000,268],[1657756800000,1108],[1657843200000,75],[1658102400000,350],[1658188800000,1200],[1658275200000,14929],[1658361600000,0],[1658448000000,0],[1658707200000,13129],[1658793600000,3251],[1658880000000,2002],[1658966400000,7608],[1659052800000,521],[1659398400000,7044],[1659484800000,1511],[1659571200000,2895],[1659657600000,6322],[1659916800000,610],[1660003200000,3115],[1660089600000,782],[1660176000000,21],[1660262400000,1462],[1660521600000,8637],[1660608000000,851],[1660694400000,453],[1660780800000,408],[1660867200000,68],[1661126400000,16534],[1661212800000,86535],[1661299200000,4229552],[1661385600000,507024],[1661472000000,31923],[1661731200000,76424],[1661817600000,961825],[1661904000000,76084],[1661990400000,2938989],[1662076800000,4215],[1662336000000,13865],[1662422400000,12283],[1662508800000,162701],[1662595200000,3172],[1662681600000,1557],[1662940800000,2234],[1663027200000,3184],[1663113600000,1408],[1663200000000,714],[1663286400000,3980],[1663545600000,16],[1663632000000,13109],[1663718400000,7],[1663804800000,1602],[1663891200000,888],[1664150400000,4066],[1664236800000,5015],[1664323200000,4220],[1664409600000,80604],[1664496000000,10289],[1664755200000,204],[1664841600000,15578],[1664928000000,4132],[1665014400000,1005],[1665100800000,693],[1665360000000,2298],[1665446400000,322],[1665532800000,68],[1665619200000,683],[1665705600000,255],[1666051200000,894],[1666137600000,260],[1666224000000,2985],[1666310400000,100],[1666569600000,229],[1666656000000,40334],[1666742400000,800],[1666828800000,10411],[1666915200000,1],[1667174400000,8099],[1667260800000,1073],[1667347200000,25],[1667433600000,133250],[1667520000000,35857],[1667779200000,1038320],[1667865600000,113270],[1667952000000,7954],[1668038400000,9964],[1668124800000,2026320],[1668384000000,86815],[1668470400000,102865],[1668556800000,22925],[1668643200000,21703],[1668729600000,75734],[1668988800000,389],[1669075200000,5250],[1669161600000,30348],[1669248000000,9000],[1669334400000,16000],[1669593600000,1151831],[1669680000000,10322],[1669766400000,3045],[1669852800000,10356],[1669939200000,342],[1670198400000,8976],[1670284800000,139],[1670371200000,437],[1670457600000,2104],[1670544000000,541],[1670803200000,734813],[1670889600000,36016],[1670976000000,516],[1671062400000,1191],[1671148800000,185],[1671408000000,19606],[1671494400000,35284],[1671580800000,51855],[1671667200000,164891],[1671753600000,8443],[1672185600000,266155],[1672272000000,39607],[1672358400000,511462],[1672704000000,67127],[1672790400000,152074],[1672876800000,24264],[1672963200000,1311],[1673222400000,28431],[1673308800000,68398],[1673395200000,15166],[1673481600000,2716],[1673568000000,22911],[1673827200000,5238],[1673913600000,12110],[1674000000000,15687],[1674086400000,1035],[1674172800000,190],[1674432000000,6405],[1674518400000,312],[1674604800000,236],[1674691200000,25641],[1674777600000,12091],[1675036800000,4100],[1675123200000,30245],[1675209600000,50461],[1675296000000,197838],[1675382400000,2450],[1675641600000,24651],[1675728000000,1123],[1675814400000,1068],[1675900800000,103573],[1675987200000,81241],[1676246400000,3019],[1676332800000,23898],[1676419200000,384],[1676505600000,16446],[1676592000000,10641],[1676851200000,15203],[1676937600000,128264],[1677110400000,66235],[1677196800000,67615],[1677456000000,2000],[1677542400000,79352],[1677628800000,508],[1677715200000,38968],[1677801600000,3680],[1678060800000,14891],[1678147200000,812],[1678233600000,1],[1678320000000,166],[1678406400000,14607],[1678665600000,1062],[1678752000000,83],[1678838400000,13315],[1678924800000,2274],[1679011200000,888],[1679270400000,584],[1679356800000,585],[1679443200000,933],[1679529600000,2858],[1679616000000,4],[1679875200000,5835],[1679961600000,3045],[1680048000000,6188],[1680134400000,1439],[1680220800000,30234],[1680480000000,516],[1680566400000,2427],[1680652800000,19300],[1680739200000,101151],[1681171200000,4751],[1681257600000,2063],[1681344000000,1611],[1681430400000,1722],[1681689600000,1024],[1681776000000,74],[1681862400000,938],[1681948800000,1680],[1682035200000,1848],[1682294400000,1412],[1682380800000,2292],[1682467200000,9225],[1682553600000,601050],[1682640000000,1845975],[1682899200000,221],[1682985600000,8364],[1683072000000,4238],[1683158400000,15297],[1683244800000,565],[1683504000000,2650],[1683590400000,116],[1683676800000,171],[1683763200000,20642],[1683849600000,25247],[1684108800000,732],[1684195200000,1146],[1684281600000,1155],[1684368000000,697],[1684454400000,32625],[1684713600000,19872],[1684886400000,0],[1684972800000,500],[1685059200000,188],[1685318400000,28560],[1685404800000,403],[1685491200000,3345],[1685577600000,461],[1685664000000,4229],[1685923200000,1033],[1686009600000,3698],[1686096000000,166],[1686182400000,556],[1686268800000,143],[1686528000000,3865],[1686614400000,2114160],[1686700800000,1047762],[1686787200000,3512518],[1686873600000,323347],[1687132800000,16410],[1687219200000,107877],[1687305600000,1207],[1687392000000,179651],[1687478400000,23013],[1687737600000,51066],[1687824000000,70339],[1687910400000,145550],[1687996800000,2362],[1688083200000,173602],[1688342400000,1266],[1688428800000,445],[1688515200000,87171],[1688601600000,8875],[1688688000000,10194],[1688947200000,2243],[1689033600000,6438],[1689120000000,7344],[1689206400000,656],[1689292800000,1871],[1689552000000,0],[1689638400000,2001964],[1689724800000,2232],[1689811200000,2434],[1689897600000,111931]],\n yAxis: 1,"
for i := 0; i < b.N; i++ {
st.processPriceHistory(&price, &volume)
}
}
func TestProcessPriceHistory(t *testing.T) {
price := "name: 'Price',\n data: [[1642723200000,4.66],[1642982400000,4.6],[1643068800000,4.6],[1643155200000,4.2],[1643241600000,4.25],[1643328000000,4.5],[1643587200000,4.5],[1643673600000,4.6],[1643760000000,4.533122],[1643846400000,4.586861],[1643932800000,4.293487],[1644192000000,4.553975],[1644278400000,4.715466],[1644364800000,4.921166],[1644451200000,4.934958],[1644537600000,7.324934],[1644796800000,8.048739],[1644883200000,7.416208],[1644969600000,6.44341],[1645056000000,7.418727],[1645142400000,5.593384],[1645401600000,5.126693],[1645488000000,5.248479],[1645574400000,5.25],[1645660800000,5.005635],[1645747200000,5.088323],[1646006400000,5.215401],[1646092800000,5.145707],[1646265600000,5.197782],[1646352000000,5.2],[1646611200000,5.05],[1646697600000,5.139978],[1646784000000,5.222668],[1646870400000,5.247093],[1646956800000,5.238723],[1647216000000,5.233972],[1647302400000,5.25],[1647388800000,5.25],[1647475200000,5.024122],[1647561600000,5],[1647820800000,5],[1647907200000,4.999964],[1647993600000,5],[1648080000000,5],[1648166400000,4.999511],[1648425600000,5],[1648512000000,5],[1648598400000,5],[1648684800000,4.999839],[1648771200000,4.990013],[1649030400000,5],[1649116800000,5.000002],[1649203200000,5.204359],[1649289600000,5.002977],[1649376000000,5.000653],[1649635200000,5.000309],[1649721600000,5.239027],[1649808000000,5.245976],[1649894400000,5.001312],[1650326400000,5.25],[1650412800000,5.107814],[1650499200000,5.012408],[1650585600000,5],[1650844800000,5.134851],[1650931200000,5.044736],[1651017600000,5.209941],[1651104000000,5.25],[1651190400000,5.032441],[1651449600000,5.25],[1651536000000,5.136588],[1651622400000,5.23006],[1651708800000,5.2],[1651795200000,5.15319],[1652054400000,4.805436],[1652140800000,5.237451],[1652227200000,5.243328],[1652313600000,4.409349],[1652400000000,5],[1652659200000,5.247731],[1652745600000,5.25],[1652832000000,5.24],[1652918400000,4.746818],[1653004800000,5.17],[1653350400000,5.166982],[1653436800000,5.18],[1653523200000,4.760266],[1653609600000,5.225647],[1653868800000,5.157363],[1653955200000,5.19],[1654041600000,5.19],[1654128000000,5.19],[1654214400000,5.19],[1654473600000,5.19],[1654560000000,5.19],[1654646400000,5.19],[1654732800000,5.19],[1654819200000,5.19],[1655078400000,4.825861],[1655164800000,5.162534],[1655251200000,4.927003],[1655337600000,4.91],[1655424000000,4.76],[1655683200000,4.781828],[1655769600000,4.904043],[1655856000000,4.787327],[1655942400000,4.787327],[1656028800000,5.052],[1656288000000,4.83007],[1656374400000,5.1],[1656460800000,5.1],[1656547200000,5.189674],[1656633600000,5.1],[1656892800000,4.82],[1656979200000,5.09],[1657065600000,4.794732],[1657152000000,5.175222],[1657238400000,4.780031],[1657497600000,4.96217],[1657584000000,4.988947],[1657670400000,4.77],[1657756800000,5.012834],[1657843200000,5.16],[1658102400000,5.013714],[1658188800000,5.15],[1658275200000,4.394379],[1658361600000,4.394379],[1658448000000,4.394379],[1658707200000,4.342139],[1658793600000,4.389895],[1658880000000,5.0001],[1658966400000,5.00439],[1659052800000,5.002015],[1659398400000,5.000312],[1659484800000,5.05],[1659571200000,4.833126],[1659657600000,4.90192],[1659916800000,4.924918],[1660003200000,5.103788],[1660089600000,5.005754],[1660176000000,5.014286],[1660262400000,5.025034],[1660521600000,5.003115],[1660608000000,5.099647],[1660694400000,5.14],[1660780800000,5.076029],[1660867200000,5.14],[1661126400000,5.174677],[1661212800000,5.195583],[1661299200000,5.909985],[1661385600000,5.930768],[1661472000000,7.0106],[1661731200000,7.225188],[1661817600000,5.3],[1661904000000,4.760331],[1661990400000,5.275127],[1662076800000,6.65898],[1662336000000,6.072951],[1662422400000,6.97396],[1662508800000,6.786618],[1662595200000,6.921286],[1662681600000,6.853725],[1662940800000,6.800824],[1663027200000,6.447236],[1663113600000,6.726598],[1663200000000,5.687479],[1663286400000,5.55547],[1663545600000,5.56],[1663632000000,6.286856],[1663718400000,6.29],[1663804800000,6.410861],[1663891200000,6.218919],[1664150400000,5.54],[1664236800000,5.736383],[1664323200000,5.671377],[1664409600000,5.500058],[1664496000000,5.333074],[1664755200000,5.972549],[1664841600000,5.530992],[1664928000000,5.948979],[1665014400000,6],[1665100800000,5.963045],[1665360000000,5.56],[1665446400000,5.509317],[1665532800000,5.592647],[1665619200000,5.53],[1665705600000,5.52],[1666051200000,5.04],[1666137600000,5.12],[1666224000000,5.17],[1666310400000,5.6],[1666569600000,5.24],[1666656000000,5.52],[1666742400000,5.6],[1666828800000,5.6],[1666915200000,5.63],[1667174400000,5.96],[1667260800000,6.52],[1667347200000,5.52],[1667433600000,5.5],[1667520000000,4.92],[1667779200000,4.09],[1667865600000,4.74],[1667952000000,4.26],[1668038400000,4.5],[1668124800000,4.51],[1668384000000,5.11],[1668470400000,4.69],[1668556800000,4.55],[1668643200000,4.58],[1668729600000,4.5],[1668988800000,4.7],[1669075200000,4.39],[1669161600000,4.35],[1669248000000,4.57],[1669334400000,4.58],[1669593600000,4.88],[1669680000000,4.98],[1669766400000,5],[1669852800000,5.05],[1669939200000,5.2],[1670198400000,4.99],[1670284800000,5.18],[1670371200000,5.09],[1670457600000,5.11],[1670544000000,5.1],[1670803200000,5.1],[1670889600000,5.42],[1670976000000,5.73],[1671062400000,5],[1671148800000,5.71],[1671408000000,5.65],[1671494400000,5.01],[1671580800000,5],[1671667200000,5],[1671753600000,5],[1672185600000,5],[1672272000000,5],[1672358400000,5],[1672704000000,5],[1672790400000,5],[1672876800000,5],[1672963200000,5],[1673222400000,4.96],[1673308800000,4.95],[1673395200000,4.99],[1673481600000,4.99],[1673568000000,4.97],[1673827200000,4.96],[1673913600000,4.98],[1674000000000,4.54],[1674086400000,4.78],[1674172800000,4.97],[1674432000000,4.93],[1674518400000,4.67],[1674604800000,4.92],[1674691200000,4.94],[1674777600000,4.91],[1675036800000,5],[1675123200000,5],[1675209600000,5],[1675296000000,5.06],[1675382400000,5.78],[1675641600000,5.8],[1675728000000,5.88],[1675814400000,5.72],[1675900800000,4.85],[1675987200000,4.69],[1676246400000,4.52],[1676332800000,4.83],[1676419200000,4.9],[1676505600000,4.86],[1676592000000,4.58],[1676851200000,4.97],[1676937600000,4.76],[1677110400000,5],[1677196800000,5.01],[1677456000000,5.19],[1677542400000,5.01],[1677628800000,5.46],[1677715200000,5.5],[1677801600000,5.49],[1678060800000,5.33],[1678147200000,5.49],[1678233600000,5.46],[1678320000000,5.27],[1678406400000,5.18],[1678665600000,5.17],[1678752000000,5.44],[1678838400000,5.27],[1678924800000,5.49],[1679011200000,5.5],[1679270400000,5.42],[1679356800000,5.47],[1679443200000,5.11],[1679529600000,5.4],[1679616000000,5.4],[1679875200000,5.32],[1679961600000,5.05],[1680048000000,5.24],[1680134400000,5.16],[1680220800000,5.03],[1680480000000,5.36],[1680566400000,5.09],[1680652800000,5.02],[1680739200000,5],[1681171200000,5.26],[1681257600000,5.3],[1681344000000,5.29],[1681430400000,5.29],[1681689600000,5.29],[1681776000000,5.29],[1681862400000,5.02],[1681948800000,5.06],[1682035200000,5.28],[1682294400000,5.27],[1682380800000,5.27],[1682467200000,5.28],[1682553600000,5.03],[1682640000000,5.03],[1682899200000,5.27],[1682985600000,5.29],[1683072000000,5.31],[1683158400000,5.06],[1683244800000,5.35],[1683504000000,5.34],[1683590400000,5.35],[1683676800000,5.35],[1683763200000,5.28],[1683849600000,5.39],[1684108800000,5.44],[1684195200000,5.49],[1684281600000,5.45],[1684368000000,5.05],[1684454400000,5.49],[1684713600000,4.97],[1684886400000,4.97],[1684972800000,5.6],[1685059200000,5.6],[1685318400000,4.76],[1685404800000,5.5],[1685491200000,5.47],[1685577600000,5.52],[1685664000000,5.21],[1685923200000,5],[1686009600000,5.48],[1686096000000,5.5],[1686182400000,5.27],[1686268800000,5.46],[1686528000000,5.27],[1686614400000,4.53],[1686700800000,4.54],[1686787200000,4.59],[1686873600000,4.6],[1687132800000,4.6],[1687219200000,4.62],[1687305600000,4.96],[1687392000000,4.6],[1687478400000,4.6],[1687737600000,4.56],[1687824000000,4.6],[1687910400000,4.59],[1687996800000,4.6],[1688083200000,4.6],[1688342400000,4.6],[1688428800000,4.59],[1688515200000,4.59],[1688601600000,4.61],[1688688000000,4.64],[1688947200000,4.6],[1689033600000,4.61],[1689120000000,4.55],[1689206400000,4.64],[1689292800000,4.6],[1689552000000,4.6],[1689638400000,4.35],[1689724800000,4.36],[1689811200000,4.14],[1689897600000,4.64]],\n marker: {\n enabled: true,"
volume := " type: 'column',\n name: 'Volume',\n data: [[1642723200000,1175],[1642982400000,4250],[1643068800000,2051],[1643155200000,662],[1643241600000,200],[1643328000000,100],[1643587200000,200],[1643673600000,1000],[1643760000000,2524],[1643846400000,137],[1643932800000,1305],[1644192000000,8691],[1644278400000,39625],[1644364800000,5747],[1644451200000,601],[1644537600000,6027],[1644796800000,32271],[1644883200000,14854],[1644969600000,29187],[1645056000000,17000],[1645142400000,22811],[1645401600000,26855],[1645488000000,1315],[1645574400000,11633],[1645660800000,7503],[1645747200000,2188],[1646006400000,13730],[1646092800000,12262],[1646265600000,257],[1646352000000,593],[1646611200000,700],[1646697600000,1342],[1646784000000,11459],[1646870400000,5947],[1646956800000,7046],[1647216000000,54653],[1647302400000,3000],[1647388800000,0],[1647475200000,1953],[1647561600000,3348],[1647820800000,3060],[1647907200000,13416],[1647993600000,13508],[1648080000000,15471],[1648166400000,31290],[1648425600000,1062],[1648512000000,995],[1648598400000,14050],[1648684800000,16892],[1648771200000,738963],[1649030400000,2278270],[1649116800000,655534],[1649203200000,1170],[1649289600000,67919],[1649376000000,1576014],[1649635200000,1000184],[1649721600000,58550],[1649808000000,1188],[1649894400000,2035628],[1650326400000,980],[1650412800000,2511],[1650499200000,10316],[1650585600000,1000],[1650844800000,23304],[1650931200000,2445],[1651017600000,9001],[1651104000000,396],[1651190400000,12254],[1651449600000,149842],[1651536000000,4056],[1651622400000,336],[1651708800000,4656],[1651795200000,3846],[1652054400000,8363],[1652140800000,97496],[1652227200000,1956],[1652313600000,898887],[1652400000000,1],[1652659200000,505646],[1652745600000,5096],[1652832000000,155],[1652918400000,1760],[1653004800000,1045],[1653350400000,98926],[1653436800000,400],[1653523200000,1578],[1653609600000,15946],[1653868800000,9457],[1653955200000,1310],[1654041600000,251],[1654128000000,500],[1654214400000,190],[1654473600000,83],[1654560000000,200],[1654646400000,100],[1654732800000,44],[1654819200000,623],[1655078400000,3271],[1655164800000,801],[1655251200000,794],[1655337600000,398],[1655424000000,1000],[1655683200000,5247],[1655769600000,5696],[1655856000000,5544],[1655942400000,0],[1656028800000,250],[1656288000000,2000],[1656374400000,622],[1656460800000,14],[1656547200000,552],[1656633600000,8520],[1656892800000,611],[1656979200000,50],[1657065600000,6276],[1657152000000,2300],[1657238400000,33165],[1657497600000,4272],[1657584000000,1254],[1657670400000,268],[1657756800000,1108],[1657843200000,75],[1658102400000,350],[1658188800000,1200],[1658275200000,14929],[1658361600000,0],[1658448000000,0],[1658707200000,13129],[1658793600000,3251],[1658880000000,2002],[1658966400000,7608],[1659052800000,521],[1659398400000,7044],[1659484800000,1511],[1659571200000,2895],[1659657600000,6322],[1659916800000,610],[1660003200000,3115],[1660089600000,782],[1660176000000,21],[1660262400000,1462],[1660521600000,8637],[1660608000000,851],[1660694400000,453],[1660780800000,408],[1660867200000,68],[1661126400000,16534],[1661212800000,86535],[1661299200000,4229552],[1661385600000,507024],[1661472000000,31923],[1661731200000,76424],[1661817600000,961825],[1661904000000,76084],[1661990400000,2938989],[1662076800000,4215],[1662336000000,13865],[1662422400000,12283],[1662508800000,162701],[1662595200000,3172],[1662681600000,1557],[1662940800000,2234],[1663027200000,3184],[1663113600000,1408],[1663200000000,714],[1663286400000,3980],[1663545600000,16],[1663632000000,13109],[1663718400000,7],[1663804800000,1602],[1663891200000,888],[1664150400000,4066],[1664236800000,5015],[1664323200000,4220],[1664409600000,80604],[1664496000000,10289],[1664755200000,204],[1664841600000,15578],[1664928000000,4132],[1665014400000,1005],[1665100800000,693],[1665360000000,2298],[1665446400000,322],[1665532800000,68],[1665619200000,683],[1665705600000,255],[1666051200000,894],[1666137600000,260],[1666224000000,2985],[1666310400000,100],[1666569600000,229],[1666656000000,40334],[1666742400000,800],[1666828800000,10411],[1666915200000,1],[1667174400000,8099],[1667260800000,1073],[1667347200000,25],[1667433600000,133250],[1667520000000,35857],[1667779200000,1038320],[1667865600000,113270],[1667952000000,7954],[1668038400000,9964],[1668124800000,2026320],[1668384000000,86815],[1668470400000,102865],[1668556800000,22925],[1668643200000,21703],[1668729600000,75734],[1668988800000,389],[1669075200000,5250],[1669161600000,30348],[1669248000000,9000],[1669334400000,16000],[1669593600000,1151831],[1669680000000,10322],[1669766400000,3045],[1669852800000,10356],[1669939200000,342],[1670198400000,8976],[1670284800000,139],[1670371200000,437],[1670457600000,2104],[1670544000000,541],[1670803200000,734813],[1670889600000,36016],[1670976000000,516],[1671062400000,1191],[1671148800000,185],[1671408000000,19606],[1671494400000,35284],[1671580800000,51855],[1671667200000,164891],[1671753600000,8443],[1672185600000,266155],[1672272000000,39607],[1672358400000,511462],[1672704000000,67127],[1672790400000,152074],[1672876800000,24264],[1672963200000,1311],[1673222400000,28431],[1673308800000,68398],[1673395200000,15166],[1673481600000,2716],[1673568000000,22911],[1673827200000,5238],[1673913600000,12110],[1674000000000,15687],[1674086400000,1035],[1674172800000,190],[1674432000000,6405],[1674518400000,312],[1674604800000,236],[1674691200000,25641],[1674777600000,12091],[1675036800000,4100],[1675123200000,30245],[1675209600000,50461],[1675296000000,197838],[1675382400000,2450],[1675641600000,24651],[1675728000000,1123],[1675814400000,1068],[1675900800000,103573],[1675987200000,81241],[1676246400000,3019],[1676332800000,23898],[1676419200000,384],[1676505600000,16446],[1676592000000,10641],[1676851200000,15203],[1676937600000,128264],[1677110400000,66235],[1677196800000,67615],[1677456000000,2000],[1677542400000,79352],[1677628800000,508],[1677715200000,38968],[1677801600000,3680],[1678060800000,14891],[1678147200000,812],[1678233600000,1],[1678320000000,166],[1678406400000,14607],[1678665600000,1062],[1678752000000,83],[1678838400000,13315],[1678924800000,2274],[1679011200000,888],[1679270400000,584],[1679356800000,585],[1679443200000,933],[1679529600000,2858],[1679616000000,4],[1679875200000,5835],[1679961600000,3045],[1680048000000,6188],[1680134400000,1439],[1680220800000,30234],[1680480000000,516],[1680566400000,2427],[1680652800000,19300],[1680739200000,101151],[1681171200000,4751],[1681257600000,2063],[1681344000000,1611],[1681430400000,1722],[1681689600000,1024],[1681776000000,74],[1681862400000,938],[1681948800000,1680],[1682035200000,1848],[1682294400000,1412],[1682380800000,2292],[1682467200000,9225],[1682553600000,601050],[1682640000000,1845975],[1682899200000,221],[1682985600000,8364],[1683072000000,4238],[1683158400000,15297],[1683244800000,565],[1683504000000,2650],[1683590400000,116],[1683676800000,171],[1683763200000,20642],[1683849600000,25247],[1684108800000,732],[1684195200000,1146],[1684281600000,1155],[1684368000000,697],[1684454400000,32625],[1684713600000,19872],[1684886400000,0],[1684972800000,500],[1685059200000,188],[1685318400000,28560],[1685404800000,403],[1685491200000,3345],[1685577600000,461],[1685664000000,4229],[1685923200000,1033],[1686009600000,3698],[1686096000000,166],[1686182400000,556],[1686268800000,143],[1686528000000,3865],[1686614400000,2114160],[1686700800000,1047762],[1686787200000,3512518],[1686873600000,323347],[1687132800000,16410],[1687219200000,107877],[1687305600000,1207],[1687392000000,179651],[1687478400000,23013],[1687737600000,51066],[1687824000000,70339],[1687910400000,145550],[1687996800000,2362],[1688083200000,173602],[1688342400000,1266],[1688428800000,445],[1688515200000,87171],[1688601600000,8875],[1688688000000,10194],[1688947200000,2243],[1689033600000,6438],[1689120000000,7344],[1689206400000,656],[1689292800000,1871],[1689552000000,0],[1689638400000,2001964],[1689724800000,2232],[1689811200000,2434],[1689897600000,111931]],\n yAxis: 1,"
st.processPriceHistory(&price, &volume)
got := st.History
testHistoryCount := 378
if len(got) != testHistoryCount {
t.Errorf("Expected %v Price History Elements. Got %v", testHistoryCount, len(got))
}
if got[2].ClosePrice != 460 {
t.Errorf("Expected 460 Price History Elements. Got %v", got[2].ClosePrice)
}
}