Skip to content

Commit

Permalink
Merge pull request #27 from rzhli/master
Browse files Browse the repository at this point in the history
Update Search_Symbol.jl
  • Loading branch information
eohne authored Feb 6, 2025
2 parents cd4c9d8 + bfa4c4b commit d15b10a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions src/Prices.jl
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,8 @@ function _process_response(response_body, symbol, interval, autoadjust, exchange
res = JSON3.read(response_body).chart.result[1]
time_offset = exchange_local_time ? res.meta.gmtoffset : 0

timestamps = res.timestamp
haskey(res, "timestamp") ? timestamps = res.timestamp : error("No historical data for this timeperiod of $symbo")

idx = length(timestamps) - length(unique(timestamps)) == 1 ? (1:length(timestamps)-1) : eachindex(timestamps)

d = OrderedDict{String, Union{String,Vector{DateTime},Vector{Float64}}}(
Expand Down Expand Up @@ -676,4 +677,4 @@ If TimeSeries.jl or TSFrames.jl are loaded this function is extended to allow si
"""
function sink_prices_to(::Type{OrderedDict},x::OrderedDict{String,Union{String,Vector{DateTime},Vector{Float64}}})
return x
end
end
4 changes: 2 additions & 2 deletions src/Search_Symbol.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const MARKETS = ["AMEX", "NASDAQ", "NYSE"] # Supported markets
const MARKETS = ["AMEX", "NASDAQ", "NYSE", "SZSE"] # Supported markets, Add Shenzhen Stock Exchange

"""
get_all_symbols(market::T)::Vector{T} where {T<:String}
Expand Down Expand Up @@ -197,4 +197,4 @@ function get_symbols(search_term::String)
end
end
return YahooSearch(quotes)
end
end

0 comments on commit d15b10a

Please sign in to comment.