NexusFi: Find Your Edge


Home Menu

 





Backtesting and Research: MultiCharts or AmiBroker


Discussion in Platforms and Indicators

Updated
      Top Posters
    1. looks_one TonyB with 16 posts (1 thanks)
    2. looks_two ArshT with 16 posts (6 thanks)
    3. looks_3 NW27 with 14 posts (11 thanks)
    4. looks_4 Big Mike with 7 posts (2 thanks)
      Best Posters
    1. looks_one amibroker with 6.3 thanks per post
    2. looks_two lurker with 2 thanks per post
    3. looks_3 NW27 with 0.8 thanks per post
    4. looks_4 ArshT with 0.4 thanks per post
    1. trending_up 52,378 views
    2. thumb_up 54 thanks given
    3. group 17 followers
    1. forum 74 posts
    2. attach_file 4 attachments




Closed Thread
 
Search this Thread

Backtesting and Research: MultiCharts or AmiBroker

  #31 (permalink)
 
TonyB's Avatar
 TonyB 
Bay Area, CA - US
 
Experience: Beginner
Platform: TOS, TS & MC
Broker: TDA & TS
Trading: Stock, Options and now Futures (ES)
Posts: 516 since Dec 2010
Thanks Given: 227
Thanks Received: 140

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?


Can you help answer these questions
from other members on NexusFi?
Better Renko Gaps
The Elite Circle
ZombieSqueeze
Platforms and Indicators
My NT8 Volume Profile Split by Asian/Euro/Open
NinjaTrader
Are there any eval firms that allow you to sink to your …
Traders Hideout
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
 
  #32 (permalink)
 NW27 
Newcastle, Australia
 
Experience: Intermediate
Platform: Multicharts 8 - Full Version
Broker: IB
Trading: SPI,FTSE100, 6E, 6A
Posts: 285 since Oct 2010
Thanks Given: 108
Thanks Received: 188

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

  #33 (permalink)
 NW27 
Newcastle, Australia
 
Experience: Intermediate
Platform: Multicharts 8 - Full Version
Broker: IB
Trading: SPI,FTSE100, 6E, 6A
Posts: 285 since Oct 2010
Thanks Given: 108
Thanks Received: 188



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.

  #34 (permalink)
 ArshT 
London England
 
Posts: 16 since Feb 2012


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


  #35 (permalink)
 ArshT 
London England
 
Posts: 16 since Feb 2012


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

  #36 (permalink)
 NW27 
Newcastle, Australia
 
Experience: Intermediate
Platform: Multicharts 8 - Full Version
Broker: IB
Trading: SPI,FTSE100, 6E, 6A
Posts: 285 since Oct 2010
Thanks Given: 108
Thanks Received: 188


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.

  #37 (permalink)
 
TonyB's Avatar
 TonyB 
Bay Area, CA - US
 
Experience: Beginner
Platform: TOS, TS & MC
Broker: TDA & TS
Trading: Stock, Options and now Futures (ES)
Posts: 516 since Dec 2010
Thanks Given: 227
Thanks Received: 140

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?

  #38 (permalink)
 NW27 
Newcastle, Australia
 
Experience: Intermediate
Platform: Multicharts 8 - Full Version
Broker: IB
Trading: SPI,FTSE100, 6E, 6A
Posts: 285 since Oct 2010
Thanks Given: 108
Thanks Received: 188


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.

Thanked by:
  #39 (permalink)
 NW27 
Newcastle, Australia
 
Experience: Intermediate
Platform: Multicharts 8 - Full Version
Broker: IB
Trading: SPI,FTSE100, 6E, 6A
Posts: 285 since Oct 2010
Thanks Given: 108
Thanks Received: 188


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


Blue Owl Press Home Page

Neil

  #40 (permalink)
 
TonyB's Avatar
 TonyB 
Bay Area, CA - US
 
Experience: Beginner
Platform: TOS, TS & MC
Broker: TDA & TS
Trading: Stock, Options and now Futures (ES)
Posts: 516 since Dec 2010
Thanks Given: 227
Thanks Received: 140



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



Last Updated on February 29, 2012


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
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.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts