Compositedge E-learning: Key testing parameters before implementing automated trading strategies

The retail automated trading space is growing at a tremendous pace in India after market regulator SEBI permitted retail investors to have a go in April 2008. Since then, demand for automating strategies has been rising immensely and brokers are quickly ramping up their trading terminals to include automated trading as part of a broad package to retain customers who are constantly looking for a viable trading option that can combine both conventional and fully automated trading from a single platform. According to market estimates, automated trading in India accounts for about 40-50 percent of the total trading volumes on NSE & BSE. Although lower than some of the other developed markets where experts peg algo trading volumes to be in the 70-75 percent of range, the pace at which retail investors are flocking to learn and execute automated strategies in India is very encouraging given the fact that the go ahead by the market regulator was given only a little more than a decade back. The key to growth in the number of retail clients switching to automated trading in India is not only due to the numerous advantages in lieu of conventional trading practices, but also because of the speedy advances in technology that led to the upgradation of the basic trading infrastructure in the country, resulting in robust order management and swift execution of trades.

Individuals excited about programming manual traditional strategies should first begin by analysing the pros and cons of using fully automated trading systems. While the major advantage of automated trading is to do away with human intervention which most often leads to trading bias, automating trades can result in low latency and robust trade management, depending on the trading script and the features of the platform. On the flip side, the drawbacks related to hardware failure, flawed systems and glitches in the software can sometimes outweigh the risks of conventional trading.

If you’re just getting started with programming your strategies or not sure how to get started, here are some of the steps involved in building and testing your trading system before employing them in REAL-TIME markets. To begin with, you need to create a

Trading Script-
This is nothing but a program that includes all the functions based on which you wish to execute your strategy. In simpler words, it involves creating source codes for your strategy so that your system can read and execute orders when some or all of the defined parameters are met. Generally, trading platforms support limited programming languages and brokers sometimes offer API’s for the programs they don’t support. Some of the common programming languages used to create scrips for automated trading are C#, C++, Java, AFL, VB etc.

We have the state of the art automated trading platform that supports C# and excel macros and has an inbuilt dictionary to assist traders build their source codes in C# effortlessly. In addition, the platform comes with a SOURCE CODE EDITOR which helps you verify if all the codes are entered correctly and prompts you if there are errors in your program. The editor also comprises of a HELP function to assist users quickly search, filter, replace, debug and insert comments in the SCRIPT.

Source: Compositedge- Protrader platform


Strategy Backtesting-
Once the SCRIPT or the SOURCE CODES are error free, you are ready for the next step which is to backtest your strategy using historical or in-sample data. The idea behind backtesting is to gauge the efficiency of the strategy and determine its profitability. The other reason to backtest your strategy is to look for possible inaccuracies in your coding which can cause a variation in your backtest results from the actual outcome during manual trading. Thirdly, you can use the output of your backtested strategy to visualise max drawdowns, win-loss ratio, average profit/loss size, annualized and risk-adjusted returns, Sharpe Ratio and so on.
When you’re backtesting a strategy, make sure to include costs associated with your trading such as commissions, taxes etc. so that the P/L is closer to what you might expect when you implement the strategy in real-time markets.
Although backtesting is an important feature of testing a trading system to understand the performance of your strategy in the past, it is no way an indication of how your strategy will perform in the future.

Our automated platform gives you two types of Backtesting Options; “Quick Backtesting” and the “Visual Backtesting” with the option to test multiple securities at the same time. In addition, you can view charts, trade history and a specially designed performance panel comprising of P/L charts, trade population, drawdowns and a whole lot of other useful information related to your trading system.

Source: Compositedge- Protrader platform


Optimizing Strategy-
If you’re not happy with the desired outcome of your trading system after backtesting your strategy, the next process is to optimize the strategy by fine tuning the input parameters and backtesting them. This is achieved by entering a range of values for a specified input or a group of variables like a moving average, MACD, RSI etc. and allowing the program to select the right input variable/s that will generate the best results.
The goal of optimization is not only to find the right input values that can lead to higher profits, but to define functions where a successful backtested strategy performs well in the future too. There are numerous instances when a tweaked strategy produces excellent results during backtest but fails miserably when implemented in a real-time environment.
Therefore, when optimizing your strategy, ensure that you do not use it as a curve fitting tool to spike up the profits of in sample data, but rather employ it to make your trading system more robust by testing multiple securities, time frames and market conditions either individually or collectively before deciding on the most potential trading system.

Source: Compositedge- Protrader platform


Forward testing-
To verify the performance of your backtested results, it is important to check how the system will deliver in the future. This is achieved by forward testing the strategy using out of sample or reserved historical data specifically set aside for this purpose. Generally, if you have 3-years historical data, it is ideal to use 2-years data to backtest and one-year data to forward test.
If there is a high degree of correlation in the performance and other key results between the back and forward tested data, then there’s a good probability that your trading system is robust and will perform well in LIVE markets too.
As a final step, carry out forward performance testing or paper trading to evaluate all the key functional parameters before you hit the markets.

Source: Compositedge- Protrader platform


Our Internationally acclaimed Protrader terminal is an excellent trading platform for newbies an experienced Algo traders. It allows you to setup optimization parameters like variables, targets and optimization limits which are the some key elements used to optimize strategies. Users can view the optimization results in a table format before selecting the best strategy to employ in real-time markets.
Algo traders can also view the optimization graph and export/import the output of your strategy to/from your hard drive. The walk forward mode splits the entire range of historical data into IN and OUT OF SAMPLE periods and tables the performance of the walk forward analysis.

We are currently providing FREE paper trading for a limited period and our algo trading platform with more than 3000 historical data points is available FREE OF COST. Our brokerage charges for automated trading is completely merged with our regular package of ₹15 per transaction.
Sign-up with Compositedge NOW



Compositedge, incorporated in 1995, is a leading discount broker and provider of algo trading solutions for retail customers in India. Headquartered in Bangalore, we provide the internationally acclaimed Protrader platform which comprises of charts, scalper, matrix, grid, time & sales, market-depth and options master in addition to the state of the art algo trading platform. We combine discount broking and algo trading solutions to ensure all our retail clients experience the finest trading amenities at affordable costs.