Big Mike's Trading Forum
 

Go Back   Big Mike's Trading Forum

> Trading Forums > Platforms and Indicators > AmiBroker


Notices
     

Backtesting and Research: MultiCharts or AmiBroker
Started:September 13th, 2010 (10:58 AM) by dnof Views / Replies:17,301 / 74
Last Reply:February 29th, 2012 (02:21 PM) Attachments:4

Welcome to Big Mike's Trading Forum.

Welcome, Guest!

This forum was established to help traders by openly sharing indicators, strategies, methods, trading journals and discussing the psychology of trading.

BMT is fundamentally different than most other trading forums:
  • We work extremely hard to keep things positive on our forums.
  • We do not tolerate rude behavior, trolling, or vendor advertising in posts.
  • We firmly believe in openness and encourage sharing. The holy grail is within you, it is not something tangible you can download.
  • We expect our members to participate and become a part of the community. Help yourself by helping others.


You'll need to register in order to view the content of the threads and start contributing to our community. It's free and simple, and we will never resell your private information.

-- Big Mike
     

Closed Thread
 4  
 
Thread Tools Search this Thread

Backtesting and Research: MultiCharts or AmiBroker

Old February 26th, 2012, 01:09 PM   #31 (permalink)
Go Bears!
Bay Area, CA - US
 
Trading Experience: Beginner
Platform: TOS, TS & MC
Broker/Data: TDA & TS
Favorite Instrument: Stock, Options and now Futures (ES)
 
TonyB's Avatar
 
Posts: 514 since Dec 2010
Thanks: 227 given, 127 received

ArshT, I am over my head at the moment in trying to grasp .NET, SDK, API, DDE; and the pros / cons of each. I just know that I need data in AB, or MC for that matter, and they help make that happen...

Speaking of which, there seems to some healthy back-and-forth here between the two (AB and MC). Appropriate, given the thread's title...

I'm in somewhat trial stages with each, so welcome the debate / discussion, so long as it's based upon facts and not mis-information. While AB has the majority of my interest at this point, simply because I've played with MCDT for several months already, I remain perplexed why AB is not more popular on this forum. I can see if AB was recently released, but it seems to have been out for a decade or more. If indeed it is a more robust, faster solution, and less expensive too, I don't see threads about people abandoning NT and other platforms for AB. I see those about leaving for MC though.

I'm just being frank, shooting from the hip. Let me take some guesses... Maybe because AB is, or was not geared toward futures (the majority on this forum seem to be into futures)? Maybe because AFL is not easy to learn, or as easy as compared to EL? Heck, I don't know. I've also read that AFL is not all the difficult to learn, and once it is grasped, less code is needed to accomplish a task. It seems undeniable that AB has a great product though, especially for the price.

BigMike (if you are reading), is there a reason you have not invested time into AB?


Last edited by TonyB; February 26th, 2012 at 01:17 PM.
     

Old February 26th, 2012, 03:43 PM   #32 (permalink)
Elite Member
Newcastle, Australia
 
Trading Experience: Intermediate
Platform: Multicharts 8 - Full Version
Broker/Data: IB
Favorite Instrument: SPI,FTSE100, 6E, 6A
 
Posts: 276 since Oct 2010
Thanks: 104 given, 164 received

Well things must have changed since I used AB. In the afl code, i code do a buy @ the high of the previous bar and not know whether i was in a trade or not. I had to manually check and keep a record so that i could then create manual stoploss, trailing and time based stops.
If in afl code there is now an equivalent to mc marketposition flag, then I stand corrected.

Arsht
Does AB now do intrabar analysis during testing ie on a 5min bar can it look down to 1min resolution inside the bar or down to tick data inside the bar? This can make a huge difference to the validity of the system under test. A major flaw with NT.

Neil

Sent from my GT-I9100T using Tapatalk


Last edited by NW27; February 26th, 2012 at 03:50 PM.
     

Old February 26th, 2012, 05:11 PM   #33 (permalink)
Elite Member
Newcastle, Australia
 
Trading Experience: Intermediate
Platform: Multicharts 8 - Full Version
Broker/Data: IB
Favorite Instrument: SPI,FTSE100, 6E, 6A
 
Posts: 276 since Oct 2010
Thanks: 104 given, 164 received



ArshT View Post
You are totally wrong. The frustration about stating misinformation as facts is understandable.

ArshT,
I politely ask, perhaps you can show me sample AFL code I need to put into a System that will allow me to detect when I'm in a trade.
I just updated my Amibroker to the latest version and still cannot find a reference.

