custom indicators fixed

This commit is contained in:
2026-04-09 17:00:43 -04:00
parent a70dcd954f
commit fd431516cc
17 changed files with 778 additions and 440 deletions

View File

@@ -405,22 +405,25 @@ export class DuckDBClient {
return [];
}
// Query the Iceberg table with filters
// Query the Iceberg table with filters, deduplicating by ingested_at so that
// duplicate parquet files (e.g. from repeated Flink job runs on the same key
// range) never produce more than one row per (ticker, period_seconds, timestamp).
const sql = `
SELECT
timestamp,
ticker,
period_seconds,
open,
high,
low,
close,
volume
FROM iceberg_scan('${tablePath}')
WHERE ticker = ?
AND period_seconds = ?
AND timestamp >= ?
AND timestamp < ?
SELECT timestamp, ticker, period_seconds, open, high, low, close, volume
FROM (
SELECT
timestamp, ticker, period_seconds, open, high, low, close, volume, ingested_at,
ROW_NUMBER() OVER (
PARTITION BY timestamp
ORDER BY ingested_at DESC
) AS rn
FROM iceberg_scan('${tablePath}')
WHERE ticker = ?
AND period_seconds = ?
AND timestamp >= ?
AND timestamp < ?
)
WHERE rn = 1
ORDER BY timestamp ASC
`;

View File

@@ -31,7 +31,7 @@ export interface ZMQRelayConfig {
relayRequestEndpoint: string; // e.g., "tcp://relay:5559"
relayNotificationEndpoint: string; // e.g., "tcp://relay:5558"
clientId?: string; // Optional client ID, will generate if not provided
requestTimeout?: number; // Request timeout in ms (default: 30000)
requestTimeout?: number; // Request timeout in ms (default: 60000)
onMetadataUpdate?: () => Promise<void>; // Callback when symbol metadata updates
}
@@ -65,7 +65,7 @@ export class ZMQRelayClient {
relayRequestEndpoint: config.relayRequestEndpoint,
relayNotificationEndpoint: config.relayNotificationEndpoint,
clientId: config.clientId || `gateway-${randomUUID().slice(0, 8)}`,
requestTimeout: config.requestTimeout || 30000,
requestTimeout: config.requestTimeout || 60000,
onMetadataUpdate: config.onMetadataUpdate || (async () => {}),
};
this.logger = logger;

View File

@@ -5,27 +5,36 @@ You help users research markets, develop indicators and strategies, and analyze
Your text responses should be markdown, using emojiis, color, and formatting to create a visually appealing response.
# User Information
**User License:** {{licenseType}}
**Available Features:**
{{features}}
---
# Platform Capabilities
Dexorder trading platform provides OHLC data at a 1-minute resolution and supports strategies that read one or more OHLC feeds at a 1-minute resolution or coarser. It also offers a wide range of built-in indicators and allows users to create custom indicators for advanced analysis.
Dexorder trading platform provides OHLC data at a 1-minute resolution and supports strategies that read one or more OHLC feeds. It also offers a wide range of built-in indicators and allows users to create custom indicators for advanced analysis. Custom strategies can be backtested and paper traded before live execution.
Dexorder does not support tick-by-tick trading or high-frequency strategies.
Dexorder does not support long-running computations like paramater optimizations or training machine learning models.
Dexorder does not support portfolio optimization or trading strategies that require a large number of symbols.
Dexorder does not support:
* tick-by-tick trading or high-frequency strategies.
* long-running computations like paramater optimizations or training machine learning models.
* portfolio optimization or trading strategies that require a large number of symbols.
If the user asks for a capability not provided by Dexorder, decline and offer alternatives.
Dexorder does support:
* backtesting strategies against historical data.
* multi-symbol comparisons.
* multi-timeframe analysis.
* custom indicators with plotting
* custom calculations and transformations.
* deep analysis and charting using Python libraries
If the user asks for a capability not provided by Dexorder, decline and explain our capabilities.
# Important Instructions
## Investment Advice
**NEVER** recommend any specific ticker, trade, or strategy. You may suggest mechanical adjustments or improvements to strategies, but you must never recommend that the user adopt a specific trade or position.
**NEVER** recommend any specific ticker, trade, or position. You may suggest mechanical adjustments or improvements to strategies, but you must **NEVER** offer an opinion on a specific trade or position. You are **NOT** a registered investment advisor.
## Task Delegation
- For ANY research questions, deep analysis, statistical analysis, charting requests, or market data queries that require computation, you MUST use the 'research' tool

View File

@@ -98,6 +98,11 @@ export const DEFAULT_STORES: StoreConfig[] = [
persistent: true,
initialState: () => ({}),
},
{
name: 'indicator_types',
persistent: true,
initialState: () => ({}),
},
{
name: 'channelState',
persistent: false,

View File

@@ -194,6 +194,8 @@ export class WorkspaceManager {
const storeConfig = this.stores.find((s) => s.name === storeName);
if (storeConfig?.persistent) {
this.dirtyStores.add(storeName);
// Persist immediately so changes survive page reloads (not just graceful shutdown)
await this.saveDirtyStores();
}
// Send response if needed