nvda

Latest News

Stay up to date with the latest posts and updates

Recent Posts

Get the latest stories, exclusive insights, and special offers delivered straight to your inbox.

Hello world!

Posted by:

|

On:

|

nvda-prob-ai/ ├─ .env.example ├─ package.json ├─ pnpm-lock.yaml (or package-lock.json) ├─ server/ │ ├─ index.js │ ├─ scheduler.js │ ├─ logger.js │ ├─ db.js │ ├─ sql/ │ │ ├─ 001_init.sql │ │ └─ 002_indexes.sql │ ├─ services/ │ │ ├─ webull.js │ │ ├─ indicators.js │ │ ├─ news.js │ │ ├─ optionsFlow.js │ │ ├─ alerts.js │ │ └─ broker.js │ ├─ ai/ │ │ └─ claude.js │ └─ api/ │ ├─ routes.js │ └─ backtest.js └─ web/ ├─ index.html ├─ app.js └─ styles.css
# ---- Server ----
PORT=8080
NODE_ENV=development
BASE_SYMBOL=NVDA

# ---- Postgres ----
PGHOST=localhost
PGPORT=5432
PGDATABASE=nvda_ai
PGUSER=postgres
PGPASSWORD=postgres

# ---- Webull (OpenAPI - HTTP) ----
# You provide the official endpoints/keys from your Webull OpenAPI portal.
WEBULL_BASE_URL=https://api.webullfintech.com  # replace if different
WEBULL_APP_KEY=your_app_key
WEBULL_APP_SECRET=your_app_secret
WEBULL_ACCESS_TOKEN=your_access_token     # rotate/refresh as needed
WEBULL_ACCOUNT_ID=your_account_id

# ---- Claude API (Anthropic) ----
ANTHROPIC_API_KEY=sk-ant-...
ANTHROPIC_MODEL=claude-3-5-sonnet-latest

# ---- Alerts (optional) ----
[email protected]
[email protected]
SMTP_HOST=smtp.yourdomain.com
SMTP_PORT=587
SMTP_USER=smtp-user
SMTP_PASS=smtp-pass

DISCORD_WEBHOOK_URL=https://discord.com/api/webhooks/....

# ---- Strategy Controls ----
ANALYSIS_INTERVAL_CRON=*/5 * * * *      # every 5 minutes
BULLISH_ALERT_THRESHOLD=0.7             # 70%+
ENABLE_ALERTS=false
ENABLE_BROKER_TRADING=false             # stays false for analysis-only
DRY_RUN=true
pnpm init -y  # or npm init -y
pnpm add express socket.io ws axios pg dotenv node-cron chart.js winston nodemailer
pnpm add --save-dev nodemon
-- Symbols tracked (single: NVDA)
CREATE TABLE IF NOT EXISTS symbols (
  id SERIAL PRIMARY KEY,
  ticker TEXT UNIQUE NOT NULL
);

INSERT INTO symbols (ticker) VALUES ('NVDA')
ON CONFLICT (ticker) DO NOTHING;

-- Raw candles (store per timeframe)
-- timeframe: '5m'|'10m'|'15m'|'30m'|'1h'|'1d'
CREATE TABLE IF NOT EXISTS candles (
  id BIGSERIAL PRIMARY KEY,
  symbol_id INT REFERENCES symbols(id),
  timeframe TEXT NOT NULL,
  ts TIMESTAMPTZ NOT NULL,
  open NUMERIC NOT NULL,
  high NUMERIC NOT NULL,
  low NUMERIC NOT NULL,
  close NUMERIC NOT NULL,
  volume BIGINT NOT NULL,
  UNIQUE(symbol_id, timeframe, ts)
);

-- Indicators (EMA) per timeframe
CREATE TABLE IF NOT EXISTS indicators (
  id BIGSERIAL PRIMARY KEY,
  symbol_id INT REFERENCES symbols(id),
  timeframe TEXT NOT NULL,
  ts TIMESTAMPTZ NOT NULL,
  ema_21 NUMERIC,
  ema_50 NUMERIC,
  ema_100 NUMERIC,
  ema_200 NUMERIC,
  UNIQUE(symbol_id, timeframe, ts)
);

-- Options flow snapshots (aggregate metrics you compute per run)
CREATE TABLE IF NOT EXISTS options_flow (
  id BIGSERIAL PRIMARY KEY,
  symbol_id INT REFERENCES symbols(id),
  ts TIMESTAMPTZ NOT NULL,
  call_volume BIGINT,
  put_volume BIGINT,
  net_premium NUMERIC,
  sweep_count INT,
  unusual_count INT,
  UNIQUE(symbol_id, ts)
);

-- News headlines relevance snapshot
CREATE TABLE IF NOT EXISTS news_headlines (
  id BIGSERIAL PRIMARY KEY,
  symbol_id INT REFERENCES symbols(id),
  ts TIMESTAMPTZ NOT NULL,
  source TEXT,
  headline TEXT,
  sentiment NUMERIC, -- -1 to +1
  UNIQUE(symbol_id, ts, headline)
);

-- AI predictions
CREATE TABLE IF NOT EXISTS predictions (
  id BIGSERIAL PRIMARY KEY,
  symbol_id INT REFERENCES symbols(id),
  ts TIMESTAMPTZ NOT NULL,
  probability_bullish NUMERIC NOT NULL, -- 0..1
  rationale TEXT,
  horizon_minutes INT DEFAULT 60,
  features JSONB, -- snapshot of inputs
  UNIQUE(symbol_id, ts)
);

-- Backtests
CREATE TABLE IF NOT EXISTS backtests (
  id BIGSERIAL PRIMARY KEY,
  symbol_id INT REFERENCES symbols(id),
  started_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
  from_ts TIMESTAMPTZ NOT NULL,
  to_ts TIMESTAMPTZ NOT NULL,
  config JSONB,
  duration_ms INT
);

CREATE TABLE IF NOT EXISTS backtest_results (
  id BIGSERIAL PRIMARY KEY,
  backtest_id BIGINT REFERENCES backtests(id) ON DELETE CASCADE,
  ts TIMESTAMPTZ NOT NULL, -- decision time
  predicted_prob NUMERIC NOT NULL,
  actual_return_1h NUMERIC NOT NULL, -- percent change next 1h
  correct BOOLEAN NOT NULL,
  pnl NUMERIC,
  meta JSONB
);
const { createLogger, transports, format } = require('winston');

const logger = createLogger({
  level: 'info',
  format: format.combine(
    format.timestamp(),
    format.errors({ stack: true }),
    format.splat(),
    format.json()
  ),
  transports: [
    new transports.Console({ level: process.env.NODE_ENV === 'production' ? 'info' : 'debug' }),
    new transports.File({ filename: 'server.log', level: 'info' })
  ]
});

module.exports = logger;

Posted by

in

One response to “Hello world!”

  1. A WordPress Commenter Avatar

    Hi, this is a comment.
    To get started with moderating, editing, and deleting comments, please visit the Comments screen in the dashboard.
    Commenter avatars come from Gravatar.