Using Multicharts as an Example :
 
Code
If MarketPosition = 0 AND BuySetup then   // No current position but we do have a Buy Setup
    Buy ("LE") 3 contracts next bar at (high + PointSize) stop;  // This may or may not get filled on the next bar
    
// Long Initial Stops    
If MarketPosition > 0 AND barssinceentry = 0 then
    InitialStop = Low[1] ;
If MarketPosition > 0 AND barssinceentry > 0 then 
    Sell ("L_IS") next bar at InitialStop stop;

If MarketPosition = 3 AND Close > EntryPrice+5 then
    Sell ("PT1_IS") 1 contracts this bar at Market;

If MarketPosition >= 2 AND Close > EntryPrice+10 then
    Sell ("PT2_IS") 2 contracts this bar at Market;
MarketPosition is an internal variable that displays the number of contracts/shares that we are long or short.
It is maintained by MC.
Using the above example, if after 5 ticks profit, I decide to Sell 1 contract, MarketPosition would now = 2.
Again MC automatically maintains how many contracts I have remaining in my position.

ArshT, I bow to your knowledge.
What is the AFL System code for AB to do this style of thing ???

Neil.


Last edited by NW27; February 26th, 2012 at 06:49 PM.
     

Old February 26th, 2012, 05:16 PM   #34 (permalink)
Membership Revoked
London England
 
Trading Experience: Advanced
Platform: Amibroker
Favorite Instrument: Forex, Futures
 
Posts: 16 since Feb 2012
Thanks: 4 given, 6 received


TonyB View Post
ArshT, I am over my head at the moment in trying to grasp .NET, SDK, API, DDE; and the pros / cons of each. I just know that I need data in AB, or MC for that matter, and they help make that happen...

Speaking of which, there seems to some healthy back-and-forth here between the two (AB and MC). Appropriate, given the thread's title...

I'm in somewhat trial stages with each, so welcome the debate / discussion, so long as it's based upon facts and not mis-information. While AB has the majority of my interest at this point, simply because I've played with MCDT for several months already, I remain perplexed why AB is not more popular on this forum. I can see if AB was recently released, but it seems to have been out for a decade or more. If indeed it is a more robust, faster solution, and less expensive too, I don't see threads about people abandoning NT and other platforms for AB. I see those about leaving for MC though.

I'm just being frank, shooting from the hip. Let me take some guesses... Maybe because AB is, or was not geared toward futures (the majority on this forum seem to be into futures)? Maybe because AFL is not easy to learn, or as easy as compared to EL? Heck, I don't know. I've also read that AFL is not all the difficult to learn, and once it is grasped, less code is needed to accomplish a task. It seems undeniable that AB has a great product though, especially for the price.

BigMike (if you are reading), is there a reason you have not invested time into AB?

You can ask the same question in regards to compare McDonalds and French haute cuisine. Why do more people go to McDonalds? Or why do more people watch American Idol? To be honest I wasn't aware of this board before. And so on. You get the joke.

Why do more people use NT or MT4? Well, MT4 is fully for free. NT is for free if you don't trade through it. So this could be one of many reasons. To be honest I don't care. To each their own. There are many users using AB too. And I have seen many coming from NT, MT and MC. All I can say is that it's the most flexible software I have been using so far and I like its handling the most. The language is quite easy (IMO) and if you don't like AFL you can use C/C++/C#... to write plugins. Also can use jscript and vbscript within AFL code. Amibroker has been concepted for Stocks, Futures Forex, and so on. You can use it for auto trading or for discretionary trading (one flaw is that only Interactive Brokers and introducing brokers of IAB are provided for trading after standard installation. Using other brokers for trading you need to write your own environments or need others to create them for you). Data feed plugins available after standard installation are Esignal, IQ feed, CQG, MyTrack, Yahoo/Google/MSN, Quotetracker's feeds (development of Quotetracker has ended though, also it's not supported by Ameritrade anymore), DDE, Metastock, Excel. There are some other plugins like MT4 plugin ( recently I've also seen a solution to send trades from AB to MT4), R-plugin and so on. As mentioned ADK provides own connections to any source.

Since the topic of this thread is backtesting here is a comparison of a former new AB user


Quoting 
Hello All,

I have just completed a few days of testing several modeling/backtesting programs. I thought, perhaps, the other members of the list might find the results useful; as I am new here, hopefully this can serve as my first productive contribution.

