Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 36 additions & 37 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
"server": "node src/web/server.js",
"dev": "node src/web/server.js --dev",
"build": "node scripts/build.js",
"test": "node --test tests/*.test.js",
"test:unit": "node --test tests/*.test.js"
"test": "node --test tests/*.test.js src/**/__tests__/*.test.js",
"test:unit": "node --test tests/*.test.js src/**/__tests__/*.test.js"
},
"dependencies": {
"@anthropic-ai/sdk": "^0.36.3",
Expand Down
29 changes: 29 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,35 @@ export { Series, BarData, taCore, ta, math, BacktestEngine } from './pine/oakscr
// ── Charts / Lightweight Charts Plugins ──
export { generateChartHTML, generateMultiPaneHTML, generatePluginPine, listPlugins, CUSTOM_SERIES, DRAWING_PRIMITIVES } from './charts/plugins.js';

// ── Quantitative Research (institutional analytics) ──
export {
// returns
logReturns, pctReturns, cumulativeReturn, annualize,
// moments
mean, variance, stdev, skewness, kurtosis,
// risk-adjusted
sharpeRatio, sortinoRatio, calmarRatio, omegaRatio, informationRatio,
// drawdown
equityCurveFromReturns, maxDrawdown, underwaterCurve,
// VaR
historicalVaR, historicalCVaR, parametricVaR,
// time-series
autocorrelation, hurstExponent, halfLife, rollingBeta, rollingCorrelation,
// vol models
ewmaVolatility, realizedVolatility, garmanKlass,
// sizing
kellyFraction, volTargetSize, fixedFractional,
// portfolio
riskParityWeights, equalWeights, minVarianceWeights, covarianceMatrix, portfolioReturn,
// monte carlo
monteCarloBootstrap,
// regime + tearsheet
classifyRegime, performanceReport,
} from './pine/quant-research.js';

// ── Seamless TradingView Quant Tooling ──
export { quantReport, quantScan } from './tv/quant-report.js';

// ── Streaming / Monitoring ──
export { watchChart, scanSymbols, watchIndicator } from './agent/stream.js';

Expand Down
6 changes: 5 additions & 1 deletion src/pine/analyzer.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
* live TradingView compilation via the MCP server.
* Enhanced with linter integration, OakScript validation, and deep analysis.
*/
import { pine, capture } from '../mcp/client.js';
// CDP-touching imports (pine, capture) are deferred to function scope
// so static-analysis consumers (and their tests) don't pull in
// chrome-remote-interface unnecessarily.
import { lintPineScript, detectsRepainting, auditStrategy } from './linter.js';
import { taCore, BacktestEngine } from './oakscript.js';

Expand Down Expand Up @@ -216,6 +218,8 @@ export async function developScript(source, opts = {}) {
}
}

const { pine, capture } = await import('../mcp/client.js');

// Step 2: Server-side check (no chart needed)
log('🔍 Server-side validation...');
let checkResult;
Expand Down
Loading