Implementing Your Algorithmic Trading Strategies
Master the process of testing, refining, and deploying profitable automated stock trading strategies with Investfly's algorithmic trading platform.
If you haven't already, we recommend reading Algorithmic Trading Concepts first to understand the fundamental principles behind successful automated trading strategies.
Once your algorithmic trading strategy is defined, you'll use the strategy details page to refine its parameters, run comprehensive backtests, and deploy it to a live or virtual trading account. This guide walks you through these essential steps to algorithmic trading success.
Accessing Your Algorithmic Trading Strategy Dashboard
To begin managing your automated trading strategy, you first need to access its detailed dashboard:
- Navigate to the algorithmic trading strategy list in your Investfly dashboard
- Click on the automated trading strategy name you wish to manage
Optimizing Your Algorithmic Trading Strategy
You can refine any aspect of your automated trading strategy, including entry signals, exit conditions, and risk parameters. Follow these steps to optimize your trading algorithm:
- Access the algorithmic trading strategy dashboard as described above
- Click on the pencil icon in the section of your automated trading strategy you want to modify
- A dialog (the same interface you used to define the strategy) will appear
- Make your desired modifications to improve your trading algorithm's performance
- Click "Save" on the dialog to close it
- Note: The algorithmic trading strategy is not yet saved on the server at this point. This allows you to modify multiple sections before finalizing your changes
- Click the "Save" button at the top of the page to apply all changes to your automated trading strategy
Backtesting Your Algorithmic Trading Strategy
Investfly's algorithmic trading platform allows you to thoroughly backtest your automated trading strategy using comprehensive historical data. During the backtesting process, our system methodically steps through historical market data, evaluates your entry and exit signals, and simulates trades to measure performance metrics such as profit/loss, win rate, drawdown, and Sharpe ratio.
Note: Algorithmic trading strategy backtesting is currently supported for stock trading algorithms only, not for options trading strategies due to data limitations.
Duration of Backtest
The time frame for backtesting depends on the bar size parameters used in your strategy:
- DAILY bars: The backtest will run with the last 5 years of data (approximately 1,260 trading days)
- MINUTE bars: The backtest will run with the last 5 days of minute-bars (approximately 1,950 data points)
In both cases, the backtest should complete in less than 5 minutes.
Reliability of Backtest Results
Backtest results provide insights into your strategy's potential performance, but should not be interpreted as a guarantee of future success. This is due to several factors:
- Historical performance does not guarantee future results
- There is a difference in data granularity between live trading (real-time quotes) and backtesting (1-minute bars)
- The non-deterministic nature of strategy execution as described in Automation Concepts. If 100 stocks match your open conditions but you can only buy 10, which stocks are selected is non-deterministic due to parallel processing
Repeating the same backtest on the same strategy could yield different results. This is actually beneficial because if multiple executions produce favorable results, it's a strong indication that your strategy is robust.
Starting and Stopping a Backtest
- Access the strategy detail page
- Click the "Start" button in the backtest section
- The backtest will go through the following states:
- QUEUED: The backtest is waiting to be executed by one of our backtest servers
- INITIALIZING: The environment is being prepared for the backtest
- RUNNING: The backtest is actively running
- You can stop the backtest at any time by clicking the "STOP" button
Backtest Results
The results section displays standard metrics to evaluate your strategy's performance, such as:
- Maximum drawdown
- Percentage of profitable trades
- Overall profit/loss
- Risk-adjusted return metrics
It also provides a detailed table of all trades that were simulated during the backtest run.
Deploying Your Strategy
The final step is to deploy your automated trading strategy to a trading account so it can begin making trades based on your defined criteria.
Recommendation: We strongly suggest deploying to a virtual account first to monitor your strategy's performance in real market conditions without financial risk. After validating its performance, you can consider deploying to a real broker account.
- Click the "Deploy" button on the strategy detail page
- Select the trading account to which you want to deploy your strategy
- Click "Confirm Deploy"
Once deployed, your strategy will start evaluating your entry and exit criteria in real-time and generating trade signals. You can gain deeper insights into how your strategy is performing by monitoring automation logs as described in the Portfolio Dashboard guide.
Advanced Tips for Strategy Management
- Regularly monitor your strategy's performance and make adjustments as market conditions change
- Consider running multiple versions of a strategy with slight variations to identify the most effective approach
- Review the automation logs in the Portfolio Dashboard to understand why specific trades were triggered or not
- If your strategy isn't performing as expected, check for common issues like overly restrictive conditions or timing issues