190 lines
2.4 KiB
JavaScript
190 lines
2.4 KiB
JavaScript
const dates =
|
|
`2024-07-30
|
|
2024-07-31
|
|
2024-08-01
|
|
2024-08-02
|
|
2024-08-03
|
|
2024-08-04
|
|
2024-08-05
|
|
2024-08-06
|
|
2024-08-07
|
|
2024-08-08
|
|
2024-08-09
|
|
2024-08-10
|
|
2024-08-11
|
|
2024-08-12
|
|
2024-08-13
|
|
2024-08-14
|
|
2024-08-15
|
|
2024-08-16
|
|
2024-08-17
|
|
2024-08-18
|
|
2024-08-19
|
|
2024-08-20
|
|
2024-08-21
|
|
2024-08-22
|
|
2024-08-23
|
|
2024-08-24
|
|
2024-08-25
|
|
2024-08-26
|
|
2024-08-27
|
|
2024-08-28
|
|
2024-08-29
|
|
2024-08-30
|
|
2024-08-31
|
|
2024-09-01
|
|
2024-09-02
|
|
2024-09-03
|
|
2024-09-04
|
|
2024-09-05
|
|
2024-09-06
|
|
2024-09-07
|
|
2024-09-08
|
|
2024-09-09
|
|
2024-09-10
|
|
2024-09-11
|
|
2024-09-12
|
|
2024-09-13
|
|
2024-09-14
|
|
2024-09-15
|
|
2024-09-16
|
|
2024-09-17
|
|
2024-09-18
|
|
2024-09-19
|
|
2024-09-20
|
|
2024-09-21
|
|
2024-09-22
|
|
2024-09-23
|
|
2024-09-24
|
|
2024-09-25
|
|
2024-09-26
|
|
2024-09-27
|
|
2024-09-28
|
|
2024-09-29
|
|
2024-09-30
|
|
2024-10-01
|
|
2024-10-02
|
|
2024-10-03
|
|
2024-10-04
|
|
2024-10-05
|
|
2024-10-06
|
|
2024-10-07
|
|
2024-10-08
|
|
2024-10-09
|
|
2024-10-10
|
|
2024-10-11
|
|
2024-10-12
|
|
2024-10-13
|
|
2024-10-14
|
|
2024-10-15
|
|
2024-10-16
|
|
2024-10-17
|
|
2024-10-18
|
|
2024-10-19
|
|
2024-10-20
|
|
2024-10-21
|
|
2024-10-22
|
|
2024-10-23
|
|
2024-10-24
|
|
2024-10-25
|
|
2024-10-26
|
|
2024-10-27
|
|
2024-10-28
|
|
2024-10-29
|
|
2024-10-30
|
|
2024-10-31
|
|
2024-11-01
|
|
2024-11-02
|
|
2024-11-03
|
|
2024-11-04
|
|
2024-11-05
|
|
2024-11-06
|
|
2024-11-07
|
|
2024-11-08
|
|
2024-11-09
|
|
2024-11-10
|
|
2024-11-11
|
|
2024-11-12
|
|
2024-11-13
|
|
2024-11-14
|
|
2024-11-15
|
|
2024-11-16
|
|
2024-11-17
|
|
2024-11-18
|
|
2024-11-19
|
|
2024-11-20
|
|
2024-11-21
|
|
2024-11-22
|
|
2024-11-23
|
|
2024-11-24
|
|
2024-11-25
|
|
2024-11-26
|
|
2024-11-27
|
|
2024-11-28
|
|
2024-11-29
|
|
2024-11-30
|
|
2024-12-01
|
|
2024-12-02
|
|
2024-12-03
|
|
2024-12-04
|
|
2024-12-05
|
|
2024-12-06
|
|
2024-12-07
|
|
2024-12-08
|
|
2024-12-09
|
|
2024-12-10
|
|
2024-12-11
|
|
2024-12-12
|
|
2024-12-13
|
|
2024-12-14
|
|
2024-12-15
|
|
2024-12-16
|
|
2024-12-17
|
|
2024-12-18
|
|
2024-12-19
|
|
2024-12-20
|
|
2024-12-21
|
|
2024-12-22
|
|
2024-12-23
|
|
2024-12-24
|
|
2024-12-25
|
|
2024-12-26
|
|
2024-12-27
|
|
2024-12-28
|
|
2024-12-29
|
|
2024-12-30
|
|
2024-12-31
|
|
2025-01-01
|
|
2025-01-02
|
|
2025-01-03
|
|
2025-01-04
|
|
2025-01-05
|
|
2025-01-06
|
|
2025-01-07
|
|
2025-01-08
|
|
2025-01-09
|
|
2025-01-10
|
|
2025-01-11
|
|
2025-01-12`
|
|
|
|
const data = {}
|
|
|
|
async function main() {
|
|
const resp = await fetch("https://iss.moex.com/iss/history/engines/stock/markets/bonds/boards/TQCB/securities/RU000A105QX1.json?from=2024-07-30&till=2025-01-12")
|
|
const prices = await resp.json()
|
|
let prev;
|
|
for(date of dates.split('\n')) {
|
|
const rec = prices.history.data.find(rec => rec[1] == date)
|
|
if(rec) {
|
|
data[date] = rec[8]
|
|
prev = rec[8]
|
|
} else {
|
|
data[date] = prev
|
|
}
|
|
}
|
|
for(d of Object.values(data)) {
|
|
console.log(d)
|
|
}
|
|
}
|
|
|
|
main() |