• Services
    LLM
    AI & ML
    Digital Healthcare
    Data Science
    DevOps
  • Products
    Jackalope
    EyeAI
  • Industries
    Healthcare
    Agriculture
    EdTech / LMS
    Retail / E-commerce
    Manufacturing
  • Resources
    Blog
    Case Studies
    Expert Guides
  • Company
    About us
    Careers
  • Contact us
logo
Services
LLMAI & MLDigital HealthcareData ScienceDevOps
Industries
HealthcareAgricultureEdTech / LMSRetail / E-commerceManufacturing
Case StudiesAbout UsBlogCareers
Our contacts
+380(66)54-32-579
sales@sciforce.tech

Get monthly digest of innovations

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.
Social Media:
Privacy Policy © 2026 Sciforce
5.0
Building a trade prediction model for a trader bot cover

Building a trade prediction model for a trader bot

Published: November 10, 2023
# Retail / E-commerce
# AI / ML
# Data Science
Nowadays we see the importance of new digital tech in changing how the world trades. These modern tools are giving traders a big leg up, helping them deal with and succeed in a world that's getting more complicated to do business in. Our client requested us to create an actionable AI-backed tool that would analyze traders’ behavior on the market with high operational efficiency and prediction accuracy. Read on to discover more about the project.

Challenge

Finding an AI solution to identify trader behavioral patterns

AI in Retail Operations

Find out more with SciForce free playbook

The client wanted us to create an actionable AI-backed tool that would analyze traders’ behavior on the market with high operational efficiency and prediction accuracy. From the functional perspective, the tool was expected to perform the following tasks: · Differentiation between several types of traders, including hedgers, arbitrageurs and speculators; · Recognition and processing of trader patterns, based on historical data analysis, i.e. previous trading activities; · Building profiles for each trading pattern to accurately predict the trader’s next moves on the market; · Simulation of traders’ behavior to provide insights on alternative steps a trader can take in ever-changing environments, such as in the case of market fluctuations; · Pinpointing the exact price at which a trader opens and closes the trade (Entry Type: IN/OUT) or increases the trade size.

Solution

We developed a solid ML-driven trainable model to track bot trader actions for this project. We have chosen two families of ML models to use for the prediction task:

  • LSTM-based neural network, that belongs to the family of recurrent neural networks and
  • XGBoost ensemble of trees with the gradient boosting algorithm over it. Both models are trained to predict if a trader proceeds with a specific transaction in the next time interval based on their history of transactions. In this way, the models were expected could solve the classification problem for three modes: Idle (no transaction), Buy, and Sell. We noticed that the hardest part was to differentiate Idle from Buy/Sell. In other words, if the model correctly detected an upcoming transaction, it could easily predict a transaction type (see the confusion matrix below).

Bot_1_e3e443430a.png

Confusion matrix for predictions of Quiet Moon strategy transactions.

Both XGB and LSTM models provide three types of outputs:

  • Action prediction for the next time interval: idle, buy, or sell (i.e. time model).
  • Confidence score for a prediction, e.g. 80% confident that the transaction would be Buy, 19% that it would be Idle, 1% that it would be Sell.
  • Likelihood of the transaction for the next time interval, given a certain change in price According to the experiments that we run on several traders, the difference between these model families is not significant. Features, context length, and aggregation window provide a far more dramatic impact on a model than its type.

Development Journey

Our team created a consistent and reliable AI tool for trade analysis and prediction

The project’s takeaways reveal the competitive advantages of using two ML-driven models for building bot traders:

  • The LSTM-based family is more flexible for further extensions and works more naturally by treating input data as a sequence;
  • The XGBoost model has a higher data processing rate. Most of our experiments utilized the XGBoost model to save the computational time and implemented raw ticks support only for it. The predictive analytics article puts both in broader context — XGBoost and LSTM sit at opposite ends of the speed-flexibility spectrum across every forecasting domain, not just trading.

Impact

As inputs for both models, we used historical data. In other words, we backtracked changes in prices and a trader’s actions to predict what the trader would do next. There are four important co-requisite touchpoints or parameters we consider: · Time limits for historical data under analysis · Essential features to be taken for initial profiling · Relevant data aggregation. · Raw ticks data to better realize the current market situation

