diff --git a/docusaurus/docs/getting-started.md b/docusaurus/docs/getting-started.md index ef7da3006f0..6c5e59bffac 100644 --- a/docusaurus/docs/getting-started.md +++ b/docusaurus/docs/getting-started.md @@ -1,162 +1,526 @@ ---- -id: getting-started -title: Getting Started ---- +import React, { useState, useEffect } from "react"; +import { + BarChart3, TrendingUp, TrendingDown, AlertCircle, Settings, Activity, + DollarSign, Target, Bell, LineChart, Percent, Clock, ChevronRight, + X, Plus, Zap, Server, Wifi, WifiOff +} from "lucide-react"; + +const CryptoTradingBot = () => { + // Estados principais + const [isLoggedIn, setIsLoggedIn] = useState(false); + const [currentPage, setCurrentPage] = useState("dashboard"); + const [selectedSymbol, setSelectedSymbol] = useState("BTCUSDT"); + const [botActive, setBotActive] = useState(false); + const [showSettings, setShowSettings] = useState(false); + const [showAlertModal, setShowAlertModal] = useState(false); + const [priceAlerts, setPriceAlerts] = useState([]); + const [newAlert, setNewAlert] = useState({ symbol: "BTCUSDT", price: "", condition: "above" }); + const [webhookUrl, setWebhookUrl] = useState("https://seu-dominio.com/webhook/demo-client"); + const [apiConnected, setApiConnected] = useState(false); + const [credentials, setCredentials] = useState({ username: "", password: "" }); + const [stats, setStats] = useState({ + balance: 10000, + profit: 1250.5, + profitPercent: 12.51, + activeTrades: 3, + winRate: 68.5, + totalTrades: 47 + }); + const [prices, setPrices] = useState({ + BTCUSDT: 67845.32, + ETHUSDT: 3456.78, + DOGEUSDT: 0.1234, + SHIBUSDT: 0.00001234, + PEPEUSDT: 0.00000123, + SOLUSDT: 156.89 + }); + const [signals, setSignals] = useState([ + { + id: 1, + symbol: "BTCUSDT", + action: "BUY", + entry: 67500, + stopLoss: 66800, + takeProfit: 69500, + score: 7, + time: "10:25:33", + status: "active", + analysis: { + elliot: "Wave 3 detected", + wyckoff: "Accumulation", + ict: "Bullish FVG", + fibonacci: "0.618 retracement" + } + }, + { + id: 2, + symbol: "ETHUSDT", + action: "SELL", + entry: 3480, + stopLoss: 3520, + takeProfit: 3380, + score: 6, + time: "09:15:22", + status: "active", + analysis: { + elliot: "Wave 5 completion", + wyckoff: "Distribution", + ict: "Order Block", + fibonacci: "1.618 extension" + } + } + ]); + const [trades, setTrades] = useState([ + { id: 1, symbol: "BTCUSDT", type: "BUY", entry: 65000, exit: 67500, profit: 385.5, profitPercent: 3.85, date: "2025-11-03 08:30" }, + { id: 2, symbol: "SOLUSDT", type: "SELL", entry: 160, exit: 155, profit: 312.5, profitPercent: 3.13, date: "2025-11-03 07:15" }, + { id: 3, symbol: "ETHUSDT", type: "BUY", entry: 3300, exit: 3450, profit: 454.55, profitPercent: 4.55, date: "2025-11-02 22:45" }, + { id: 4, symbol: "DOGEUSDT", type: "BUY", entry: 0.118, exit: 0.123, profit: 423.73, profitPercent: 4.24, date: "2025-11-02 18:20" } + ]); + const [fibLevels, setFibLevels] = useState({ + high: 70000, + low: 65000, + levels: { + '0': 70000, + '0.236': 68820, + '0.382': 68090, + '0.5': 67500, + '0.618': 66910, + '0.786': 66070, + '1': 65000, + '1.272': 63640, + '1.618': 61910 + } + }); + + // Simulação de atualização de preços e alertas + useEffect(() => { + if (!isLoggedIn || !botActive) return; + const interval = setInterval(() => { + setPrices(prev => { + const newPrices = {}; + Object.keys(prev).forEach(symbol => { + const change = (Math.random() - 0.5) * (prev[symbol] * 0.002); + newPrices[symbol] = Math.max(0, prev[symbol] + change); + }); + return newPrices; + }); + setPriceAlerts(prevAlerts => + prevAlerts.map(alert => { + if (alert.triggered) return alert; + const currentPrice = prices[alert.symbol]; + if ( + (alert.condition === "above" && currentPrice >= parseFloat(alert.price)) || + (alert.condition === "below" && currentPrice <= parseFloat(alert.price)) + ) { + return { ...alert, triggered: true }; + } + return alert; + }) + ); + }, 2000); + return () => clearInterval(interval); + // eslint-disable-next-line + }, [isLoggedIn, botActive]); + + // Login + const handleLogin = e => { + e.preventDefault(); + if (credentials.username && credentials.password) setIsLoggedIn(true); + }; + + // Alertas de preço + const handleAddAlert = () => { + if (newAlert.price) { + setPriceAlerts([ + ...priceAlerts, + { ...newAlert, id: Date.now(), triggered: false, created: new Date().toLocaleTimeString() } + ]); + setNewAlert({ symbol: "BTCUSDT", price: "", condition: "above" }); + setShowAlertModal(false); + } + }; + const handleDeleteAlert = id => setPriceAlerts(priceAlerts.filter(alert => alert.id !== id)); + + // Fibonacci + const calculateFibLevels = () => { + const diff = fibLevels.high - fibLevels.low; + setFibLevels({ + ...fibLevels, + levels: { + '0': fibLevels.high, + '0.236': fibLevels.high - diff * 0.236, + '0.382': fibLevels.high - diff * 0.382, + '0.5': fibLevels.high - diff * 0.5, + '0.618': fibLevels.high - diff * 0.618, + '0.786': fibLevels.high - diff * 0.786, + '1': fibLevels.low, + '1.272': fibLevels.low - diff * 0.272, + '1.618': fibLevels.low - diff * 0.618 + } + }); + }; + + // Login page + if (!isLoggedIn) + return ( +
+
+
+
+ +
+

Crypto Trading Bot

+

Elliot + Wyckoff + ICT + Fibonacci

+
+
+
+ + setCredentials({ ...credentials, username: e.target.value })} + className="w-full px-4 py-3 bg-gray-700 border border-gray-600 rounded-lg text-white focus:ring-2 focus:ring-blue-500 focus:border-transparent" + placeholder="Digite seu usuário" + required + /> +
+
+ + setCredentials({ ...credentials, password: e.target.value })} + className="w-full px-4 py-3 bg-gray-700 border border-gray-600 rounded-lg text-white focus:ring-2 focus:ring-blue-500 focus:border-transparent" + placeholder="Digite sua senha" + required + /> +
+ +
+
+

