Skip to content

Commit

Permalink
Fix chart problem (#495)
Browse files Browse the repository at this point in the history
Fix query for get candle data
  • Loading branch information
AmirRajabii authored Jan 6, 2025
1 parent 3b62e1e commit d3368db
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ interface TradeRepository : ReactiveCrudRepository<TradeModel, Long> {

@Query(
"""
WITH intervals AS (SELECT * FROM interval_generator((:startTime), (:endTime), :interval ::INTERVAL)),
WITH intervals AS (SELECT * FROM interval_generator((TO_TIMESTAMP(:startTime)) ::TIMESTAMP WITHOUT TIME ZONE, (:endTime), :interval ::INTERVAL)),
first_trade AS (
SELECT DISTINCT ON (f.start_time) f.start_time, f.end_time, t.matched_price AS open_price FROM intervals f
LEFT JOIN trades t ON t.create_date >= f.start_time AND t.create_date < f.end_time AND t.symbol = :symbol
Expand Down

0 comments on commit d3368db

Please sign in to comment.