Improving and Implementing Mechanical Trading System

Hello Friends,

I am looking for help with my system developed using Amibroker. The system is a positional system with 15 min timeframe and will trade futures. The initial tests are giving good results which is warranting to further fine tune it and if the results are encouraging then would go live. Need help on following points

- The system works on a list of stocks (no specific selection criteria just good liquidity) and trades will be executed as and when signal is generated. To start with I am limiting no of open positions to 10. I am looking for suggestions/ideas to filter stocks which will be chosen for trading, some of the examples are - for long the stock should be above it's 20EMA daily and 20EMA hourly, if the previous day is Inside day or NR4, NR7, NR21 which may give good move in any direction next day. So idea is trade only those stocks which has higher probability of giving good move next day and reducing whipsaws.
- Might be a silly question but how to do you send buy/sell signal to algo platform, by using amibroker scan facility or any other way and what should be the Auto Repeat interval in Anaysis window.
- How much slippage + other charges (brokerage, STT, transaction tax etc) one should consider for each trade. I have assumed Rs 300/- per trade (Rs 600/- for buy sell order). Is it correct assumption?
- Who are the vendors who provide algo platform with amibroker interface? I am aware of Symphony fintech, any other vendors with decent infrastructure...

I would also like to connect with members who are already doing algo trading to exchange ideas/knowledge and reduce our learning curve. Please post your views/suggestions here or PM me.

Appreciate your help and thank you in advance.



Well-Known Member
First and foremost what you need to understand is that you are creating a composite system and not one system. It is not necessary that all of them
be written in Amibroker. The programming/scripting languages that I've dabbled are C++, C#, AWK, JavaScript, R, Python and so on.... Each language has

One good analogy is average autombile. Average car is collection of dozens of small systems that are dovetailed into each other to work with one another. Engine revs at a constant speed. Fuel system controls the amount of vaporised fuel that can enter the combustion chambers. Transmission system handles conversion of engine rotation into tyre rotation and so on ... If any one of the sub-system breaks or malfunctions, its effect will be evident from multiple connected sub-systems.

Within your trading strategy under scrutiny,

First component you have is Selector System. Keeping focus on liquidity, you could write a AFL that adds or removes scrips from a pre-determined (or parameter driven) watch list.

Second component is your capital allocation and OPEN trade control. You will have to implement this in some other language that is capable of scraping number of concurrent trades from your broker's terminal UI.

Third is trading signal system that will work on watch-list (created by Selector system) and fire signals. Do not bother with scanner. Use exploration.

Fourth is interface that broker provides and your comfort level with the said interface.

Many brokers provide Algo interface. However I am not permitted to mention or recommend their names here directly.

Unfortunately, there are no ground rules that can be set for slippage. All I can say is that you have to extremely vigilant (understand entire system architecture so that you can fix it in real-time)

In some systems, I have seen many broker admins keeping slippage amount at 20Rs as a plus/minus amount of tolerable variance between desired entry/exit prices and actual entry/exit prices. On a humble nifty future lot, this amounts to 1500Rs (per leg) eroded from profit even before you consider brokerage, taxes and algo system rent and other recurring costs.
Dear Sir,

First of all I really appreciate your detailed reply on System Development. Initially I was really skeptical about number of issues with implementation of system. However during last few days, I was able to get answer on some of the issues when my broker gave me testing machine to test my strategy in real time simulated environment. Now I understood that how the buy/sell/short/cover signal will be generated and executed on trading machine.

I have used Amibroker only to develop whole system as I do not have detailed technical knowledge about other languages. I have plans to learn Python but it will take some time. I have kept Money Management simple, 1 lot will be traded for each script so there will not be any scale-in or scale-out. Also broker interface has the facility to discard the repeated orders if the open order already exists.

With regard to slippage, there are some options available to define the parameters like waiting period for order to get filled and after that it can be executed as market order, entry tolerance etc. I will have to tweak them and see what will be impact. Running market will still be an issue where slippage impact will be more.

I am still working on adding filters and trying different exit strategies. Some of the ideas for filters could be last two day price action or daily time frame (yet to identify effective pattern), distance of signal from yesterday's closing price and today's opening price, is the price action reversing (for buy) where today's low is less than yesterday's low etc)

For exit, I am using 2 ATR trailing stop loss on candle close but I am facing some peculiar issues like system is waiting for candle to close to trigger exit. At times, the candle close is way far from ATR stop loss which erodes majority of open profit, however there are some instances where candle breaks the ATR but closes above it and move in intended direction so net-net it should compensate each other.

Are there any better exit strategies for trend following systems?

I will send you a PM about brokers tonight.

Once again thank you for your time. :):)
Last edited:

Similar threads