Demo: use qualquer usuário e senha

+
+
+
+ ); + + // Main app + return ( +
+ {/* Header */} +
+
+
+
+ +

Crypto Trading Bot

+ {apiConnected ? ( + + API Conectada + + ) : ( + + API Desconectada + + )} +
+
+ + + +
+
+ {/* Menu */} +
+ + + + + +
+
+
+ + {/* Main Content */} +
+ + {/* Dashboard */} + {currentPage === "dashboard" && ( +
+ {/* Status do Bot */} +
+
+
+

Status do Bot

+

Sistema de trading automatizado

+
+ +
+ {botActive && ( +
+
+ Bot ativo - Analisando mercado... +
+ )} +
+ + {/* Estatísticas */} +
+ {/* Saldo */} +
+
+
+

Saldo Total

+

${stats.balance.toFixed(2)}

+
+ +
+
+ {/* Lucro */} +
+
+
+

Lucro Total

+

+${stats.profit.toFixed(2)}

+

+{stats.profitPercent}%

+
+ +
+
+ {/* Trades Ativos */} +
+
+
+

Trades Ativos

+

{stats.activeTrades}

+
+ +
+
+ {/* Taxa de Acerto */} +
+
+
+

Taxa de Acerto

+

{stats.winRate}%

+

{stats.totalTrades} trades

+
+ +
+
+
+ + {/* Preços de Mercado */} +
+

Preços de Mercado (Tempo Real)

+
+ {Object.entries(prices).map(([symbol, price]) => ( +
+

{symbol}

+

${price.toFixed(symbol.includes("SHIB") || symbol.includes("PEPE") ? 8 : 2)}

+
+ ))} +
+
+ + {/* Sinais Ativos */} +
+

Sinais Ativos

+
+ {signals.map(signal => ( +
+ {/* Header */} +
+
+ + {signal.action} + + {signal.symbol} + {signal.time} +
+ {/* Score */} +
+ Score: + {signal.score}/9 +
+
+ + {/* Preços */} +
+ {/* Entry */} +

Entry

${signal.entry}

+ {/* Stop Loss */} +

Stop Loss

${signal.stopLoss}

+ {/* Take Profit */} +

Take Profit

${signal.takeProfit}

+
+ + {/* Análises */} +
+ {/* Elliot */} +

Elliot

{signal.analysis.elliot}

+ {/* Wyckoff */} +

Wyckoff

{signal.analysis.wyckoff}

+ {/* ICT */} +

ICT

{signal.analysis.ict}

+ {/* Fibonacci */} +

Fibonacci

{signal.analysis.fibonacci}

+
+ +
))} +
+
+ +
)} + + {/* Charts Page - Gráficos reais do TradingView */} + {currentPage === "charts" && ( +
+ {/* Gráficos principais */} +
+ {/* Header */} +
+

Gráficos TradingView

+ {/* Seleção de símbolo */} + +
+ + {/* Gráficos TradingView */} + {/* Use BINANCE para maior liquidez nos widgets públicos */} + {/* https://www.tradingview.com/widget/advanced-chart/ */} + {/* https://www.tradingview.com/widgetembed/?symbol=BINANCE%3ABTCUSDT&interval=15&theme=dark&style=1&locale=br */} + {/* https://www.tradingview.com/widgetembed/?symbol=BINANCE%3ABTCUSDT&interval=60&theme=dark&style=1&locale=br */} + + {/* Dois gráficos lado a lado (15m e H1) */} +
+ {/* Gráfico de 15 minutos */} +
+ {/* eslint-disable-next-line jsx-a11y/iframe-has-title */} + +
+ + {/* Gráfico de H1 */} +
+ {/* eslint-disable-next-line jsx-a11y/iframe-has-title */} + +
+ +
+ +
+ +
)} + + {/* Analysis Page */} + {currentPage === "analysis" && ( + // ... (igual ao seu exemplo anterior) + // Por questão de espaço não repito aqui mas mantenha o bloco do seu exemplo! + // Se quiser o bloco completo da análise técnica também em detalhe peça! + <> + {/* Níveis de Fibonacci */} + {/* ... */} + + )} + + {/* History Page */} + {currentPage === "history" && ( + // ... (igual ao seu exemplo anterior) + <> + {/* Histórico de Trades */} + {/* ... */} + + )} + + {/* Webhook/API Page */} + {currentPage === "webhook" && ( + // ... (igual ao seu exemplo anterior) + <> + {/* Webhook/API Configuração e Logs */} + {/* ... */} + + )} + +
+ + {/* Alert Modal */} + {showAlertModal && ( + // ... (igual ao seu exemplo anterior) + <> + {/* Modal de Alertas de Preço */} + {/* ... */} + + )} + + {/* Settings Modal */} + {showSettings && ( + // ... (igual ao seu exemplo anterior) + <> + {/* Modal de Configurações do Bot/API */} + {/* ... */} + + )} + +
+ ); +}; + +export default CryptoTradingBot; -Create React App is an officially supported way to create single-page React -applications. It offers a modern build setup with no configuration. - -## Quick Start - -```sh -npx create-react-app my-app -cd my-app -npm start -``` - -> If you've previously installed `create-react-app` globally via `npm install -g create-react-app`, we recommend you uninstall the package using `npm uninstall -g create-react-app` or `yarn global remove create-react-app` to ensure that `npx` always uses the latest version. - -_([npx](https://medium.com/@maybekatz/introducing-npx-an-npm-package-runner-55f7d4bd282b) comes with npm 5.2+ and higher, see [instructions for older npm versions](https://gist.github.com/gaearon/4064d3c23a77c74a3614c498a8bb1c5f))_ - -Then open [http://localhost:3000/](http://localhost:3000/) to see your app. - -When you’re ready to deploy to production, create a minified bundle with `npm run build`. - -

-npm start -

- -### Get Started Immediately - -You **don’t** need to install or configure tools like webpack or Babel. They are preconfigured and hidden so that you can focus on the code. - -Create a project, and you’re good to go. - -## Creating an App - -**You’ll need to have Node >= 14 on your local development machine** (but it’s not required on the server). You can use [nvm](https://github.com/creationix/nvm#installation) (macOS/Linux) or [nvm-windows](https://github.com/coreybutler/nvm-windows#node-version-manager-nvm-for-windows) to switch Node versions between different projects. - -To create a new app, you may choose one of the following methods: - -### npx - -```sh -npx create-react-app@latest my-app -``` - -_([npx](https://medium.com/@maybekatz/introducing-npx-an-npm-package-runner-55f7d4bd282b) comes with npm 5.2+ and higher, see [instructions for older npm versions](https://gist.github.com/gaearon/4064d3c23a77c74a3614c498a8bb1c5f))_ - -### npm - -```sh -npm init react-app my-app -``` - -_`npm init ` is available in npm 6+_ - -### Yarn - -```sh -yarn create react-app my-app -``` - -_`yarn create` is available in Yarn 0.25+_ - -### Selecting a template - -You can now optionally start a new app from a template by appending `--template [template-name]` to the creation command. - -If you don't select a template, we'll create your project with our base template. - -Templates are always named in the format `cra-template-[template-name]`, however you only need to provide the `[template-name]` to the creation command. - -```sh -npx create-react-app my-app --template [template-name] -``` - -> You can find a list of available templates by searching for ["cra-template-\*"](https://www.npmjs.com/search?q=cra-template-*) on npm. - -Our [Custom Templates](custom-templates.md) documentation describes how you can build your own template. - -#### Creating a TypeScript app - -You can start a new TypeScript app using templates. To use our provided TypeScript template, append `--template typescript` to the creation command. - -```sh -npx create-react-app my-app --template typescript -``` - -If you already have a project and would like to add TypeScript, see our [Adding TypeScript](adding-typescript.md) documentation. - -### Selecting a package manager - -When you create a new app, the CLI will use [npm](https://docs.npmjs.com) or [Yarn](https://yarnpkg.com/) to install dependencies, depending on which tool you use to run `create-react-app`. For example: - -```sh -# Run this to use npm -npx create-react-app my-app -# Or run this to use yarn -yarn create react-app my-app -``` - -## Output - -Running any of these commands will create a directory called `my-app` inside the current folder. Inside that directory, it will generate the initial project structure and install the transitive dependencies: - -``` -my-app -├── README.md -├── node_modules -├── package.json -├── .gitignore -├── public -│ ├── favicon.ico -│ ├── index.html -│ ├── logo192.png -│ ├── logo512.png -│ ├── manifest.json -│ └── robots.txt -└── src - ├── App.css - ├── App.js - ├── App.test.js - ├── index.css - ├── index.js - ├── logo.svg - ├── serviceWorker.js - └── setupTests.js -``` - -No configuration or complicated folder structures, only the files you need to build your app. Once the installation is done, you can open your project folder: - -```sh -cd my-app -``` - -## Scripts - -Inside the newly created project, you can run some built-in commands: - -### `npm start` or `yarn start` - -Runs the app in development mode. Open [http://localhost:3000](http://localhost:3000) to view it in the browser. - -The page will automatically reload if you make changes to the code. You will see the build errors and lint warnings in the console. - -

-Build errors -

- -### `npm test` or `yarn test` - -Runs the test watcher in an interactive mode. By default, runs tests related to files changed since the last commit. - -[Read more about testing](running-tests.md). - -### `npm run build` or `yarn build` - -Builds the app for production to the `build` folder. It correctly bundles React in production mode and optimizes the build for the best performance. - -The build is minified and the filenames include the hashes. - -Your app is ready to be deployed.