Australian (ASX) Stock Market Forum

Forward testing

Joined
13 August 2011
Posts
15
Reactions
0
Hi guys,

I'm relatively new to ASF so forgive me if this has already been discussed (I have searched).

I've used amibroker to backtest a trading strategy and it appears to have had a good run however I was wondering, is there code in amibroker to simulate a live trading situation... Like a paper trade?

For this, amibroker would somehow need to know which stocks have been bought and are currently held. It appears to me that anytime an AFL script has been run, it is run independently and does not retain or parse variable data.

Therefore, the script would have to scan for buying opportunities, "buy" them and update the information to a 3rd party paper trading application/spreadsheet.

Second to that another script would have to scan the list of held stocks and see if each each requires the exit of the position.

I.e. For a 30 day MA crossover strategy the amibroker script would scan all stocks in the ASX crossing their 30 day MA in the last day.

If the stock is not already held, "buy" and add the code and the price bought to the spreadsheet.

Scan the list of codes held in the spreadsheet and see if any prices are below their 30 day MA. If they are then "sell" and record the sell price on the spreadsheet.

This is essentially automated paper trading.... Has it already been done in amibroker does anyone know? If not I will do it but it will take time!

Also, I'm working on a chart slideshow which I will continue to make available for free. I hop people find it useful and that good karma comes my way. Price data and other changes will be added shortly. I'm open to suggestion too.

www.tech-solutions.com.au/ASX
 
I use AB for back and forward testing, but I didn't really understand the question. Can you re-phrase it and make it more succinct?
 
My backtesting method works woo!

Now I want to run a paper trade letting amibroker buy and sell stocks using the entry and exit requirements of my strategy using real time data.

I do tend to waffle... Sorry. And I appreciate any help in advance.
 
I doubt it's possible without a lot of expertise, and even then... Remember AB would have to know the market depth in quite a lot of detail, otherwise it would be guessing whether a fill is possible.

Closest I know to real live intra-day paper trading is with Turbo Trader. However the available parameters are probably a lot more restrictive than what you've already programmed for AB. TT will probably allow scripting at some stage in the future. You can basically set and forget.
 
Thanks gringotts.

I spent a bit of time today writing a vbscript that you can include in any AFL scan which posts the date, ticker, price and buy/sell flag for every stock matching your scan criteria to an external server!

While it doesn't know market depth, at this stage volume traded is enough info for me.

This got me thinking.

Wouldn't it be cool if everyone on this forum included this script in their amibroker scans. Then every time a buy signal was triggered it would post the info to the server.

The server could then trend what everyones scans are saying to buy. Like a broad market sentiment based on technical analysis.

I'll keep plodding along.

Nick
 
Problem there would be everyone has different time frames.

If you want to know what everyone is day trading, it will always be the stocks that are gaining % on volume. There's rarely more than half a dozen of these each day. The more there are, the better the general sentiment.
 
Top