I do a lot of testing & modeling on (a) daily bars (looking to execute intraday trades) and (b) tick data (for short-term trades). In the case of the first, I need to create signals on a daily series but execute orders against a 1M intraday series. So, in order to test an idea over five years of data, I have to do it over 5Y of 1M data. This gets into performance issues when you start wanting to run a test on several issues and want to run multiple revisions of the test. As for testing on tick data, I am sure you are familiar (at least conceptually) with the performance issues there.

I took a look at NinjaTrader, TradeStation, OpenQuant & AmiBroker. I created an ASCII file of 5Y of EURUSD, USDJPY, GBPUSD, AUDUSD & USDCAD 1M data. In each program, I ran a simple EMA crossover test (10/50). It was an obnoxious test, resulting in +300,000 trades, but it was easy to implement and was a good stress test. What I wanted to do was see if I could get: a) reliable (e.g. reproducible) results from a single-security test and b) a test of the five FX pairs as a portfolio (again, in a reliable/reproducible manner).

1. Ninja: I use Ninja daily to scalp with and execute some short-term system code. I had dim hopes for the backtesting since I am familiar with the program - Ninja really is an execution platform first and an analytical platform second. The results were more or less what I expected: I could get it to test one issue with reproducible results at an okay speed (about 3:00M) but it would start to go into fits when I ran it against all five at once. The results of the five issue test would vary from instance to instance - it would usually show the results for the first 3 issues correctly, but on the last 2 it would suffer some kind of memory issue and give me numbers that were totally off. In one pass, it even managed to corrupt itself and I had to reload all the data.

2. TradeStation: I have a lot of time invested in TradeStation and I was already familar with it's problems - mainly, that over a large test set, TS will return different test results. I have talked with TS support and posted on the message board about this, but I never got anyone interested in what I found to be a critical issue. The results of this test were as expected: I could not get two results to match. Any time I would refresh data from the TS data servers and run the test again, I would get a different result. Sometimes it was as much as test 1 being -$190K and test 2 being +$74K. I do not understand how anyone can use this tool for successful modeling if they are testing over a large dataset; just making up a number would have been as useful. I even exported and imported the data to ensure that it wasn't an issue with the TS data servers. Same inconsistency. I couldn't test all five pairs together since TS does not do portfolio backtesting. As for time of a single test, it is hard to tell with TS as to what, exactly, it is waiting for/trying to do at any given moment, but I would say it would usually take about 2/4M per test (although, I have no idea what it was doing in that 2/4M since the results it returned seemed random at times).

3. OpenQuant: This platform looked interesting. I set it up, imported the data and ran a test. After 20M I noticed that the first EURUSD 1M test was at 10%. I closed it down and uninstalled it. The performance was just not going to work for me.

4. AmiBroker: You can likely guess the results as I am here as a new member. AB was able to test EURUSD in about 30 seconds and was able to do the portfolio of all 5 pairs in about 2M. No matter how many times I ran the test, the numbers it would return were the same. This fact is pretty crucial to my work. I understand that data will have errors in it, but I at least need my modeling software to consistently return results (which AB did). I even created new databases and populated them with the same data - all test results returned were the same.

As you all know, AB was, by far, the cheapest option out of all of the above.

I hope some members find these results useful/interesting and I think that these results really are a credit to Tomasz.

I would be interested to hear from anyone who has tested AB against any other off-the-shelf tools that I did not look at.

- Tim



Last edited by ArshT; February 26th, 2012 at 05:36 PM.
     

Old February 26th, 2012, 05:21 PM   #35 (permalink)
Membership Revoked
London England
 
Trading Experience: Advanced
Platform: Amibroker
Favorite Instrument: Forex, Futures
 
Posts: 16 since Feb 2012
Thanks: 4 given, 6 received


NW27 View Post
Well things must have changed since I used AB. In the afl code, i code do a buy @ the high of the previous bar and not know whether i was in a trade or not. I had to manually check and keep a record so that i could then create manual stoploss, trailing and time based stops.
If in afl code there is now an equivalent to mc marketposition flag, then I stand corrected.

Arsht
Does AB now do intrabar analysis during testing ie on a 5min bar can it look down to 1min resolution inside the bar or down to tick data inside the bar? This can make a huge difference to the validity of the system under test. A major flaw with NT.

Neil

Sent from my GT-I9100T using Tapatalk