Context length can drastically impact the accuracy level for trader actions prediction. To be objective, it should be backed by comparison of typical time intervals between a trader’s transactions. Having a smaller context often results in accuracy drops. A broader context, on the other hand, is a waste of computational resources and makes learning harder for a model. As such, traders that we sampled in initial exploratory data analysis had frequencies of around 1-2 hours, which accounts for 100 min for models training a standard context length. Time-window optimization shaped the ticket sales prediction case in a similar way — social sentiment, venue history, and sales patterns had to be aggregated across the right time horizons before the model could reliably forecast event performance.

Open price with context and prediction time intervals visualized

Features that we employed at the training stage were based on the earlier-stage analysis. We collected data on the price, profits and position, volume for the aggregated interval, technical indicators, and the likelihood of price patterns. In principle, simple training on the price data can yield strong enough models, but pairing it with extra data like indicators and profits often adds a few percent to the accuracy. To extract the most relevant features for each trader, we developed a feature selection process based on the correlation with changes in the trader’s position. In this way, we can decrease the amount of features we use, speed up the algorithm, and reduce the memory required for it.

Aggregation helps cut down an input size by the time axis. ML-driven models often have a hard time extracting the sparse meaningful signal from the noise that will be inevitably produced by large-scale data. The best way to address this issue is to introduce aggregation of tick data by time intervals. We experimented with 1-hour, 30, 15, 5, and 1-min aggregation periods. Similarly to context length, the optimal aggregation period correlates with the trading frequency.

Raw ticks also appeared to be useful for a share of traders. The first model used aggregated data, while the second model employed a mix of aggregated data to get a larger context and raw ticks data to capture the current situation. In some cases, raw ticks accounted for up to 2-5% of improvement. However, in other cases, they didn’t affect or even decrease the resulting accuracy. It seems that raw ticks are more important for traders who have frequent transactions, while for traders who have 1 transaction per hour on average, all necessary information can be available in open prices for time intervals.

We as developers can take away the following key findings from the project:

  • A robust price model can be created by multiple applying the model to the data with the same historical context, yet a different current price.
  • The price model is trained to track small price changes, with huge price gaps being treated as false or irrelevant.
  • We treat the current price seesaw as merely one of the factors that affect a trader’s actions and that can overlap with the previous price fluctuations.
  • The rationale behind the choice of Sell, Buy, and Idle trade modes shows that the order of importance of the abovementioned factors varies greatly from pattern to pattern, albeit some similarities also take place.

As a result, the customer enjoyed an actionable AI-fueled solution that can perform complex large-scale data processing tasks and come up with high-accuracy trade forecasts.

RELATED CASE STUDIES

View all Case Studies
Optimizing Multi-Zone Restaurant Service with Computer Vision for HospitalityOptimizing Multi-Zone Restaurant Service with Computer Vision for Hospitality

The client is a mid-sized restaurant chain with about 1200 locations in over 30 countries. Each restaurant provides full-service dining, where waiters take orders, serve food and manage table turnover. Most locations have two dining areas, which can make it hard for staff to keep track of all tables. The client wanted to improve AI for restaurant management by reducing wait times, speeding up table cleaning, and helping staff respond more quickly. Their goal was to use real-time table monitoring and smart video analytics to support better decision-making and improve the overall customer experience, showing how to track table status and wait times using AI in restaurants.

# Retail / E-commerce
# AI / ML
# Big Data
# Computer Vision
# Data Science
# DevOps
Optimizing Warehouse Operations with AI-Powered Tracking and AnalyticsOptimizing Warehouse Operations with AI-Powered Tracking and Analytics

A major cosmetics and beauty retailer runs a high-volume warehouse that processes thousands of online and in-store orders daily. Customers place orders through the website or mobile app, triggering an automated fulfillment process. Warehouse staff pick items from inventory, scan barcodes to verify them, and pack them into labeled boxes. These boxes are then sorted at the delivery zones and assigned to couriers for scheduled deliveries. The warehouse uses barcode scanning, inventory management systems and automated package tracking system to monitor order accuracy, worker efficiency, and box movement. Since orders must be processed within strict time limits, the warehouse continuously optimizes the storage layout, packing stations planning, and workflows to improve efficacy and reduce errors.

# Retail / E-commerce
# AI / ML
# Computer Vision
All-Seeing EyeAI: a new era of space optimization and queue managementAll-Seeing EyeAI: a new era of space optimization and queue management

EyeAI 👁️ is a SciForce product, transforming your existing cameras into a smart system for optimizing space and managing queues. Get real-time insights into visitor behavior for better space use and personalized service in retail, healthcare, HoReCa, and public safety—no new hardware needed.

# Retail / E-commerce
# Computer Vision