An advanced deep learning-based cryptocurrency price forecasting tool that uses LSTM neural networks to predict future price movements with confidence intervals.
git clone <repository-url>
cd <repository-name>
pip install tensorflow numpy pandas matplotlib requests scikit-learn
The main functionality is provided through the ai_price_forecast
function in ai_forecast.py
:
from ai_forecast import ai_price_forecast
# Example usage
forecast_dates, prices, upper_bound, lower_bound = ai_price_forecast(
api_url="https://api.coingecko.com/api/v3",
crypto_id="bitcoin",
historical_days=180,
forecast_days=30
)
api_url
: Base URL for the cryptocurrency APIcrypto_id
: Identifier for the cryptocurrency (e.g., "bitcoin")historical_days
: Number of historical days to use for training (default: 180)forecast_days
: Number of days to forecast into the future (default: 30)seq_length
: Sequence length for LSTM input (default: 90)epochs
: Number of training epochs (default: 500)batch_size
: Batch size for training (default: 32)patience
: Early stopping patience (default: 30)model_path
: Path to save/load the model (optional)save_path
: Path to save the best model during training (optional)Currently you are only prompted for forecast length
The model uses several technical indicators for improved forecasting:
The function returns four lists:
Plots are automatically saved in the forecast_plots
directory.
The system includes comprehensive error handling for:
All errors are logged with detailed messages for debugging.
[Your chosen license]
Contributions are welcome! Please feel free to submit a Pull Request.