It hasn't changed because custom backtester interface has been there for years. I think Tomasz has given the answer already. Regarding code example... I'll see what I can do. Today I'm too tired for more


Last edited by ArshT; February 26th, 2012 at 05:39 PM.
     

Old February 26th, 2012, 06:23 PM   #36 (permalink)
Elite Member
Newcastle, Australia
 
Trading Experience: Intermediate
Platform: Multicharts 8 - Full Version
Broker/Data: IB
Favorite Instrument: SPI,FTSE100, 6E, 6A
 
Posts: 276 since Oct 2010
Thanks: 104 given, 164 received


ArshT View Post
It hasn't changed because custom backtester interface has been there for years. I think Tomasz has given the answer already. Regarding code example... I'll see what I can do. Today I'm too tired for more

I just want to Buy 3 contracts at the current high plus a couple of points and know when I'm in so that I can sell 1 at a profit target of 5 points and sell the remainder at a profit target of 10 points.
And have a StopLoss (This could have been a StopLoss connected to a ATR calc)

Why do I need a custom Backtester to do this?
You do your Buying and Selling in the System.

Neil.

     

Old February 26th, 2012, 06:58 PM   #37 (permalink)
Go Bears!
Bay Area, CA - US
 
Trading Experience: Beginner
Platform: TOS, TS & MC
Broker/Data: TDA & TS
Favorite Instrument: Stock, Options and now Futures (ES)
 
TonyB's Avatar
 
Posts: 514 since Dec 2010
Thanks: 227 given, 127 received

ArshT, I agree with Tim that repeatability is very important. I lose all faith if I cannot reproduce the results... The broker relationships / options are indeed a short-coming for me; and if anything prevents me from moving forward with AB, that would seem to be it... I really hope that won't be the case.

If you had to recommend one good source to learn AFL, what would it be?

     

Old February 26th, 2012, 07:31 PM   #38 (permalink)
Elite Member
Newcastle, Australia
 
Trading Experience: Intermediate
Platform: Multicharts 8 - Full Version
Broker/Data: IB
Favorite Instrument: SPI,FTSE100, 6E, 6A
 
Posts: 276 since Oct 2010
Thanks: 104 given, 164 received


TonyB View Post
ArshT, I agree with Tim that repeatability is very important. I lose all faith if I cannot reproduce the results... The broker relationships / options are indeed a short-coming for me; and if anything prevents me from moving forward with AB, that would seem to be it... I really hope that won't be the case.

If you had to recommend one good source to learn AFL, what would it be?

Tony,
Ensure you don't confuse TS (TradeStation) with MC (Multicharts). They are two different platforms and companies.
Part of the reason I changed to MC was the ease of programming in EasyLanguage.
You can't get much simpler than
If MarketPosition >= 2 AND Close > EntryPrice+10 then Sell ("PT2") 2 contracts this bar at Market;
It's pure trader talk

I've never had an issue with MC giving wrong figures.
In the example from Arsht, the user was continually downloading data from Tradestation.
Who knows, maybe TradeStations data servers were the issue not the Charting/BackTesting area of TradeStation.

Either way, it was still commenting about TradeStation not Multicharts.

Neil.


Last edited by NW27; February 26th, 2012 at 07:41 PM.
     
The following user says Thank You to NW27 for this post:
     

Old February 26th, 2012, 08:03 PM   #39 (permalink)
Elite Member
Newcastle, Australia
 
Trading Experience: Intermediate
Platform: Multicharts 8 - Full Version
Broker/Data: IB
Favorite Instrument: SPI,FTSE100, 6E, 6A
 
Posts: 276 since Oct 2010
Thanks: 104 given, 164 received


TonyB View Post
If you had to recommend one good source to learn AFL, what would it be?


Blue Owl Press Home Page

Neil

     

Old February 26th, 2012, 09:30 PM   #40 (permalink)
Go Bears!
Bay Area, CA - US
 
Trading Experience: Beginner
Platform: TOS, TS & MC
Broker/Data: TDA & TS
Favorite Instrument: Stock, Options and now Futures (ES)
 
TonyB's Avatar
 
Posts: 514 since Dec 2010
Thanks: 227 given, 127 received



NW27 View Post
Tony,
Ensure you don't confuse TS (TradeStation) with MC (Multicharts). They are two different platforms and companies.
Part of the reason I changed to MC was the ease of programming in EasyLanguage.
You can't get much simpler than
If MarketPosition >= 2 AND Close > EntryPrice+10 then Sell ("PT2") 2 contracts this bar at Market;
It's pure trader talk

