crypto_quant/sql/query/sql_playground.sql

65 lines
2.0 KiB
MySQL
Raw Permalink Normal View History

use okx;
select DISTINCT symbol from crypto_huge_volume
where symbol in ("QQQ", "TQQQ", "MSFT", "AAPL", "GOOG", "NVDA", "META", "AMZN", "TSLA", "AVGO") and bar="30m"
and window_size=120
group by symbol
select * from crypto_market_data
where symbol="PLTR" and bar="5m"
order by date_time_us
2025-08-31 03:20:59 +00:00
select * from crypto_market_data
where symbol = "BTC-USDT" and bar="1H" #and open between 114271 and 114272 # AND date_time > "2025-08-21"
order by date_time desc;
2025-08-31 03:20:59 +00:00
select count(1) from crypto_market_data where
symbol in ("QQQ", "TQQQ", "MSFT", "AAPL", "GOOG", "NVDA", "META", "AMZN", "TSLA", "AVGO")
2025-08-31 03:20:59 +00:00
select count(1) from crypto_huge_volume where
symbol in ("QQQ", "TQQQ", "MSFT", "AAPL", "GOOG", "NVDA", "META", "AMZN", "TSLA", "AVGO")
2025-08-31 03:20:59 +00:00
2025-08-21 07:19:41 +00:00
select symbol, bar, date_time, close,
2025-08-22 10:48:59 +00:00
pct_chg, ma_cross, ma5, ma10, ma20, ma30, dif, dea, macd, kdj_k, kdj_d, kdj_k, kdj_pattern,
2025-08-21 07:19:41 +00:00
rsi_14, rsi_signal,
boll_upper, boll_middle, boll_lower, boll_pattern, boll_signal
from crypto_market_data
2025-08-31 03:20:59 +00:00
WHERE ma_cross in ("20下穿10", "10下穿5")
2025-08-21 07:19:41 +00:00
order by timestamp desc;
2025-08-07 10:09:51 +00:00
select symbol, bar, window_size, date_time, close,
volume, volume_ratio, huge_volume,
close_20_low, low_20_low, close_10_low, low_10_low,
close_80_high, close_90_high, high_80_high, high_90_high
from crypto_huge_volume
2025-08-31 03:20:59 +00:00
WHERE symbol='BTC-USDT' and bar='5m' and window_size=120# and low_10_low=1
order by timestamp;
2025-08-04 14:36:25 +00:00
2025-08-05 09:03:59 +00:00
select * from crypto_huge_volume
2025-08-21 07:19:41 +00:00
WHERE symbol='BTC-USDT' and bar='5m' #and date_time > '2025-08-04 15:00:00'
order by timestamp DESC;
2025-08-04 14:36:25 +00:00
select * from crypto_trade_data
2025-08-01 08:18:36 +00:00
where symbol='XCH-USDT'
order by ts desc;
select count(1) from crypto_trade_data;
select * from crypto_huge_volume
2025-08-01 08:18:36 +00:00
WHERE symbol='XCH-USDT' and bar='5m' and window_size = 80 and date_time > '2025-07-26'
order by timestamp;
select * from crypto_huge_volume
WHERE symbol='XCH-USDT-SWAP' and bar='5m' and date_time > '2025-07-26'
order by timestamp desc;
select * from crypto_huge_volume
WHERE symbol='BTC-USDT' and bar='5m'
order by timestamp desc
limit 10;
2025-08-21 07:19:41 +00:00
SHOW VARIABLES LIKE 'max_connections';