Last active
September 6, 2025 01:36
-
-
Save neomantra/c443b5dab7fc56f87c8a05c343adaad8 to your computer and use it in GitHub Desktop.
Revisions
-
neomantra revised this gist
Sep 6, 2025 . 2 changed files with 1 addition and 1 deletion.There are no files selected for viewing
File renamed without changes.This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -19,6 +19,6 @@ done dbn-go-file parquet *.dbn.zst # run duckdb saving DB in file work.duckdb # follow the SQL in top_exch_by_volume.sql duckdb work.duckdb -
neomantra renamed this gist
Sep 6, 2025 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,5 @@ # install dbn-go if you haven't # brew install # make new working dir -
neomantra revised this gist
Sep 6, 2025 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,5 @@ # install dbn-go if you haven't # https://github.com/NimbleMarkets/dbn-go/blob/main/cmd/README.md#installation brew install # make new working dir -
neomantra created this gist
Sep 6, 2025 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,23 @@ # install dbn-go if you haven't brew install # make new working dir mkdir work ; cd work # put tickers in file echo "RBLX\nIBM\AAPL" > syms.txt # grep removes consolidated EQUS # add --force to the get-range to remove cost check # there will be errors one may ignore for dd in $(dbn-go-hist datasets | grep -v EQUS | grep -v BASIC) ; do echo $dd ; dbn-go-hist get-range --dataset $dd --schema ohlcv-1d --file syms.txt --start 2025-09-01 --end 2025-09-05 -o syms.$dd.ohlcv-1d.20250901_202060905.dbn.zst done # convert all those files to parquet dbn-go-file parquet *.dbn.zst # run duckdb saving DB in file work.duckdb # follow the SQL in queries.sql duckdb work.duckdb This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,14 @@ # within DuckDB run these commands # load the parquet ohlcv files, which start with syms CREATE TABLE ohlcvs AS SELECT * FROM './syms*.parquet'; # load the publishers parquet CREATE TABLE publishers AS SELECT * FROM './publishers.parquet'; # query for the top publisher_id for each date,ticker # QUALIFY is DuckDB dialect SELECT date(ts_event),symbol,volume,close,P.dataset FROM ohlcvs O JOIN publishers P ON P.publisher_id = O.publisher_id QUALIFY ROW_NUMBER() OVER (PARTITION BY ts_event, symbol ORDER BY volume DESC) = 1 ORDER BY symbol,ts_event;