diff --git a/docs/_config.yml b/docs/_config.yml index 9cdcc89..caa14d8 100644 --- a/docs/_config.yml +++ b/docs/_config.yml @@ -2,21 +2,19 @@ title: Trading Pal description: An advanced AI-powered trading platform with multi-broker integration and comprehensive market analysis capabilities baseurl: "/Trading_Pal-main" url: "https://united-visions.github.io" +repository: United-Visions/Trading_Pal-main + +# Theme settings +remote_theme: aksakalli/jekyll-doc-theme@gh-pages +bootwatch: slate # Build settings markdown: kramdown -theme: minima plugins: - jekyll-feed - jekyll-seo-tag - jekyll-sitemap -# Theme settings -minima: - skin: dark - social_links: - github: United-Visions/Trading_Pal-main - # Collections collections: docs: @@ -29,12 +27,12 @@ defaults: path: "" type: "docs" values: - layout: "default" + layout: "docs" - scope: path: "" type: "pages" values: - layout: "default" + layout: "page" # Navigation header_pages: diff --git a/docs/_data/docs.yml b/docs/_data/docs.yml index 5df2db0..5cfab53 100644 --- a/docs/_data/docs.yml +++ b/docs/_data/docs.yml @@ -1,11 +1,6 @@ -- title: Getting Started +- title: Documentation docs: - - home - - themes - - customization - -- title: Examples - docs: - - cheatsheet - - font-awesome - - bootstrap + - index + - data_server + - charts_display + - backtesting diff --git a/docs/_docs/backtesting.md b/docs/_docs/backtesting.md new file mode 100644 index 0000000..2b07817 --- /dev/null +++ b/docs/_docs/backtesting.md @@ -0,0 +1,96 @@ +--- +title: Backtesting +permalink: /docs/backtesting/ +--- + +# Trading Pal Backtesting Engine + +Trading Pal's advanced backtesting engine combines natural language processing with sophisticated market analysis to test trading strategies across multiple asset classes. Our AI-powered system enables traders to define strategies in plain English while providing comprehensive performance metrics and risk analysis. + +## Natural Language Strategy Definition + +### Example Strategy Commands +```text +"Buy when the 20-day moving average crosses above the 50-day moving average and RSI is below 70" + +"Sell if price drops below the lower Bollinger Band and volume is above the 20-day average" + +"Long entry when MACD histogram turns positive and price is above 200-day MA" + +"Place a buy order for 100 shares when RSI drops below 30" + +"Execute short position if price breaks below support with increased volume" +``` + +## Multi-Market Testing + +### Stocks (via Alpaca) +- US Equities +- Real-time data +- Historical prices +- Volume analysis + +### Forex (via OANDA) +- Major pairs +- Minor pairs +- Tick data +- Spread analysis + +### Crypto (via Alpaca) +- Major cryptocurrencies +- 24/7 trading +- Order book data +- Market depth + +## AI-Powered Analysis + +### Strategy Validation +Our AI agents validate trading strategies by analyzing: +- Historical performance +- Risk metrics +- Market conditions +- Correlation analysis + +### Performance Metrics +```json +{ + "totalReturn": "25.8%", + "sharpeRatio": 1.85, + "maxDrawdown": "12.3%", + "winRate": "62.5%", + "profitFactor": 1.75, + "averageTrade": "$245.50", + "tradeCount": 156 +} +``` + +## Advanced Features + +### Multi-Broker Testing +Test strategies across different brokers and markets simultaneously, with unified reporting and analysis. + +### AI Strategy Optimization +Machine learning algorithms optimize strategy parameters based on historical performance. + +### Risk Analysis +Comprehensive risk assessment including VaR, correlation analysis, and stress testing. + +## Natural Language Commands + +| Command Type | Example | Description | +|--------------|---------|-------------| +| Strategy Definition | "Buy when RSI is oversold and MACD crosses up" | Define trading rules in plain English | +| Performance Analysis | "Show me the strategy performance for last month" | Request specific performance metrics | +| Risk Management | "Set stop loss at 2% per trade" | Configure risk parameters | +| Portfolio Management | "Optimize position sizes for maximum Sharpe ratio" | Portfolio optimization commands | + +## Integration with Trading Pal Agent + +### AI Agent Capabilities +The Trading Pal AI agent enhances backtesting by: + +- Validating strategy logic and parameters +- Suggesting optimizations based on historical performance +- Monitoring for potential risks and correlations +- Providing natural language insights and recommendations +- Automating strategy deployment across multiple brokers diff --git a/docs/_docs/charts_display.md b/docs/_docs/charts_display.md new file mode 100644 index 0000000..3b9d36f --- /dev/null +++ b/docs/_docs/charts_display.md @@ -0,0 +1,121 @@ +--- +title: Charts Display +permalink: /docs/charts_display/ +--- + +# Trading Pal Charts Display + +Trading Pal's charting system provides a powerful visualization platform that integrates with our AI trading agent and multiple data sources. The system supports real-time data from both Alpaca and OANDA, enabling comprehensive market analysis across stocks, forex, and cryptocurrencies. + +## Chart Types + +### Candlestick +Japanese candlestick charts with customizable colors and styles for price action analysis. + +### Line +Clean line charts ideal for trend analysis and price movement tracking. + +### Bar +Traditional OHLC bar charts with optional volume indicators. + +### Area +Filled area charts for visualizing cumulative data and volume analysis. + +## Market Coverage + +### Stocks (Alpaca) +- US Equities +- Real-time Level 2 Data +- Pre/Post Market Data +- Historical OHLCV + +### Forex (OANDA) +- Major/Minor Pairs +- Tick-by-Tick Data +- Spread Information +- Position Book Data + +### Crypto (Alpaca) +- Major Cryptocurrencies +- 24/7 Market Data +- Order Book Depth +- Trade History + +## Technical Indicators + +| Category | Indicators | Customization | +|----------|------------|---------------| +| Trend | Moving Averages (SMA, EMA, WMA), MACD, ADX, Parabolic SAR | Periods, Colors, Styles | +| Momentum | RSI, Stochastic, CCI, Williams %R | Overbought/Oversold Levels | +| Volatility | Bollinger Bands, ATR, Standard Deviation | Deviation Multiplier, Period | +| Volume | OBV, Volume Profile, Money Flow Index | Time Periods, Display Style | + +## AI Integration + +### Natural Language Chart Control +Control charts using natural language commands: + +```text +"Show me a 1-hour candlestick chart for EUR/USD" +"Add Bollinger Bands with 20-period and 2 standard deviations" +"Display RSI in a separate panel below" +"Zoom to the last 5 trading days" +"Save this chart layout as 'Forex Analysis'" +``` + +## Interactive Features + +### Chart Controls +- 🖱️ Mouse wheel zoom +- 👆 Click and drag to pan +- 📏 Drawing tools +- 📊 Multi-timeframe analysis +- 🎯 Price alerts + +### Trading Integration +- 💼 One-click trading +- 📈 Position visualization +- ⚡ Real-time order updates +- 💰 P&L tracking +- 🎚️ Risk management overlays + +## Chart Configurations + +```javascript +// Example chart configuration +const chart = new Chart({ + type: 'candlestick', + data: { + symbol: 'NASDAQ:AAPL', + timeframe: '1H', + indicators: [{ + type: 'ema', + period: 20, + color: '#2196f3' + }, { + type: 'bollinger', + period: 20, + stdDev: 2, + fill: 'rgba(33, 150, 243, 0.1)' + }] + }, + options: { + theme: 'dark', + autoScale: true, + volume: true, + crosshair: true + } +}); +``` + +## Advanced Features + +### Trading Pal Integration +The charting system integrates with Trading Pal's core features: + +- AI-powered pattern recognition and alerts +- Automated strategy visualization +- Multi-broker order management +- Real-time position tracking +- Custom indicator development +- Chart-based backtesting diff --git a/docs/_docs/data_server.md b/docs/_docs/data_server.md new file mode 100644 index 0000000..aedb853 --- /dev/null +++ b/docs/_docs/data_server.md @@ -0,0 +1,114 @@ +--- +title: Data Server +permalink: /docs/data_server/ +--- + +# Trading Pal Data Server + +The Trading Pal data server is an experimental high-performance service that provides real-time market data to support various platform functionalities. This separate server architecture enables multi-functional capabilities including charting, algorithmic trading, AI analysis, and custom indicators. + +## Server Architecture + +### Core Features +- High-performance data processing +- Real-time market data streaming +- Historical data aggregation +- Multi-source data integration +- Custom data feed support + +### Integration Points +- Interactive charting system +- AI trading algorithms +- Technical indicators +- Backtesting engine +- Real-time analytics + +## API Endpoints + +### GET `/data/{symbol}` +Returns real-time market data for the specified symbol. + +#### Parameters + +| Parameter | Type | Description | +|-----------|------|-------------| +| symbol | string | Trading symbol in format `exchange:symbol` (e.g., `NASDAQ:AAPL`, `OANDA:EUR_USD`) | + +#### Example Response + +```json +{ + "symbol": "NASDAQ:AAPL", + "timestamp": "2025-02-13T10:32:00Z", + "price": 150.25, + "volume": 10000, + "bid": 150.20, + "ask": 150.30, + "high": 151.00, + "low": 149.50, + "indicators": { + "rsi": 45.67, + "macd": { + "line": 0.35, + "signal": 0.28, + "histogram": 0.07 + } + } +} +``` + +### GET `/historical/{symbol}/{start}/{end}` +Returns historical market data for the specified symbol and date range. + +#### Parameters + +| Parameter | Type | Description | +|-----------|------|-------------| +| symbol | string | Trading symbol in format `exchange:symbol` | +| start | string | Start date in YYYY-MM-DD format | +| end | string | End date in YYYY-MM-DD format | + +## Data Sources + +### Alpaca Integration +- US Stock market data +- Cryptocurrency data +- Real-time updates +- Historical data + +### OANDA Integration +- Forex market data +- CFD data +- Tick-by-tick data +- Historical rates + +### Custom Data Feeds +- Alternative data +- Economic indicators +- Market sentiment +- News feeds + +## Platform Integration + +### Multi-Functional Support +The data server enables various Trading Pal features: + +- Interactive charting with real-time updates +- AI-powered trading algorithms +- Custom technical indicators +- Backtesting simulations +- Market analysis tools +- Portfolio tracking +- Risk management systems +- Performance analytics + +## Future Development + +### Upcoming Features +The experimental data server is continuously evolving with planned enhancements: + +- Enhanced real-time data processing +- Additional data sources and markets +- Advanced caching mechanisms +- Machine learning data preprocessing +- Custom indicator development API diff --git a/docs/_docs/index.md b/docs/_docs/index.md index 6ae0294..44eb821 100644 --- a/docs/_docs/index.md +++ b/docs/_docs/index.md @@ -1,50 +1,60 @@ --- -title: Welcome -permalink: /docs/home/ -redirect_from: /docs/index.html +title: Welcome to Trading Pal +permalink: /docs/index/ --- -## Getting started +## Overview -[GitHub Pages](https://pages.github.com) can automatically generate and serve the website for you. -Let's say you have a username/organisation `my-org` and project `my-proj`; if you locate Jekyll source under `docs` folder of master branch in your repo `github.com/my-org/my-proj`, the website will be served on `my-org.github.io/my-proj`. -The good thing about coupling your documentation with the source repo is, whenever you merge features with regarding content to master branch, it will also be published on the webpage instantly. +Trading Pal is an advanced AI-powered trading platform that offers multi-broker integration and comprehensive market analysis capabilities. Our platform combines cutting-edge technology with user-friendly interfaces to provide traders with powerful tools for market analysis and automated trading. -1. Just [download the source](https://github.com/aksakalli/jekyll-doc-theme/archive/gh-pages.zip) into your repo under `docs` folder. -2. Edit site settings in `_config.yml` file according to your project. !!! `baseurl` should be your website's relative URI like `/my-proj` !!! -3. Replace `favicon.ico` and `assets/img/logonav.png` with your own logo. +## Key Features -## Writing content +### Multi-Broker Integration +- Support for multiple brokers including Alpaca and Oanda +- Unified interface for managing different trading accounts +- Seamless order execution across platforms -### Docs +### Data Server +- Real-time market data streaming +- Historical data analysis +- Custom data feeds integration +- [Learn more about Data Server](/docs/data_server/) -Docs are [collections](https://jekyllrb.com/docs/collections/) of pages stored under `_docs` folder. To create a new page: +### Charts Display +- Interactive technical analysis charts +- Multiple timeframe support +- Custom indicator implementation +- [Learn more about Charts Display](/docs/charts_display/) -**1.** Create a new Markdown as `_docs/my-page.md` and write [front matter](https://jekyllrb.com/docs/frontmatter/) & content such as: +### Backtesting +- Comprehensive strategy testing +- Historical performance analysis +- Risk assessment tools +- [Learn more about Backtesting](/docs/backtesting/) -``` ---- -title: My Page -permalink: /docs/my-page/ ---- +## Getting Started -Hello World! -``` +1. Clone the repository: + ```bash + git clone https://github.com/United-Visions/Trading_Pal-main.git + ``` -**2.** Add the pagename to `_data/docs.yml` file in order to list in docs navigation panel: +2. Install dependencies: + ```bash + pip install -r requirements.txt + ``` -``` -- title: My Group Title - docs: - - my-page -``` +3. Configure your broker settings in the user configuration file -### Blog posts +4. Run the platform: + ```bash + python main.py + ``` -Add a new Markdown file such as `2017-05-09-my-post.md` and write the content similar to other post examples. +## Contributing -### Pages +We welcome contributions to Trading Pal! Please read our [Contribution Guidelines](https://github.com/United-Visions/Trading_Pal-main/blob/main/CONTRIBUTION.md) for details on how to submit pull requests, report issues, and contribute to the project. -The homepage is located under `index.html` file. You can change the content or design completely different welcome page for your taste. (You can use [bootstrap components](http://getbootstrap.com/components/)) +## License -In order to add a new page, create a new `.html` or `.md` (markdown) file under root directory and link it in `_includes/topnav.html`. +Trading Pal is licensed under the MIT License. See the [LICENSE](https://github.com/United-Visions/Trading_Pal-main/blob/main/LICENSE) file for details. diff --git a/docs/_includes/head.html b/docs/_includes/head.html index 8792dd4..cff7a13 100644 --- a/docs/_includes/head.html +++ b/docs/_includes/head.html @@ -5,8 +5,6 @@ {%- seo -%} + {%- feed_meta -%} - {%- if jekyll.environment == 'production' and site.google_analytics -%} - {%- include google-analytics.html -%} - {%- endif -%} diff --git a/docs/_layouts/default.html b/docs/_layouts/default.html index 632cb6d..9e50846 100644 --- a/docs/_layouts/default.html +++ b/docs/_layouts/default.html @@ -1,13 +1,7 @@ - - - {%- include head.html -%} -
- {%- include header.html -%} -Trading Pal's advanced backtesting engine combines natural language processing with sophisticated market analysis to test trading strategies across multiple asset classes. Our AI-powered system enables traders to define strategies in plain English while providing comprehensive performance metrics and risk analysis.
-"Buy when the 20-day moving average crosses above the 50-day moving average and RSI is below 70"
-
-"Sell if price drops below the lower Bollinger Band and volume is above the 20-day average"
-
-"Long entry when MACD histogram turns positive and price is above 200-day MA"
-
-"Place a buy order for 100 shares when RSI drops below 30"
-
-"Execute short position if price breaks below support with increased volume"
- Our AI agents validate trading strategies by analyzing:
-{
- "totalReturn": "25.8%",
- "sharpeRatio": 1.85,
- "maxDrawdown": "12.3%",
- "winRate": "62.5%",
- "profitFactor": 1.75,
- "averageTrade": "$245.50",
- "tradeCount": 156
-}
- Test strategies across different brokers and markets simultaneously, with unified reporting and analysis.
-Machine learning algorithms optimize strategy parameters based on historical performance.
-Comprehensive risk assessment including VaR, correlation analysis, and stress testing.
-Command Type | -Example | -Description | -
---|---|---|
Strategy Definition | -"Buy when RSI is oversold and MACD crosses up" | -Define trading rules in plain English | -
Performance Analysis | -"Show me the strategy performance for last month" | -Request specific performance metrics | -
Risk Management | -"Set stop loss at 2% per trade" | -Configure risk parameters | -
Portfolio Management | -"Optimize position sizes for maximum Sharpe ratio" | -Portfolio optimization commands | -
The Trading Pal AI agent enhances backtesting by:
-Trading Pal's charting system provides a powerful visualization platform that integrates with our AI trading agent and multiple data sources. The system supports real-time data from both Alpaca and OANDA, enabling comprehensive market analysis across stocks, forex, and cryptocurrencies.
-Japanese candlestick charts with customizable colors and styles for price action analysis.
-Clean line charts ideal for trend analysis and price movement tracking.
-Traditional OHLC bar charts with optional volume indicators.
-Filled area charts for visualizing cumulative data and volume analysis.
-Category | -Indicators | -Customization | -
---|---|---|
Trend | -Moving Averages (SMA, EMA, WMA), MACD, ADX, Parabolic SAR | -Periods, Colors, Styles | -
Momentum | -RSI, Stochastic, CCI, Williams %R | -Overbought/Oversold Levels | -
Volatility | -Bollinger Bands, ATR, Standard Deviation | -Deviation Multiplier, Period | -
Volume | -OBV, Volume Profile, Money Flow Index | -Time Periods, Display Style | -
Control charts using natural language commands:
-"Show me a 1-hour candlestick chart for EUR/USD"
-"Add Bollinger Bands with 20-period and 2 standard deviations"
-"Display RSI in a separate panel below"
-"Zoom to the last 5 trading days"
-"Save this chart layout as 'Forex Analysis'"
- // Example chart configuration
-const chart = new Chart({
- type: 'candlestick',
- data: {
- symbol: 'NASDAQ:AAPL',
- timeframe: '1H',
- indicators: [{
- type: 'ema',
- period: 20,
- color: '#2196f3'
- }, {
- type: 'bollinger',
- period: 20,
- stdDev: 2,
- fill: 'rgba(33, 150, 243, 0.1)'
- }]
- },
- options: {
- theme: 'dark',
- autoScale: true,
- volume: true,
- crosshair: true
- }
-});
-The charting system integrates with Trading Pal's core features:
-The Trading Pal data server is an experimental high-performance service that provides real-time market data to support various platform functionalities. This separate server architecture enables multi-functional capabilities including charting, algorithmic trading, AI analysis, and custom indicators.
-Returns real-time market data for the specified symbol.
- -Parameter | -Type | -Description | -
---|---|---|
symbol | -string | -Trading symbol in format exchange:symbol (e.g., NASDAQ:AAPL , OANDA:EUR_USD ) |
-
{
- "symbol": "NASDAQ:AAPL",
- "timestamp": "2025-02-13T10:32:00Z",
- "price": 150.25,
- "volume": 10000,
- "bid": 150.20,
- "ask": 150.30,
- "high": 151.00,
- "low": 149.50,
- "indicators": {
- "rsi": 45.67,
- "macd": {
- "line": 0.35,
- "signal": 0.28,
- "histogram": 0.07
- }
- }
-}
- Returns historical market data for the specified symbol and date range.
- -Parameter | -Type | -Description | -
---|---|---|
symbol | -string | -Trading symbol in format exchange:symbol |
-
start | -string | -Start date in YYYY-MM-DD format | -
end | -string | -End date in YYYY-MM-DD format | -
The data server enables various Trading Pal features:
-The experimental data server is continuously evolving with planned enhancements:
-