Spaces:
Running
Running
Upload lib/knowledge-base.js with huggingface_hub
Browse files123451 unmodified line789101112131 unmodified line151617181920211 unmodified line232425262728291 unmodified line313233343536371 unmodified line3940414243444546474849// Simulated JSON Knowledge Base// In a real app, this would be loaded from a file or databaseexport const DEFAULT_KNOWLEDGE_BASE = [{id: 1,1 unmodified linecondition: "RSI < 30",action: "LONG",confidence: "High",description: "When the Relative Strength Index drops below 30, the asset is considered oversold and likely to rebound."},{id: 2,1 unmodified linecondition: "RSI > 70",action: "SHORT",confidence: "High",description: "When RSI exceeds 70, the asset is overbought and a correction is imminent."},{id: 3,1 unmodified linecondition: "SMA_50 > SMA_200",action: "LONG",confidence: "Medium",description: "When the 50-day moving average crosses above the 200-day moving average."},{id: 4,1 unmodified linecondition: "SMA_50 < SMA_200",action: "SHORT",confidence: "Medium",description: "When the 50-day moving average crosses below the 200-day moving average."},{id: 5,1 unmodified linecondition: "Volume > Avg_Volume * 2",action: "FOLLOW_TREND",confidence: "Medium",description: "Significant volume increase indicates strong institutional interest."}]// Store for uploaded JSON rules (in-memory for demo, would use database in production)let uploadedRules = []export function getKnowledgeBase() {1231 unmodified line567891011121 unmodified line14151617181920211 unmodified line23242526272829301 unmodified line32333435363738391 unmodified line4142434445464748495051export const DEFAULT_KNOWLEDGE_BASE = [{id: 1,1 unmodified linecondition: "RSI < 30",action: "LONG",confidence: "High",description: "Market is oversold. Expecting a bounce.",strategy: "mean_reversion"},{id: 2,1 unmodified linecondition: "RSI > 70",action: "SHORT",confidence: "High",description: "Market is overbought. Expecting a correction.",strategy: "mean_reversion"},{id: 3,1 unmodified linecondition: "SMA_50 > SMA_200",action: "LONG",confidence: "Medium",description: "Bullish trend confirmation.",strategy: "trend_following"},{id: 4,1 unmodified linecondition: "SMA_50 < SMA_200",action: "SHORT",confidence: "Medium",description: "Bearish trend confirmation.",strategy: "trend_following"},{id: 5,1 unmodified linecondition: "Volume > Avg_Volume * 2",action: "FOLLOW_TREND",confidence: "Medium",description: "High volume indicates strong momentum.",strategy: "momentum"}]let uploadedRules = []export function getKnowledgeBase() {
lib/knowledge-base.js+10-8