31 lines
856 B
Swift
31 lines
856 B
Swift
//
|
|
// KissConsole+Investor.swift
|
|
// KissMeConsole
|
|
//
|
|
// Created by ened-book-m1 on 2023/06/11.
|
|
//
|
|
|
|
import Foundation
|
|
import KissMe
|
|
|
|
|
|
extension KissConsole {
|
|
func getInvestor(productNo: String) async throws -> Bool {
|
|
let result = try await account!.getInvestorVolume(productNo: productNo)
|
|
if let output = result.output {
|
|
print(output.count)
|
|
|
|
guard let recentDay = output.first?.stockBusinessDate else {
|
|
print("No investor items")
|
|
return false
|
|
}
|
|
|
|
let fileUrl = KissConsole.investorFileUrl(productNo: productNo, day: recentDay)
|
|
try output.writeCsv(toFile: fileUrl, localized: localized)
|
|
|
|
try await Task.sleep(nanoseconds: 1_000_000_000 / PreferredCandleTPS)
|
|
}
|
|
return true
|
|
}
|
|
}
|