Skip to main content
Filter by
Sorted by
Tagged with
-1 votes
0 answers
48 views

I'm using a two-level LeftSemiJoinEngine in DolphinDB to join streaming tables, but the final output data cannot be correctly sorted by the specified column. Scenario Description: I need to process ...
xinyu zhang's user avatar
0 votes
0 answers
71 views

I created a time series aggregator using createTimeSeriesAggregator, but the chronological order of the output results is problematic. Scenario Description: The data in the source table MD_PTB is ...
haru's user avatar
  • 11
0 votes
1 answer
44 views

Refer to this example attached as follows. It consists 2 methods of streaming, one by defined function, another by class append method. The 2 methods produce exactly same results no matter how I tune ...
user32013486's user avatar
-1 votes
1 answer
45 views

I’m trying to perform an as-of join between two in-memory tables. However, my results are unexpected — some rows that I believe should match are not matched. Here is a simplified reproducible example: ...
xinyu zhang's user avatar
0 votes
2 answers
121 views

I have a table t containing minute-level data with fields such as datetime (timestamp), stock_id (stock code), and ret (return). My goal is to: First, group by date(datetime) and stock_id, and ...
haru's user avatar
  • 11
0 votes
0 answers
40 views

I am working with a table in DolphinDB where multiple rows share the same id, and each row contains non-null values in different columns. My goal is to consolidate these rows into a single row for ...
xiyan zheng's user avatar
1 vote
0 answers
83 views

I'm trying to perform rolling regression on a matrix with missing values and calculate residuals for each row. Specifically, I want to use a rolling window of length 3 where for each window, the ...
xinyu zhang's user avatar
0 votes
1 answer
81 views

I have two vectors of equal length, one integer vector and one boolean vector. I want to calculate the product of elements in the integer vector where the corresponding boolean vector has consecutive ...
haru's user avatar
  • 11
0 votes
1 answer
114 views

