StockLens Documentation

Comprehensive guides and references for using our LSTM stock prediction platform

Getting Started

API Setup Guide

Getting a Polygon.io API Key

  1. Visit polygon.io and create an account
  2. Navigate to your dashboard and generate a new API key
  3. Copy the API key to your clipboard
  4. Paste the API key in the input field on the prediction page
  5. Your key is stored locally in your browser and never sent to our servers

API Rate Limits

Polygon.io has different rate limits based on your plan:

  • Free plan: 5 API calls per minute
  • Starter plan: 30 API calls per minute
  • Developer plan: 200 API calls per minute
  • Advanced plan: 1000 API calls per minute

Model Training Guide

LSTM Architecture

Our model uses a multi-layer LSTM architecture with the following components:

  • Input layer with 60-day lookback window
  • Two LSTM layers with 50 units each
  • Dropout layers for regularization (0.2 rate)
  • Dense output layer with linear activation

Training Parameters

Optimize your model with these parameters:

  • Epochs: 10-200 (more epochs for complex patterns)
  • Batch size: 32 (balance between speed and accuracy)
  • Lookback period: 30-120 days (adjust based on volatility)
  • Learning rate: Adaptive (managed automatically)

Backtesting Guide

Backtesting Strategies

Choose from three different trading strategies:

  • Buy & Hold: Traditional benchmark strategy
  • LSTM Prediction: Follow model buy/sell signals
  • Hybrid: Combine LSTM predictions with technical indicators

Performance Metrics

Understand key performance indicators:

  • Total Return: Overall profit/loss percentage
  • Annualized Return: Return projected to yearly basis
  • Max Drawdown: Largest peak-to-trough decline
  • Sharpe Ratio: Risk-adjusted return measure
  • Win Rate: Percentage of profitable trades

Frequently Asked Questions

How accurate are the predictions?

Our LSTM models typically achieve 70-85% accuracy for 30-day predictions, with accuracy decreasing for longer timeframes. Actual results vary by stock and market conditions.

Can I use this for live trading?

While our models are designed for educational and research purposes, some users do incorporate the predictions into their trading strategies. Always paper trade first and use proper risk management.

How much historical data is used?

By default, we use 1 year of daily data for training. You can extend this through the Historical Data page to get more data from alternative sources.

What technical indicators are used?

Our models incorporate RSI, MACD, moving averages, Bollinger Bands, and volume indicators as additional features alongside price data.