Surpriver is a groundbreaking tool designed to help investors find high moving stocks before they make significant moves. By utilizing anomaly detection and machine learning, Surpriver analyzes stock volume and price action to uncover unusual patterns that may indicate potential price movements. In this article, we will provide a user-friendly guide on how to install and run Surpriver, alongside troubleshooting tips to smoothen your experience.
Getting Started with Surpriver
Before we dive into the technical details, let’s explore what each component of Surpriver is about:
- surpriver: The main folder containing all the necessary scripts.
- dictionaries: A folder for saving data dictionaries for later use.
- figures: A folder that contains figures for visualization.
- stocks: A list of all the stocks you wish to analyze.
- data_loader.py: Module for loading data from Yahoo Finance.
- detection_engine.py: Primary module for running anomaly detection.
- feature_generator.py: Generates price and volume return features, alongside technical indicators.
Installation Prerequisites
First, you’ll need to install the following packages to ensure that Surpriver operates smoothly:
You can install all required packages by running the following command:
pip install -r requirements.txt
Running Surpriver with Docker
If you’re familiar with Docker, you can run Surpriver in a containerized environment. Follow these steps:
- Build the Docker container with:
docker build . -t surpriver - Copy the contents of docker-compose.yml.template into a new file named docker-compose.yml.
- Replace C:\pathtothisdir with your working directory.
- Run the container with:
docker-compose up -d - Execute commands by prefixing with:
docker exec -it surpriver
Getting Most Anomalous Stocks
To find the stocks that show the most unusual patterns for today, utilize the command below:
python detection_engine.py --top_n 25 --min_volume 5000 --data_granularity_minutes 60 --history_to_use 14 --is_load_from_dictionary 0 --data_dictionary_path dictionaries/data_dict.npy --is_save_dictionary 1 --is_test 0 --future_bars 0
In this command, you’re instructing the program to analyze the top 25 stocks based on anomaly scores over the last 14 bars of 60-minute candles. Moreover, the results will be saved in your specified data dictionary for future reference.
Understanding the Parameters
This command includes several parameters that you can adjust:
- top_n: Number of stocks to be displayed.
- min_volume: Minimum average volume to filter stocks.
- data_granularity_minutes: The granularity of data, such as 1, 5, 15, 30, or 60 minutes.
- history_to_use: Amount of historical data considered for anomaly detection.
- is_save_dictionary: Option to save or not save stock data for future runs.
- data_dictionary_path: The file path where your dictionary is stored.
- is_load_from_dictionary: You can choose to load the saved data or download it fresh.
- is_test: To test predictions based on historical data.
- future_bars: Number of future bars to analyze for testing purposes.
Testing on Historical Data
Curious about the tool’s efficacy? Test the predictions on historical data using:
python detection_engine.py --top_n 25 --min_volume 5000 --data_granularity_minutes 60 --history_to_use 14 --is_load_from_dictionary 0 --data_dictionary_path dictionaries/data_dict.npy --is_save_dictionary 1 --is_test 1 --future_bars 25
By doing this, you can assess how accurately the tool’s predictions hold up with actual future movements.
Troubleshooting and Support
If you encounter any challenges while using Surpriver, consider the following troubleshooting ideas:
- Ensure all required packages are correctly installed.
- Double-check file paths in your commands to avoid any ‘file not found’ errors.
- If Docker commands fail, verify that Docker is properly installed and running.
- Consult the Surpriver documentation for additional clarity on command parameters.
For more insights, updates, or to collaborate on AI development projects, stay connected with fxis.ai.
Conclusion
At fxis.ai, we believe that such advancements are crucial for the future of AI, as they enable more comprehensive and effective solutions. Our team is continually exploring new methodologies to push the envelope in artificial intelligence, ensuring that our clients benefit from the latest technological innovations.
With Surpriver, you now have a powerful tool at your disposal! Happy trading!

