Spaces:
Running
Running
Commit History
-
name: CI - Build & Push Docker Images
Verified signatureon: push: branches: [ main, master ] jobs: build-and-push: runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v4 - name: Set up QEMU (for cross-platform) uses: docker/setup-qemu-action@v2 - name: Set up Docker Buildx uses: docker/setup-buildx-action@v2 - name: Login to Docker Hub uses: docker/login-action@v2 with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Build and push backend uses: docker/build-push-action@v5 with: context: ./backend push: true tags: | dockerhub_user/realtime-dashboard-backend:latest dockerhub_user/realtime-dashboard-backend:${{ github.sha }} - name: Build and push frontend uses: docker/build-push-action@v5 with: context: ./frontend push: true tags: | dock…7ed726e -
// backend/dataSources.js
Verified signature// Fetches/combines data from CoinGecko (crypto), AlphaVantage (FX optional), // TradingEconomics (macro indicators, optional), and CFTC (COT) public archives. // Exports baseMockRows() and enrichRowsWithLiveData(rows) used by server.js. const axios = require('axios'); const AdmZip = require('adm-zip'); const { JSDOM } = require('jsdom'); const fs = require('fs'); const path = require('path'); const os = require('os'); const COINGECKO_SIMPLE_PRICE = 'https://api.coingecko.com/api/v3/simple/price'; const ALPHA_BASE = 'https://www.alphavantage.co/query'; const TE_BASE = 'https://api.tradingeconomics.com'; const CFTC_INDEX = 'https://www.cftc.gov/MarketReports/CommitmentsofTraders/HistoricalCompressed/index.htm'; // instruments (example set — expand to match your screenshot) const DEFAULT_ASSETS = [ { asset: "USOIL", type: "commodity", teSymbol: "oil" }, { asset: "BITCOIN", type: "crypto", cgId: "bitcoin" }, { asset: "COPPER", type: "commodity" }, { asset: "USDZAR", type: "fx",…46b6a38 -
ready-to-deploy code
Verified signature928d2d1 -
create a fundamental bias macro seasonality and trend
Verified signature94f3c8e -
copy the disgn only create with logo msonjo trade
Verified signaturef57176a -
fundamental bias
Verified signature1c21608 -
create for me website with real time data
Verified signature9465963 -
import { useEffect, useState } from 'react';
Verified signatureimport axios from 'axios'; import Heatmap from './Heatmap'; import Charts from './Charts'; export default function Dashboard() { const [data, setData] = useState([]); useEffect(() => { const fetchData = async () => { const res = await axios.get(`${process.env.NEXT_PUBLIC_API_BASE_URL}/api/data`); setData(res.data); }; fetchData(); const interval = setInterval(fetchData, 60000); return () => clearInterval(interval); }, []); return ( <div className="p-4 bg-gray-100 min-h-screen"> <header className="flex justify-between items-center bg-gray-800 text-white p-4 shadow-md"> <h1 className="text-2xl font-bold">Msonjo Trade</h1> <span>Last Updated: {new Date().toLocaleTimeString()}</span> </header> <Heatmap data={data} /> <Charts data={data} /> <table className="min-w-full mt-4 bg-white rounded shadow"> <thead className="bg-gray-200"> <tr> <th className="py-2 px-4">Asset<…2b98dbb -
Features of this Full Website
Verified signatureAll major & minor Forex pairs + commodities + indices Macro, micro fundamentals, seasonality, COT, options market integrated Single-page dashboard Color-coded heatmap for fast visual bias assessment Interactive chart for bias scores Real-time auto-refresh every 60s Fully deployable (Vercel frontend + Render/Railway backend)503a6a5 -
Perfect! Let’s combine everything into a complete live website that provides real-time fundamental bias scores for Forex, Commodities, and Indices, integrating:
Verified signatureMacro fundamentals (GDP, CPI, Interest Rates) Micro fundamentals (volume, market cap, sentiment) Seasonality (historical returns) COT report (CFTC data) Options market (implied volatility, open interest75139ed -
const fetchCOTData = async (symbol) => {
Verified signatureconst response = await fetch(`https://www.cftc.gov/dea/newcot/FinFutWk.txt`); const data = await response.text(); // Parse the data to extract relevant information // Calculate net positions and determine market sentiment // Return the COT score }; const calculateOverallScore = async (symbol) => { const macroScore = await getMacroScore(symbol); const microScore = await getMicroScore(symbol); const seasonalityScore = await getSeasonalityScore(symbol); const cotScore = await fetchCOTData(symbol); const overallScore = (macroScore + microScore + seasonalityScore + cotScore) / 4; return overallScore; };16169d9 -
const express = require("express");
Verified signatureconst fetch = require("node-fetch"); const NodeCache = require("node-cache"); const router = express.Router(); const cache = new NodeCache({ stdTTL: 600 }); const TE_KEY = process.env.TE_API_KEY; const CFTC_KEY = process.env.CFTC_API_KEY; const OPTIONS_KEY = process.env.OPTIONS_API_KEY; // Helpers function normalize(value,min,max){ if(value==null) return 50; if(value<=min) return 0; if(value>=max) return 100; return Math.round((value-min)/(max-min)*100); } function normalizeEdge(score){return Math.round((score/100-0.5)*18);} // Macro async function getMacro(country){ const cached = cache.get(`macro:${country}`); if(cached) return cached; try{ const base="https://api.tradingeconomics.com"; const [irR,cpiR,gdpR] = await Promise.all([ fetch(`${base}/country/${country}/interest-rate?c=${TE_KEY}`), fetch(`${base}/country/${country}/consumer-price-index?c=${TE_KEY}`), fetch(`${base}/country/${country}/gdp?c=${TE_KEY}`) ]); const [irJ,cpiJ,gd…a75e49f -
const express = require("express");
Verified signatureconst fetch = require("node-fetch"); const NodeCache = require("node-cache"); const router = express.Router(); const cache = new NodeCache({ stdTTL: 600 }); const TE_KEY = process.env.TE_API_KEY; const CFTC_KEY = process.env.CFTC_API_KEY; const OPTIONS_KEY = process.env.OPTIONS_API_KEY; // Helpers function normalize(value,min,max){ if(value==null) return 50; if(value<=min) return 0; if(value>=max) return 100; return Math.round((value-min)/(max-min)*100); } function normalizeEdge(score){return Math.round((score/100-0.5)*18);} // Macro async function getMacro(country){ const cached = cache.get(`macro:${country}`); if(cached) return cached; try{ const base="https://api.tradingeconomics.com"; const [irR,cpiR,gdpR] = await Promise.all([ fetch(`${base}/country/${country}/interest-rate?c=${TE_KEY}`), fetch(`${base}/country/${country}/consumer-price-index?c=${TE_KEY}`), fetch(`${base}/country/${country}/gdp?c=${TE_KEY}`) ]); const [irJ,cpiJ,gd…0d83122 -
creat for me fundamental bias with seasonality cot report bias with score and real time data
Verified signature8ad5353 -
initial commit
Verified signature613c077