Skip to content

FinceptTerminal is a modern finance application offering advanced market analytics, investment research, and economic data tools, designed for interactive exploration and data-driven decision-making in a user-friendly environment.

node editor update:

tilakpatel22c1575b261ede
diff --git a/fincept-terminal-desktop/src/components/tabs/ai-quant-lab/NodeEditorTab.tsx b/fincept-terminal-desktop/src/components/tabs/ai-quant-lab/NodeEditorTab.tsx
index 0c065936a..a4e5ce14f 100644
--- a/fincept-terminal-desktop/src/components/tabs/ai-quant-lab/NodeEditorTab.tsx
+++ b/fincept-terminal-desktop/src/components/tabs/ai-quant-lab/NodeEditorTab.tsx
@@ -72,7 +72,7 @@ import type { WorkflowTemplate } from './workflowTemplates';
import { pythonAgentService, AgentMetadata } from '@/services/chat/pythonAgentService';
import { workflowService } from '@/services/core/workflowService';
import { nodeExecutionManager } from '@/services/core/nodeExecutionManager';
-import { NodeRegistry } from '@/services/nodeSystem';
+import { NodeRegistry, NodeLoader } from '@/services/nodeSystem';
import { TabFooter } from '@/components/common/TabFooter';
export default function NodeEditorTab() {
@@ -128,8 +128,21 @@ export default function NodeEditorTab() {
const reactFlowWrapper = useRef<HTMLDivElement>(null);
- // Load MCP node configurations and Python agents on mount
+ // Load MCP node configurations, Python agents, and NodeSystem on mount
useEffect(() => {
+ const initializeNodeSystem = async () => {
+ try {
+ // Initialize the node system with all backend nodes
+ if (!NodeLoader.isLoaded()) {
+ console.log('[NodeEditor] Initializing Node System...');
+ await NodeLoader.loadAll();
+ console.log('[NodeEditor] Node System initialized:', NodeLoader.getLoadedNodeNames());
+ }
+ } catch (error) {
+ console.error('[NodeEditor] Failed to initialize Node System:', error);
+ }
+ };
+
const loadMCPNodes = async () => {
try {
const configs = await generateMCPNodeConfigs();
@@ -148,6 +161,7 @@ export default function NodeEditorTab() {
}
};
+ initializeNodeSystem();
loadMCPNodes();
loadAgents();
}, []);
diff --git a/fincept-terminal-desktop/src/components/tabs/ai-quant-lab/workflowTemplates-COMPLETE-ALL-82-NODES.ts b/fincept-terminal-desktop/src/components/tabs/ai-quant-lab/workflowTemplates-COMPLETE-ALL-82-NODES.ts
index 4eb08b4e1..1289959b6 100644
--- a/fincept-terminal-desktop/src/components/tabs/ai-quant-lab/workflowTemplates-COMPLETE-ALL-82-NODES.ts
+++ b/fincept-terminal-desktop/src/components/tabs/ai-quant-lab/workflowTemplates-COMPLETE-ALL-82-NODES.ts
@@ -46,91 +46,91 @@ const phase1Triggers: Node[] = [
// Trigger 1: Manual
{
id: 'trigger_manual',
- type: 'custom',
+ type: 'system',
position: { x: 200, y: 50 },
data: {
- label: 'Manual Trigger',
- nodeTypeName: 'manualTrigger',
- color: '#a855f7',
- hasInput: false,
- hasOutput: true,
- status: 'idle',
- parameters: { enabled: true },
+ node: {
+ type: 'ManualTriggerNode',
+ typeVersion: 1,
+ name: 'Manual Trigger',
+ parameters: { enabled: true },
+ disabled: false,
+ },
},
},
// Trigger 2: Schedule (Market Open)
{
id: 'trigger_schedule',
- type: 'custom',
+ type: 'system',
position: { x: 550, y: 50 },
data: {
- label: 'Market Open (9:30 AM)',
- nodeTypeName: 'scheduleTrigger',
- color: '#a855f7',
- hasInput: false,
- hasOutput: true,
- status: 'idle',
- parameters: { schedule: '30 9 * * 1-5', timezone: 'America/New_York' },
+ node: {
+ type: 'ScheduleTriggerNode',
+ typeVersion: 1,
+ name: 'Market Open (9:30 AM)',
+ parameters: { schedule: '30 9 * * 1-5', timezone: 'America/New_York' },
+ disabled: false,
+ },
},
},
// Trigger 3: Price Alert
{
id: 'trigger_price',
- type: 'custom',
+ type: 'system',
position: { x: 900, y: 50 },
data: {
- label: 'Price Break Alert',
- nodeTypeName: 'priceAlertTrigger',
- color: '#a855f7',
- hasInput: false,
- hasOutput: true,
- status: 'idle',
- parameters: { symbol: 'SPY', condition: 'crosses_above', threshold: 450, operator: 'greater_than' },
+ node: {
+ type: 'PriceAlertTriggerNode',
+ typeVersion: 1,
+ name: 'Price Break Alert',
+ parameters: { symbol: 'SPY', condition: 'crosses_above', threshold: 450, operator: 'greater_than' },
+ disabled: false,
+ },
},
},
// Trigger 4: News Event
{
id: 'trigger_news',
- type: 'custom',
+ type: 'system',
position: { x: 1250, y: 50 },
data: {
- label: 'Earnings/M&A News',
- nodeTypeName: 'newsEventTrigger',
- color: '#a855f7',
- hasInput: false,
- hasOutput: true,
- status: 'idle',
- parameters: { keywords: ['earnings', 'merger', 'acquisition'], sources: ['bloomberg', 'reuters'] },
+ node: {
+ type: 'NewsEventTriggerNode',
+ typeVersion: 1,
+ name: 'Earnings/M&A News',
+ parameters: { keywords: ['earnings', 'merger', 'acquisition'], sources: ['bloomberg', 'reuters'] },
+ disabled: false,
+ },
},
},
// Trigger 5: Market Event (Volatility)
{
id: 'trigger_market',
- type: 'custom',
+ type: 'system',
position: { x: 1600, y: 50 },
data: {
- label: 'VIX Spike Alert',
- nodeTypeName: 'marketEventTrigger',
- color: '#a855f7',
- hasInput: false,
- hasOutput: true,
- status: 'idle',
- parameters: { eventType: 'volatilitySpike', threshold: 25, metric: 'VIX' },
+ node: {
+ type: 'MarketEventTriggerNode',
+ typeVersion: 1,
+ name: 'VIX Spike Alert',
+ parameters: { eventType: 'volatilitySpike', threshold: 25, metric: 'VIX' },
+ disabled: false,
+ },
},
},
// Trigger 6: Webhook (External Signal)
{
id: 'trigger_webhook',
- type: 'custom',
+ type: 'system',
position: { x: 1950, y: 50 },
data: {
- label: 'External Signal API',
- nodeTypeName: 'webhookTrigger',
- color: '#a855f7',
- hasInput: false,
- hasOutput: true,
- status: 'idle',
- parameters: { path: '/webhook/trading-signal', method: 'POST', authentication: 'api_key' },
+ node: {
+ type: 'WebhookTriggerNode',
+ typeVersion: 1,
+ name: 'External Signal API',
+ parameters: { path: '/webhook/trading-signal', method: 'POST', authentication: 'api_key' },
+ disabled: false,
+ },
},
},
];
@@ -159,100 +159,100 @@ const phase2DataAcquisition: Node[] = [
// Market Data Layer
{
id: 'market_quote',
- type: 'custom',
+ type: 'system',
position: { x: 200, y: 450 },
data: {
- label: 'Real-Time Quotes',
- nodeTypeName: 'getQuote',
- color: '#22c55e',
- hasInput: true,
- hasOutput: true,
- status: 'idle',
- parameters: { symbols: ['AAPL', 'MSFT', 'GOOGL', 'AMZN', 'META'], provider: 'yahoo', updateFrequency: '1s' },
+ node: {
+ type: 'GetQuoteNode',
+ typeVersion: 1,
+ name: 'Real-Time Quotes',
+ parameters: { symbols: ['AAPL', 'MSFT', 'GOOGL', 'AMZN', 'META'], provider: 'yahoo', updateFrequency: '1s' },
+ disabled: false,
+ },
},
},
{
id: 'market_historical',
- type: 'custom',
+ type: 'system',
position: { x: 550, y: 450 },
data: {
- label: 'Historical OHLCV',
- nodeTypeName: 'getHistoricalData',
- color: '#22c55e',
- hasInput: true,
- hasOutput: true,
- status: 'idle',
- parameters: { symbols: 'AAPL,MSFT,GOOGL,AMZN,META', interval: '1d', period: '2y' },
+ node: {
+ type: 'GetHistoricalDataNode',
+ typeVersion: 1,
+ name: 'Historical OHLCV',
+ parameters: { symbols: 'AAPL,MSFT,GOOGL,AMZN,META', interval: '1d', period: '2y' },
+ disabled: false,
+ },
},
},
{
id: 'market_depth',
- type: 'custom',
+ type: 'system',
position: { x: 900, y: 450 },
data: {
- label: 'L2 Order Book',
- nodeTypeName: 'getMarketDepth',
- color: '#22c55e',
- hasInput: true,
- hasOutput: true,
- status: 'idle',
- parameters: { symbol: 'AAPL', levels: 20, exchange: 'NASDAQ' },
+ node: {
+ type: 'GetMarketDepthNode',
+ typeVersion: 1,
+ name: 'L2 Order Book',
+ parameters: { symbol: 'AAPL', levels: 20, exchange: 'NASDAQ' },
+ disabled: false,
+ },
},
},
{
id: 'market_stream',
- type: 'custom',
+ type: 'system',
position: { x: 1250, y: 450 },
data: {
- label: 'WebSocket Stream',
- nodeTypeName: 'streamQuotes',
- color: '#22c55e',
- hasInput: true,
- hasOutput: true,
- status: 'idle',
- parameters: { symbols: ['AAPL', 'SPY'], channels: ['trades', 'quotes'], provider: 'alpaca' },
+ node: {
+ type: 'StreamQuotesNode',
+ typeVersion: 1,
+ name: 'WebSocket Stream',
+ parameters: { symbols: ['AAPL', 'SPY'], channels: ['trades', 'quotes'], provider: 'alpaca' },
+ disabled: false,
+ },
},
},
{
id: 'market_fundamentals',
- type: 'custom',
+ type: 'system',
position: { x: 1600, y: 450 },
data: {
- label: 'Company Fundamentals',
- nodeTypeName: 'getFundamentals',
- color: '#22c55e',
- hasInput: true,
- hasOutput: true,
- status: 'idle',
- parameters: { symbol: 'AAPL', metrics: ['pe_ratio', 'eps', 'revenue', 'profit_margin'] },
+ node: {
+ type: 'GetFundamentalsNode',
+ typeVersion: 1,
+ name: 'Company Fundamentals',
+ parameters: { symbol: 'AAPL', metrics: ['pe_ratio', 'eps', 'revenue', 'profit_margin'] },
+ disabled: false,
+ },
},
},
{
id: 'market_stats',
- type: 'custom',
+ type: 'system',
position: { x: 1950, y: 450 },
data: {
- label: 'Ticker Statistics',
- nodeTypeName: 'getTickerStats',
- color: '#22c55e',
- hasInput: true,
- hasOutput: true,
- status: 'idle',
- parameters: { symbol: 'AAPL', stats: ['volume', 'avg_volume', '52w_high', '52w_low'] },
+ node: {
+ type: 'GetTickerStatsNode',
+ typeVersion: 1,
+ name: 'Ticker Statistics',
+ parameters: { symbol: 'AAPL', stats: ['volume', 'avg_volume', '52w_high', '52w_low'] },
+ disabled: false,
+ },
},
},
{
id: 'market_yfinance',
- type: 'custom',
+ type: 'system',
position: { x: 2300, y: 450 },
data: {
- label: 'YFinance Data',
- nodeTypeName: 'yfinance',
- color: '#22c55e',
- hasInput: true,
- hasOutput: true,
- status: 'idle',
- parameters: { symbol: 'AAPL', period: '1y', interval: '1d', metrics: 'all' },
+ node: {
+ type: 'YFinanceNode',
+ typeVersion: 1,
+ name: 'YFinance Data',
+ parameters: { symbol: 'AAPL', period: '1y', interval: '1d', metrics: 'all' },
+ disabled: false,
+ },
},
},
@@ -395,114 +395,114 @@ const phase3DataProcessing: Node[] = [
// Transform Layer
{
id: 'transform_filter',
- type: 'custom',
+ type: 'system',
position: { x: 200, y: 1150 },
data: {
- label: 'Filter High Volume',
- nodeTypeName: 'filter',
- color: '#ec4899',
- hasInput: true,
- hasOutput: true,
- status: 'idle',
- parameters: { field: 'volume', operator: 'greaterThan', value: 5000000, description: 'Only high-liquidity stocks' },
+ node: {
+ type: 'FilterTransformNode',
+ typeVersion: 1,
+ name: 'Filter High Volume',
+ parameters: { field: 'volume', operator: 'greaterThan', value: 5000000, description: 'Only high-liquidity stocks' },
+ disabled: false,
+ },
},
},
{
id: 'transform_map',
- type: 'custom',
+ type: 'system',
position: { x: 550, y: 1150 },
data: {
- label: 'Calculate Returns',
- nodeTypeName: 'map',
- color: '#ec4899',
- hasInput: true,
- hasOutput: true,
- status: 'idle',
- parameters: { expression: '(close - open) / open * 100', outputField: 'daily_return' },
+ node: {
+ type: 'MapNode',
+ typeVersion: 1,
+ name: 'Calculate Returns',
+ parameters: { expression: '(close - open) / open * 100', outputField: 'daily_return' },
+ disabled: false,
+ },
},
},
{
id: 'transform_aggregate',
- type: 'custom',
+ type: 'system',
position: { x: 900, y: 1150 },
data: {
- label: 'Total Volume',
- nodeTypeName: 'aggregate',
- color: '#ec4899',
- hasInput: true,
- hasOutput: true,
- status: 'idle',
- parameters: { operation: 'sum', field: 'volume', groupBy: 'symbol' },
+ node: {
+ type: 'AggregateNode',
+ typeVersion: 1,
+ name: 'Total Volume',
+ parameters: { operation: 'sum', field: 'volume', groupBy: 'symbol' },
+ disabled: false,
+ },
},
},
{
id: 'transform_sort',
- type: 'custom',
+ type: 'system',
position: { x: 1250, y: 1150 },
data: {
- label: 'Rank by Performance',
- nodeTypeName: 'sort',
- color: '#ec4899',
- hasInput: true,
- hasOutput: true,
- status: 'idle',
- parameters: { field: 'daily_return', direction: 'descending', limit: 10 },
+ node: {
+ type: 'SortNode',
+ typeVersion: 1,
+ name: 'Rank by Performance',
+ parameters: { field: 'daily_return', direction: 'descending', limit: 10 },
+ disabled: false,
+ },
},
},
{
id: 'transform_groupby',
- type: 'custom',
+ type: 'system',
position: { x: 1600, y: 1150 },
data: {
- label: 'Group by Sector',
- nodeTypeName: 'groupBy',
- color: '#ec4899',
- hasInput: true,
- hasOutput: true,
- status: 'idle',
- parameters: { field: 'sector', aggregations: { avg_return: 'mean', total_volume: 'sum' } },
+ node: {
+ type: 'GroupByNode',
+ typeVersion: 1,
+ name: 'Group by Sector',
+ parameters: { field: 'sector', aggregations: { avg_return: 'mean', total_volume: 'sum' } },
+ disabled: false,
+ },
},
},
{
id: 'transform_join',
- type: 'custom',
+ type: 'system',
position: { x: 1950, y: 1150 },
data: {
- label: 'Join Price + Fundamentals',
- nodeTypeName: 'join',
- color: '#ec4899',
- hasInput: true,
- hasOutput: true,
- status: 'idle',
- parameters: { joinKey: 'symbol', joinType: 'inner', leftSource: 'prices', rightSource: 'fundamentals' },
+ node: {
+ type: 'JoinNode',
+ typeVersion: 1,
+ name: 'Join Price + Fundamentals',
+ parameters: { joinKey: 'symbol', joinType: 'inner', leftSource: 'prices', rightSource: 'fundamentals' },
+ disabled: false,
+ },
},
},
{
id: 'transform_dedupe',
- type: 'custom',
+ type: 'system',
position: { x: 2300, y: 1150 },
data: {
- label: 'Remove Duplicates',
- nodeTypeName: 'deduplicate',
- color: '#ec4899',
- hasInput: true,
- hasOutput: true,
- status: 'idle',
- parameters: { uniqueField: 'symbol', keepFirst: true },
+ node: {
+ type: 'DeduplicateNode',
+ typeVersion: 1,
+ name: 'Remove Duplicates',
+ parameters: { uniqueField: 'symbol', keepFirst: true },
+ disabled: false,
+ },
},
},
{
id: 'transform_reshape',
- type: 'custom',
+ type: 'system',
position: { x: 2650, y: 1150 },
data: {
- label: 'Format for Analytics',
- nodeTypeName: 'reshape',
- color: '#ec4899',
- hasInput: true,
- hasOutput: true,
- status: 'idle',
- parameters: { outputFormat: 'timeseries', indexField: 'date', columnsField: 'symbol' },
+ node: {
+ type: 'ReshapeNode',
+ typeVersion: 1,
+ name: 'Format for Analytics',
+ parameters: { outputFormat: 'timeseries', indexField: 'date', columnsField: 'symbol' },
+ disabled: false,
+ },
},
},
@@ -620,16 +620,16 @@ const phase4Analytics: Node[] = [
},
{
id: 'analytics_portfolio_opt',
- type: 'custom',
+ type: 'system',
position: { x: 550, y: 1850 },
data: {
- label: 'MPT Optimization',
- nodeTypeName: 'portfolioOptimization',
- color: '#06b6d4',
- hasInput: true,
- hasOutput: true,
- status: 'idle',
- parameters: { method: 'max_sharpe', constraints: { max_weight: 0.3, min_weight: 0.05 }, riskFreeRate: 0.05 },
+ node: {
+ type: 'PortfolioOptimizationNode',
+ typeVersion: 1,
+ name: 'MPT Optimization',
+ parameters: { method: 'max_sharpe', constraints: { max_weight: 0.3, min_weight: 0.05 }, riskFreeRate: 0.05 },
+ disabled: false,
+ },
},
},
{
@@ -652,44 +652,44 @@ const phase4Analytics: Node[] = [
},
{
id: 'analytics_risk',
- type: 'custom',
+ type: 'system',
position: { x: 1250, y: 1850 },
data: {
- label: 'Risk Metrics (VaR/CVaR)',
- nodeTypeName: 'riskAnalysis',
- color: '#06b6d4',
- hasInput: true,
- hasOutput: true,
- status: 'idle',
- parameters: { confidenceLevel: 0.95, timeHorizon: '1d', riskMetrics: ['var', 'cvar', 'maxDrawdown', 'sharpe', 'sortino'] },
+ node: {
+ type: 'RiskAnalysisNode',
+ typeVersion: 1,
+ name: 'Risk Metrics (VaR/CVaR)',
+ parameters: { confidenceLevel: 0.95, timeHorizon: '1d', riskMetrics: ['var', 'cvar', 'maxDrawdown', 'sharpe', 'sortino'] },
+ disabled: false,
+ },
},
},
{
id: 'analytics_performance',
- type: 'custom',
+ type: 'system',
position: { x: 1600, y: 1850 },
data: {
- label: 'Performance vs Benchmark',
- nodeTypeName: 'performanceMetrics',
- color: '#06b6d4',
- hasInput: true,
- hasOutput: true,
- status: 'idle',
- parameters: { benchmarkSymbol: 'SPY', riskFreeRate: 0.05, metrics: ['alpha', 'beta', 'sharpe', 'information_ratio'] },
+ node: {
+ type: 'PerformanceMetricsNode',
+ typeVersion: 1,
+ name: 'Performance vs Benchmark',
+ parameters: { benchmarkSymbol: 'SPY', riskFreeRate: 0.05, metrics: ['alpha', 'beta', 'sharpe', 'information_ratio'] },
+ disabled: false,
+ },
},
},
{
id: 'analytics_correlation',
- type: 'custom',
+ type: 'system',
position: { x: 1950, y: 1850 },
data: {
- label: 'Correlation Matrix',
- nodeTypeName: 'correlationMatrix',
- color: '#06b6d4',
- hasInput: true,
- hasOutput: true,
- status: 'idle',
- parameters: { method: 'pearson', minCorrelation: 0.5, visualize: true },
+ node: {
+ type: 'CorrelationMatrixNode',
+ typeVersion: 1,
+ name: 'Correlation Matrix',
+ parameters: { method: 'pearson', minCorrelation: 0.5, visualize: true },
+ disabled: false,
+ },
},
},
];
@@ -736,58 +736,58 @@ const phase5AIDecision: Node[] = [
},
{
id: 'agent_geopolitics',
- type: 'custom',
+ type: 'system',
position: { x: 550, y: 2300 },
data: {
- label: 'Geopolitics Risk Agent',
- nodeTypeName: 'geopoliticsAgent',
- color: '#8b5cf6',
- hasInput: true,
- hasOutput: true,
- status: 'idle',
- parameters: { region: 'global', analysisType: 'macro_risk', factors: ['trade', 'sanctions', 'conflicts'] },
+ node: {
+ type: 'GeopoliticsAgentNode',
+ typeVersion: 1,
+ name: 'Geopolitics Risk Agent',
+ parameters: { region: 'global', analysisType: 'macro_risk', factors: ['trade', 'sanctions', 'conflicts'] },
+ disabled: false,
+ },
},
},
{
id: 'agent_hedgefund',
- type: 'custom',
+ type: 'system',
position: { x: 900, y: 2300 },
data: {
- label: 'Hedge Fund Strategy',
- nodeTypeName: 'hedgeFundAgent',
- color: '#8b5cf6',
- hasInput: true,
- hasOutput: true,
- status: 'idle',
- parameters: { strategy: 'long_short_equity', leverage: 2.0, hedgeRatio: 0.7 },
+ node: {
+ type: 'HedgeFundAgentNode',
+ typeVersion: 1,
+ name: 'Hedge Fund Strategy',
+ parameters: { strategy: 'long_short_equity', leverage: 2.0, hedgeRatio: 0.7 },
+ disabled: false,
+ },
},
},
{
id: 'agent_investor',
- type: 'custom',
+ type: 'system',
position: { x: 1250, y: 2300 },
data: {
- label: 'Investor Persona (Buffett)',
- nodeTypeName: 'investorAgent',
- color: '#8b5cf6',
- hasInput: true,
- hasOutput: true,
- status: 'idle',
- parameters: { persona: 'warren_buffett', strategy: 'value_investing', timeHorizon: 'long_term' },
+ node: {
+ type: 'InvestorAgentNode',
+ typeVersion: 1,
+ name: 'Investor Persona (Buffett)',
+ parameters: { persona: 'warren_buffett', strategy: 'value_investing', timeHorizon: 'long_term' },
+ disabled: false,
+ },
},
},
{
id: 'agent_multi',
- type: 'custom',
+ type: 'system',
position: { x: 1600, y: 2300 },
data: {
- label: 'Multi-Agent Committee',
- nodeTypeName: 'multiAgent',
- color: '#8b5cf6',
- hasInput: true,
- hasOutput: true,
- status: 'idle',
- parameters: { agents: ['technical_analyst', 'fundamental_analyst', 'risk_manager', 'portfolio_manager'], votingMethod: 'weighted' },
+ node: {
+ type: 'MultiAgentNode',
+ typeVersion: 1,
+ name: 'Multi-Agent Committee',
+ parameters: { agents: ['technical_analyst', 'fundamental_analyst', 'risk_manager', 'portfolio_manager'], votingMethod: 'weighted' },
+ disabled: false,
+ },
},
},
{
@@ -814,58 +814,58 @@ const phase5AIDecision: Node[] = [
const phase6RiskManagement: Node[] = [
{
id: 'safety_risk_check',
- type: 'custom',
+ type: 'system',
position: { x: 200, y: 2750 },
data: {
- label: 'Pre-Trade Risk Check',
- nodeTypeName: 'riskCheck',
- color: '#ef4444',
- hasInput: true,
- hasOutput: true,
- status: 'idle',
- parameters: { maxRiskPerTrade: 0.02, maxPortfolioRisk: 0.1, checkCorrelation: true },
+ node: {
+ type: 'RiskCheckNode',
+ typeVersion: 1,
+ name: 'Pre-Trade Risk Check',
+ parameters: { maxRiskPerTrade: 0.02, maxPortfolioRisk: 0.1, checkCorrelation: true },
+ disabled: false,
+ },
},
},
{
id: 'safety_position_size',
- type: 'custom',
+ type: 'system',
position: { x: 550, y: 2750 },
data: {
- label: 'Kelly Criterion Sizing',
- nodeTypeName: 'positionSizeLimit',
- color: '#ef4444',
- hasInput: true,
- hasOutput: true,
- status: 'idle',
- parameters: { method: 'kelly', maxPositionSize: 20000, minPositionSize: 1000, fractionalKelly: 0.25 },
+ node: {
+ type: 'PositionSizeLimitNode',
+ typeVersion: 1,
+ name: 'Kelly Criterion Sizing',
+ parameters: { method: 'kelly', maxPositionSize: 20000, minPositionSize: 1000, fractionalKelly: 0.25 },
+ disabled: false,
+ },
},
},
{
id: 'safety_loss_limit',
- type: 'custom',
+ type: 'system',
position: { x: 900, y: 2750 },
data: {
- label: 'Loss Limits & Circuit Breaker',
- nodeTypeName: 'lossLimit',
- color: '#ef4444',
- hasInput: true,
- hasOutput: true,
- status: 'idle',
- parameters: { maxDailyLoss: 2000, maxWeeklyLoss: 5000, stopAllOnBreach: true },
+ node: {
+ type: 'LossLimitNode',
+ typeVersion: 1,
+ name: 'Loss Limits & Circuit Breaker',
+ parameters: { maxDailyLoss: 2000, maxWeeklyLoss: 5000, stopAllOnBreach: true },
+ disabled: false,
+ },
},
},
{
id: 'safety_trading_hours',
- type: 'custom',
+ type: 'system',
position: { x: 1250, y: 2750 },
data: {
- label: 'Trading Hours Gate',
- nodeTypeName: 'tradingHoursCheck',
- color: '#ef4444',
- hasInput: true,
- hasOutput: true,
- status: 'idle',
- parameters: { marketHours: '09:30-16:00', timezone: 'America/New_York', allowPreMarket: false, allowAfterHours: false },
+ node: {
+ type: 'TradingHoursCheckNode',
+ typeVersion: 1,
+ name: 'Trading Hours Gate',
+ parameters: { marketHours: '09:30-16:00', timezone: 'America/New_York', allowPreMarket: false, allowAfterHours: false },
+ disabled: false,
+ },
},
},
];
@@ -876,100 +876,100 @@ const phase6RiskManagement: Node[] = [
const phase7ExecutionControl: Node[] = [
{
id: 'control_ifelse',
- type: 'custom',
+ type: 'system',
position: { x: 200, y: 3000 },
data: {
- label: 'Trade or Hold Decision',
- nodeTypeName: 'ifElse',
- color: '#f59e0b',
- hasInput: true,
- hasOutput: true,
- status: 'idle',
- parameters: { condition: 'confidence_score > 0.75 && risk_score < 0.3', trueLabel: 'EXECUTE', falseLabel: 'HOLD' },
+ node: {
+ type: 'IfElseNode',
+ typeVersion: 1,
+ name: 'Trade or Hold Decision',
+ parameters: { condition: 'confidence_score > 0.75 && risk_score < 0.3', trueLabel: 'EXECUTE', falseLabel: 'HOLD' },
+ disabled: false,
+ },
},
},
{
id: 'control_switch',
- type: 'custom',
+ type: 'system',
position: { x: 550, y: 3000 },
data: {
- label: 'Strategy Router',
- nodeTypeName: 'switch',
- color: '#f59e0b',
- hasInput: true,
- hasOutput: true,
- status: 'idle',
- parameters: { field: 'strategy_type', cases: { momentum: 'momentum_execution', mean_reversion: 'mean_reversion_execution', breakout: 'breakout_execution' } },
+ node: {
+ type: 'SwitchNode',
+ typeVersion: 1,
+ name: 'Strategy Router',
+ parameters: { field: 'strategy_type', cases: { momentum: 'momentum_execution', mean_reversion: 'mean_reversion_execution', breakout: 'breakout_execution' } },
+ disabled: false,
+ },
},
},
{
id: 'control_loop',
- type: 'custom',
+ type: 'system',
position: { x: 900, y: 3000 },
data: {
- label: 'Order Slicing Loop',
- nodeTypeName: 'loop',
- color: '#f59e0b',
- hasInput: true,
- hasOutput: true,
- status: 'idle',
- parameters: { maxIterations: 10, breakCondition: 'order_filled || attempts > 10', loopVariable: 'slice_index' },
+ node: {
+ type: 'LoopNode',
+ typeVersion: 1,
+ name: 'Order Slicing Loop',
+ parameters: { maxIterations: 10, breakCondition: 'order_filled || attempts > 10', loopVariable: 'slice_index' },
+ disabled: false,
+ },
},
},
{
id: 'control_wait',
- type: 'custom',
+ type: 'system',
position: { x: 1250, y: 3000 },
data: {
- label: 'Order Execution Delay',
- nodeTypeName: 'wait',
- color: '#f59e0b',
- hasInput: true,
- hasOutput: true,
- status: 'idle',
- parameters: { duration: 2000, unit: 'milliseconds', reason: 'rate_limiting' },
+ node: {
+ type: 'WaitNode',
+ typeVersion: 1,
+ name: 'Order Execution Delay',
+ parameters: { duration: 2000, unit: 'milliseconds', reason: 'rate_limiting' },
+ disabled: false,
+ },
},
},
{
id: 'control_split',
- type: 'custom',
+ type: 'system',
position: { x: 200, y: 3250 },
data: {
- label: 'Split Order Flow',
- nodeTypeName: 'split',
- color: '#f59e0b',
- hasInput: true,
- hasOutput: true,
- status: 'idle',
- parameters: { splitCount: 3, splitBy: 'symbol', parallel: true },
+ node: {
+ type: 'SplitNode',
+ typeVersion: 1,
+ name: 'Split Order Flow',
+ parameters: { splitCount: 3, splitBy: 'symbol', parallel: true },
+ disabled: false,
+ },
},
},
{
id: 'control_merge2',
- type: 'custom',
+ type: 'system',
position: { x: 550, y: 3250 },
data: {
- label: 'Merge Execution Paths',
- nodeTypeName: 'merge',
- color: '#f59e0b',
- hasInput: true,
- hasOutput: true,
- status: 'idle',
- parameters: { mergeMode: 'all', waitForAll: true },
+ node: {
+ type: 'MergeNode',
+ typeVersion: 1,
+ name: 'Merge Execution Paths',
+ parameters: { mergeMode: 'all', waitForAll: true },
+ disabled: false,
+ },
},
},
{
id: 'control_error',
- type: 'custom',
+ type: 'system',
position: { x: 900, y: 3250 },
data: {
- label: 'Error Handler & Retry',
- nodeTypeName: 'errorHandler',
- color: '#ef4444',
- hasInput: true,
- hasOutput: true,
- status: 'idle',
- parameters: { retryCount: 3, retryDelay: 1000, fallbackBehavior: 'cancel_order', logErrors: true },
+ node: {
+ type: 'ErrorHandlerNode',
+ typeVersion: 1,
+ name: 'Error Handler & Retry',
+ parameters: { retryCount: 3, retryDelay: 1000, fallbackBehavior: 'cancel_order', logErrors: true },
+ disabled: false,
+ },
},
},
];
@@ -980,114 +980,114 @@ const phase7ExecutionControl: Node[] = [
const phase8TradingOps: Node[] = [
{
id: 'trading_place_order',
- type: 'custom',
+ type: 'system',
position: { x: 200, y: 3500 },
data: {
- label: 'Place Smart Order',
- nodeTypeName: 'placeOrder',
- color: '#10b981',
- hasInput: true,
- hasOutput: true,
- status: 'idle',
- parameters: { symbol: 'AAPL', side: 'buy', quantity: 100, orderType: 'limit', timeInForce: 'day', smartRouting: true },
+ node: {
+ type: 'PlaceOrderNode',
+ typeVersion: 1,
+ name: 'Place Smart Order',
+ parameters: { symbol: 'AAPL', side: 'buy', quantity: 100, orderType: 'limit', timeInForce: 'day', smartRouting: true },
+ disabled: false,
+ },
},
},
{
id: 'trading_modify_order',
- type: 'custom',
+ type: 'system',
position: { x: 550, y: 3500 },
data: {
- label: 'Modify Price/Quantity',
- nodeTypeName: 'modifyOrder',
- color: '#10b981',
- hasInput: true,
- hasOutput: true,
- status: 'idle',
- parameters: { orderId: 'dynamic', newPrice: 'nbbo_mid', newQuantity: 'partial_fill_remainder' },
+ node: {
+ type: 'ModifyOrderNode',
+ typeVersion: 1,
+ name: 'Modify Price/Quantity',
+ parameters: { orderId: 'dynamic', newPrice: 'nbbo_mid', newQuantity: 'partial_fill_remainder' },
+ disabled: false,
+ },
},
},
{
id: 'trading_cancel_order',
- type: 'custom',
+ type: 'system',
position: { x: 900, y: 3500 },
data: {
- label: 'Cancel Unfilled Orders',
- nodeTypeName: 'cancelOrder',
- color: '#10b981',
- hasInput: true,
- hasOutput: true,
- status: 'idle',
- parameters: { orderId: 'all_pending', cancelAfter: 300, reason: 'timeout' },
+ node: {
+ type: 'CancelOrderNode',
+ typeVersion: 1,
+ name: 'Cancel Unfilled Orders',
+ parameters: { orderId: 'all_pending', cancelAfter: 300, reason: 'timeout' },
+ disabled: false,
+ },
},
},
{
id: 'trading_get_positions',
- type: 'custom',
+ type: 'system',
position: { x: 1250, y: 3500 },
data: {
- label: 'Get Open Positions',
- nodeTypeName: 'getPositions',
- color: '#10b981',
- hasInput: true,
- hasOutput: true,
- status: 'idle',
- parameters: { account: 'main', includeUnrealizedPnL: true, filterSymbols: [] },
+ node: {
+ type: 'GetPositionsNode',
+ typeVersion: 1,
+ name: 'Get Open Positions',
+ parameters: { account: 'main', includeUnrealizedPnL: true, filterSymbols: [] },
+ disabled: false,
+ },
},
},
{
id: 'trading_get_holdings',
- type: 'custom',
+ type: 'system',
position: { x: 1600, y: 3500 },
data: {
- label: 'Portfolio Holdings',
- nodeTypeName: 'getHoldings',
- color: '#10b981',
- hasInput: true,
- hasOutput: true,
- status: 'idle',
- parameters: { account: 'main', includeMarketValue: true, includeCostBasis: true },
+ node: {
+ type: 'GetHoldingsNode',
+ typeVersion: 1,
+ name: 'Portfolio Holdings',
+ parameters: { account: 'main', includeMarketValue: true, includeCostBasis: true },
+ disabled: false,
+ },
},
},
{
id: 'trading_get_orders',
- type: 'custom',
+ type: 'system',
position: { x: 1950, y: 3500 },
data: {
- label: 'Order History',
- nodeTypeName: 'getOrders',
- color: '#10b981',
- hasInput: true,
- hasOutput: true,
- status: 'idle',
- parameters: { status: 'all', startDate: 'today', limit: 100 },
+ node: {
+ type: 'GetOrdersNode',
+ typeVersion: 1,
+ name: 'Order History',
+ parameters: { status: 'all', startDate: 'today', limit: 100 },
+ disabled: false,
+ },
},
},
{
id: 'trading_get_balance',
- type: 'custom',
+ type: 'system',
position: { x: 200, y: 3750 },
data: {
- label: 'Account Balance & Buying Power',
- nodeTypeName: 'getBalance',
- color: '#10b981',
- hasInput: true,
- hasOutput: true,
- status: 'idle',
- parameters: { account: 'main', includeBuyingPower: true, includeMarginUsed: true },
+ node: {
+ type: 'GetBalanceNode',
+ typeVersion: 1,
+ name: 'Account Balance & Buying Power',
+ parameters: { account: 'main', includeBuyingPower: true, includeMarginUsed: true },
+ disabled: false,
+ },
},
},
{
id: 'trading_close_position',
- type: 'custom',
+ type: 'system',
position: { x: 550, y: 3750 },
data: {
- label: 'Close Position (SL/TP)',
- nodeTypeName: 'closePosition',
- color: '#10b981',
- hasInput: true,
- hasOutput: true,
- status: 'idle',
- parameters: { symbol: 'AAPL', closeType: 'market', reason: 'stop_loss_hit', percentage: 100 },
+ node: {
+ type: 'ClosePositionNode',
+ typeVersion: 1,
+ name: 'Close Position (SL/TP)',
+ parameters: { symbol: 'AAPL', closeType: 'market', reason: 'stop_loss_hit', percentage: 100 },
+ disabled: false,
+ },
},
},
];
@@ -1114,86 +1114,86 @@ const phase9Monitoring: Node[] = [
{
id: 'notify_webhook',
- type: 'custom',
+ type: 'system',
position: { x: 200, y: 4200 },
data: {
- label: 'Webhook to Portfolio Tracker',
- nodeTypeName: 'webhookNotification',
- color: '#06b6d4',
- hasInput: true,
- hasOutput: true,
- status: 'idle',
- parameters: { url: 'https://api.portfolio-tracker.com/webhook', method: 'POST', headers: { 'Authorization': 'Bearer token' } },
+ node: {
+ type: 'WebhookNotificationNode',
+ typeVersion: 1,
+ name: 'Webhook to Portfolio Tracker',
+ parameters: { url: 'https://api.portfolio-tracker.com/webhook', method: 'POST', headers: { 'Authorization': 'Bearer token' } },
+ disabled: false,
+ },
},
},
{
id: 'notify_email',
- type: 'custom',
+ type: 'system',
position: { x: 550, y: 4200 },
data: {
- label: 'Email Alert',
- nodeTypeName: 'email',
- color: '#06b6d4',
- hasInput: true,
- hasOutput: true,
- status: 'idle',
- parameters: { to: '[email protected]', subject: 'Trade Execution Alert', template: 'trade_confirmation', priority: 'high' },
+ node: {
+ type: 'EmailNode',
+ typeVersion: 1,
+ name: 'Email Alert',
+ parameters: { to: '[email protected]', subject: 'Trade Execution Alert', template: 'trade_confirmation', priority: 'high' },
+ disabled: false,
+ },
},
},
{
id: 'notify_telegram',
- type: 'custom',
+ type: 'system',
position: { x: 900, y: 4200 },
data: {
- label: 'Telegram to Trading Team',
- nodeTypeName: 'telegram',
- color: '#06b6d4',
- hasInput: true,
- hasOutput: true,
- status: 'idle',
- parameters: { chatId: '123456789', botToken: 'env.TELEGRAM_BOT_TOKEN', parseMode: 'markdown' },
+ node: {
+ type: 'TelegramNode',
+ typeVersion: 1,
+ name: 'Telegram to Trading Team',
+ parameters: { chatId: '123456789', botToken: 'env.TELEGRAM_BOT_TOKEN', parseMode: 'markdown' },
+ disabled: false,
+ },
},
},
{
id: 'notify_discord',
- type: 'custom',
+ type: 'system',
position: { x: 1250, y: 4200 },
data: {
- label: 'Discord Trading Channel',
- nodeTypeName: 'discord',
- color: '#06b6d4',
- hasInput: true,
- hasOutput: true,
- status: 'idle',
- parameters: { webhookUrl: 'https://discord.com/api/webhooks/...', username: 'TradingBot', embeds: true },
+ node: {
+ type: 'DiscordNode',
+ typeVersion: 1,
+ name: 'Discord Trading Channel',
+ parameters: { webhookUrl: 'https://discord.com/api/webhooks/...', username: 'TradingBot', embeds: true },
+ disabled: false,
+ },
},
},
{
id: 'notify_slack',
- type: 'custom',
+ type: 'system',
position: { x: 1600, y: 4200 },
data: {
- label: 'Slack #algo-trading',
- nodeTypeName: 'slack',
- color: '#06b6d4',
- hasInput: true,
- hasOutput: true,
- status: 'idle',
- parameters: { channel: '#algo-trading', webhookUrl: 'env.SLACK_WEBHOOK', attachments: true },
+ node: {
+ type: 'SlackNode',
+ typeVersion: 1,
+ name: 'Slack #algo-trading',
+ parameters: { channel: '#algo-trading', webhookUrl: 'env.SLACK_WEBHOOK', attachments: true },
+ disabled: false,
+ },
},
},
{
id: 'notify_sms',
- type: 'custom',
+ type: 'system',
position: { x: 1950, y: 4200 },
data: {
- label: 'SMS for Critical Alerts',
- nodeTypeName: 'sms',
- color: '#06b6d4',
- hasInput: true,
- hasOutput: true,
- status: 'idle',
- parameters: { phoneNumber: '+1234567890', service: 'twilio', onlyCritical: true },
+ node: {
+ type: 'SMSNode',
+ typeVersion: 1,
+ name: 'SMS for Critical Alerts',
+ parameters: { phoneNumber: '+1234567890', service: 'twilio', onlyCritical: true },
+ disabled: false,
+ },
},
},
];