I've never had an issue with MC giving wrong figures.
In the example from Arsht, the user was continually downloading data from Tradestation.
Who knows, maybe TradeStations data servers were the issue not the Charting/BackTesting area of TradeStation.

Either way, it was still commenting about TradeStation not Multicharts.

Neil.

Neil - Thank you. I appreciate the clarification. Yes, I'm well aware of TS and MC being different alright. I had just scrutinized TS as a broker, and won't be going that route. I've been using MCDT for almost a year now (with OEC data)... As I understand it, MC's PL is EL, just a little different, improved I believe.

However, I think I had read somewhere here that the language is incapable of performing certain tasks that folks were trying to replicate from NT; that its emphasis on being easy was somehow a limiting factor. I wish I could remember the particulars as it has been several months... Not that I would encounter those situations, but for some that was problematic.

While EL / PL is probably easier to learn than AFL, it seems that AFL is not exactly painfully difficult though. And, if it can accomplish tasks that EL / PL cannot (if wrong, I welcome, and want to be corrected), needs less code, and is actually faster - it merits attention.



A book. That's great. Looks like it's not quite up-to-date with the most recent release, but still probably plenty helpful.

I already have familiarity with MC via MCDT and I have data for it via a current broker relationship (OEC). And while I have just a couple days with AB and no certainty yet as to how I'd get data into it without incurring additional fees, I find it very appealing.

That said, going through many pages on another forum about AFL, it's clear that it's not easy for all or commonsensical. There seems to be a learning curve involved, and if so, that would need to be factor too. It seems that there are quite a few who could not put their thoughts or strategies into action with AFL, and asked for help often. If users of MC's PL are able to get rolling sooner and need less help, or none at all, there something to be said for that...

     

Closed Thread



Tags
.net, account, accounts, ai, ameritrade, amibroker, ascii, asx, atm, auto trading, back testing, backtest, backtesting, beat, big mike, calls, ces, chart, chart trader, charting, charts, close, code, composite, connection, consistency, contracts, control, create, credit, crossovers, current position value, custom, daily, data, data feed, data source, database, day, demo, development, doc, dom, dow, emotions, enter, errors, es, execution, fb, feed, file, filled, format, functions, funds, future, genetic optimization, goals, group, hedge, high, instrument, interval, intra bar, intraday, introduction, language, last price, learn, learning, level, line, live, live trading, load, lot, manual, market, market analyzer, matlab, metastock, method, metrics, ml, mode, moves, multicharts, multiple, ninja, ninjatrader, note, nt, nt7, nyse, open, opening range, optimization, optimizer, pat, percent, perception, performance, personal, pivot, platform, platforms, plugin, positions, practice, price, profit, profit target, profitable, program, programming, puts, question, questions, range, real time, reliability, reliable, reload, research, sample, sar, save, script, scripting, scripts, searching, series, settings, signal, signals, simple, small, software, softwares, source code, speed, start, stop, stop loss, strategies, stream, strength, stress, string, supply, support, symbols, system, systems, ta, technical, terms, testing, thank you, tick, tick data, ticks, time, time series, timeframe, trader, traders, trades, tradestation, trading, trading futures, trading systems, update, values
     

Big Mike's Trading Forum > Trading Forums > Platforms and Indicators > AmiBroker > Backtesting and Research: MultiCharts or AmiBroker

Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads
Thread Thread Starter Forum Replies Last Post
VIDEO: MultiCharts vs. NinjaTrader strategy backtesting and optimization Big Mike MultiCharts 47 January 1st, 2014 09:27 PM
Backtesting identical strategy tradestation and multicharts different results crbucks MultiCharts 7 April 26th, 2012 07:30 AM
[NinjaTrader]    NinjaTrader and Amibroker excite Platforms and Indicators 3 June 10th, 2011 12:43 AM
Do we need to use the bar magnifier when backtesting/optimization in MultiCharts? benharrell MultiCharts 8 May 4th, 2011 12:17 AM
MultiCharts backtesting and spread arjfca The Elite Circle 3 September 26th, 2010 08:06 AM


All times are GMT -4. The time now is 01:19 PM.

Powered by vBulletin®
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
Copyright © 2014 by Big Mike Trading. All information is for educational use only and is not investment advice.
There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
 
no new posts

Page generated 2014-04-24 in 0.29 seconds with 20 queries on phoenix via your IP 54.82.229.76