I have a DolphinDB table with an array vector column. I need to remove duplicate rows based on subset relationships within that column. Sample Input: sym prices a [3,4,5,6] a [3,4,5] a [2,4,5,6] a [5,...
xinyu zhang's user avatar
-1 votes
0 answers
57 views

I'm using DolphinDB's stream processing engine to handle a real-time data feed of financial metrics. My requirement is to maintain the latest f1 value for each unique symbol (sym). Every time a new ...
RORO's user avatar
  • 1
-3 votes
0 answers
157 views

I'm calculating a conditional cumulative sum in DolphinDB SQL that resets the accumulator when the value changes sign (from 1 to -1 or -1 to 1). Here's a complete, reproducible scenario and my ...
Liu lu's user avatar
  • 1
0 votes
1 answer
67 views

I am working with irregular minute-level stock data in DolphinDB and need to implement a specific rolling calculation using the roll function which is new in version 3.00.4. I have a custom ...
HuaXian Tan's user avatar
0 votes
1 answer
48 views

I am using the cross-sectional engine and need to store multiple rows of fields as a single array vector. However, I have encountered several issues during the process: The scenarios I attempted are ...
xiao feng's user avatar
0 votes
1 answer
44 views

I have a base table A and a result table B in DolphinDB. Table B was initially empty and is used to store calculated results based on table A. When trying to insert the calculated results into table B,...
RORO's user avatar
  • 1
0 votes
1 answer
97 views

I need to process a large L2 market data table (≈30 million rows) in DolphinDB and calculate statistics for the top 5% of records per group. However, I’m stuck on a syntax error with the top function ...
Dongyun Huang's user avatar
2 votes
1 answer
67 views

I’m working with the DolphinDB Python API to analyze financial data, but I can’t join a table transformed by pivotby() with another table directly. The error says TablePivotBy has no merge attribute. ...
xiao feng's user avatar
0 votes
1 answer
47 views

I'm working with DolphinDB V3.00.3 and need to transform a vector by duplicating each element consecutively, while keeping the original order and final vector length the same as the input.​ Example​ ...
Dongyun Huang's user avatar
1 vote
1 answer
63 views

I have an in - memory DolphinDB table created as follows: ticker = `AAPL`IBM`IBM`AAPL`AMZN`AAPL`AMZN`IBM`AMZN volume = 106 115 121 90 130 150 145 123 155; t = table(ticker, volume); t; The output of ...
Dongyun Huang's user avatar
0 votes
1 answer
85 views

I am using DolphinDB version 3.00.0.6 and have two in-memory tables A and B. I need the equivalent of a Non-Equi Join with strict inequality (A.date > B.date) to find the latest record in B that is ...
Andy's user avatar
  • 13
0 votes
0 answers
109 views

I'm working with stock market snapshot data (3-second intervals) in DolphinDB and need to calculate the 1-minute forward moving average for each data point. For backward moving average (past 1 minute),...
xiao feng's user avatar
0 votes
1 answer
57 views

I want to parse and calculate formulas line by line. The formulas depend on the given variables x1 and x2. The number of formulas per line is not fixed, and there are dependencies between the results ...
HuaXian Tan's user avatar
0 votes
0 answers
20 views

I'm working with metaprogramming in Python and need to dynamically resolve functions. When a variable is directly assigned a function name, everything works. However, when assigned indirectly via ...
Shilin Wang's user avatar
2 votes
1 answer
107 views

I ran the following query to retrieve data for a single investment ID: select *, getProductClass(InstrumentID, etf_option_mapper) as ProductClass from investor_pos where InvestorID = '7399000270' ...
HuaXian Tan's user avatar
1 vote
0 answers
57 views

I have an in-memory table defined as follows in DolphinDB: t = table(2025.01.01 as date, 1 as M01, 2 as M02, 3 as M03, 4 as M04, 5 as M05, 6 as M06, 1 as M07, 2 as M08, 3 as M09, 4 as M10, 5 as M11, 6 ...
Shilin Wang's user avatar
0 votes
0 answers
23 views

I’m encountering an error when defining a query function in DolphinDB. Here’s my scenario: Table Definition: dt = 2025.01.01T01:01:51.100 2025.01.02T01:01:51.000 2025.01.03T04:01:51.900 sym = ["...
Shilin Wang's user avatar
-1 votes
1 answer
55 views

I am currently working on a data analysis task in DolphinDB where I need to perform column-wise aggregation on array vectors that store level - 10 bid/ask data. Specifically, I have data for bid ...
user31077149's user avatar
0 votes
1 answer
78 views

I want to concatenate two tuples in DolphinDB in the way similar to concatenating vectors. For example, I have two tuples: a=(1,2,3) and b=(4,5,6) and I attempted to use join to obtain re=(1,2,3,4,...
douya huang's user avatar
0 votes
1 answer
64 views

In Python, I can unpack a list into individual variables: >>> name,age,date = ['Bob',20,'2025-1-1'] >>> name 'Bob' >>> age 20 >>> date '2025-1-1' In DolphinDB, I ...
RORO's user avatar
  • 1
0 votes
1 answer
48 views

I'm working with DolphinDB and trying to compute weighted least squares (WLS) regression between multiple pairs of columns in a table. The mslr function (moving least squares regression) works ...
Stella.W's user avatar
0 votes
1 answer
35 views

I'm encountering some issues when trying to perform grouped correlation calculations in DolphinDB. Here's my scenario: I'm using DolphinDB to calculate correlations between multiple columns in a table....
RORO's user avatar
  • 1
2 votes
0 answers
25 views

When creating a sessionWindowEngine, the server reported an error: "A table can't contain duplicate column names." However, both my input and output tables are properly defined and do not ...
user31077149's user avatar
0 votes
0 answers
33 views

In Python, we can use collections.deque to implement FIFO queue operations. For example: from collections import deque queue = deque([1, 2, 3]) print("Initial queue:", queue) # ...
douya huang's user avatar
0 votes
1 answer
43 views

I've been learning about metaprogramming in DolphinDB recently, and I want to use metaprogramming to generate asof join statement. But I couldn't find any examples of using metaprogramming to generate ...
Stella.W's user avatar
0 votes
1 answer
39 views

I have data in an array-style string format that I need to parse and insert into a DolphinDB table, with each nested array element becoming a separate record. Here's an example of the data: '[["...
Stella.W's user avatar
0 votes
1 answer
85 views

I'm using createDailyTimeSeriesEngine to aggregate 1-minute k-lines with fill values for empty time periods. My trading sessions are configured as: sessionBegin: [21:00, 09:00, 13:00] sessionEnd: [02:...
Stella.W's user avatar
-3 votes
1 answer
74 views

I want to expand my table based on the two fields, entry_date and remove_date, with the main purpose of facilitating subsequent table joins for date matching. Below is the expected outcome I hope to ...
saki's user avatar
  • 319
0 votes
0 answers
32 views

How to implement the following complex logic using SQL: Assume my original table contains two fields, id and x, where id is an incrementing sequence and x is a sequence of floating-point numbers: id x ...
saki's user avatar
  • 319
0 votes
1 answer
42 views

Suppose I have a table with simulated data as follows: time = [09:00:00, 09:00:01, 09:00:02, 09:00:03, 09:00:04, 09:00:05, 09:00:06, 09:00:07, 09:00:08] b = [101, 103, 105, 110, 129, 134, 123, 111, ...
Stella.W's user avatar
0 votes
3 answers
98 views

How to calculate the total volume over a time period, where the field 'vol' records the cumulative meter reading, and the meter might reset to zero during this period. If there were no resets, I could ...
Stella.W's user avatar
-3 votes
1 answer
66 views

I'm working with hierarchical tree data in DolphinDB and need to solve two specific programming challenges: Generate full paths (concatenated IDs and names) for all nodes, including infinite-level ...
saki's user avatar
  • 319
1 vote
1 answer
57 views

example from DolphinDB team defg myIndicator(high, low){ prevHigh = first(high) prevLow = first(low) curHigh = last(high) curLow = last(low) if(curHigh <=...
Drac Pet's user avatar
1 vote
1 answer
67 views

In quantitative finance, maximum drawdown is a key risk metric that measures the largest decline from a peak to a trough over a period. I want to calculate the maximum drawdown over the past 10 ...
Huang WeiFeng's user avatar
0 votes
1 answer
30 views

I’d like to perform one-hot encoding on the industryCode column and preserve all other columns in the following table. date windCode industryCode 2022.08.01 000001.SZ 1101 2022.08.02 000002.SZ 1102 ...
Huang WeiFeng's user avatar
0 votes
1 answer
21 views

I have two tables: Table 1 (tb1): Shows which symbols belong to which blocks (1 = belongs, NULL = doesn't belong) SYMBOL | block1 | block2 | block3 | block4 -------|--------|--------|--------|------- ...
saki's user avatar
  • 319
1 vote
1 answer
61 views

I'm using DolphinDB's array vector as a table column, and I need to deduplicate the elements in each row of this column. I tried using the distinct statement for deduplication, but according to the ...
saki's user avatar
  • 319
1 vote
1 answer
27 views

I want to create a new column in the OHLC table based on the following rule: If the current 5-minute high is less than or equal to the previous 5-minute high and the current low is greater than or ...
Huang WeiFeng's user avatar
1 vote
1 answer
30 views

I would like to compute the pairwise correlation of stock return data using DolphinDB. There are thousands of stocks. How can I achieve this? I have already implemented a version in Python: import ...
Huang WeiFeng's user avatar
0 votes
1 answer
30 views

I'm using DolphinDB to process futures data and need to filter out non-trading hours based on different trading time ranges for each futures symbol. Since each futures product has different trading ...
saki's user avatar
  • 319
-1 votes
1 answer
98 views

I need to compare data between two tables (e.g., Table A and Table A1) to check if their field values match. The solution should: Allow specifying which fields to compare (or compare all fields by ...
saki's user avatar
  • 319
0 votes
1 answer
53 views

Sharing a common DolphinDB use case and solution for data processing. I have a table of stock observation data recording minute-by-minute indicator states, with two key indicators: ov95: ...
saki's user avatar
  • 319

1
2 3 4 5 6