feat: add autonomous paper-trading and calibration pipeline
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
const Database = require('better-sqlite3');
|
||||
const path = require('path');
|
||||
const { initAutonomySchema } = require('../src/autonomy/schema');
|
||||
|
||||
const symbol = String(process.argv[2] || '').trim().toUpperCase();
|
||||
if (!/^[A-Z0-9._/-]+$/.test(symbol)) {
|
||||
console.error('usage: node scripts/set-autonomy-instrument.js SYMBOL [broker]');
|
||||
process.exit(2);
|
||||
}
|
||||
const broker = String(process.argv[3] || 'simulator');
|
||||
const db = new Database(process.env.INTELLIGENCE_DB || path.resolve(process.cwd(), 'intelligence.sqlite'));
|
||||
initAutonomySchema(db);
|
||||
db.prepare(`
|
||||
INSERT INTO autonomy_instruments(symbol, broker, active, tradable)
|
||||
VALUES (?, ?, 1, 1)
|
||||
ON CONFLICT(symbol) DO UPDATE SET broker=excluded.broker, active=1, tradable=1, updated_at=datetime('now')
|
||||
`).run(symbol, broker);
|
||||
console.log(JSON.stringify({ symbol, broker, active: true, tradable: true }));
|
||||
db.close();
|
||||
Reference in New Issue
Block a user