Backtesting and Research: MultiCharts or AmiBroker - futures io
futures io



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 41,927 views
    2. thumb_up 54 thanks given
    3. group 17 followers
    1. forum 74 posts
    2. attach_file 4 attachments




Welcome to futures io: the largest futures trading community on the planet, with well over 125,000 members
  • Genuine reviews from real traders, not fake reviews from stealth vendors
  • Quality education from leading professional traders
  • We are a friendly, helpful, and positive community
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts
  • We are here to help, just let us know what you need
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.

-- Big Mike, Site Administrator

(If you already have an account, login at the top of the page)

Closed Thread
 
Search this Thread
 

Backtesting and Research: MultiCharts or AmiBroker

(login for full post details)
  #1 (permalink)
 dnof 
san francisco, ca
 
Experience: Intermediate
Platform: NinjaTrader
 
Posts: 45 since Nov 2009
Thanks: 42 given, 27 received

SO I am looking for a faster, more reliable backtesting platform. I currently use NinjaTrader, but find the results often dubious at best, particularly with muti-timeframe and multi-instrument.

I am actually happy with NT for live trading (like the DOM and chart trader with ATM's).

I am looking to a platform to really faciliate the quick generation of ideas and signal generation the morning before trading and then for specific intraday setups (opening range, last hour etc).

So after much research I ended up looking at both AmiBroker and MultiCharts. Before i go too deep with either of these I wanted to solicit feedback from others here on what their thoughts are????

Started this thread

Journal Challenge April 2021 results (now extended!):
Competing for $1800 in prizes from Jigsaw
looks_oneMaking a Living with the Microsby sstheo
(602 thanks from 60 posts)
looks_twoSalao's Journalby Salao
(147 thanks from 26 posts)
looks_3Learning to Profit - A journey in algorithms and optionsby Syntax
(112 thanks from 26 posts)
looks_4Deetee’s DAX Trading Journal (time based)by Deetee
(94 thanks from 30 posts)
looks_5Maybe a little bit different journalby Malykubo
(46 thanks from 29 posts)
 
Best Threads (Most Thanked)
in the last 7 days on futures io
I finally blew up an account
491 thanks
Spoo-nalysis ES e-mini futures S&P 500
63 thanks
The Crude Dude Oil Trading System
62 thanks
The tiyfTradePlanFactory indicator
21 thanks
Building a Crypto Mining Rig
18 thanks
 
(login for full post details)
  #3 (permalink)
 Big Mike 
Site Administrator
Swing Trader
Data Scientist & DevOps
Manta, Ecuador
 
Experience: Advanced
Platform: Custom solution
Trading: Futures & Crypto
 
Big Mike's Avatar
 
Posts: 50,068 since Jun 2009
Thanks: 32,534 given, 98,483 received


I have not used AmiBroker so can't speak to that.

But, I have used NinjaTrader and MultiCharts, and by far, 100%, x10, AAA+, MultiCharts is superior in every way when it comes to backtesting. There is always going to be a learning curve for a new sophisticated application, but I suggest downloading the 30-day trial and giving it a chance. I've been using it for nine months now exclusively for charting and testing, and could not be any happier.

Mike

We're here to help -- just ask

For the best trading education, watch our webinars
Searching for trading reviews? Review this list

Follow us on Twitter, YouTube, and Facebook

Support our community as an Elite Member:
https://futures.io/elite/

Visit other sites? Please spread the word about your experience with our community!
Follow me on Twitter Visit my futures io Trade Journal
The following user says Thank You to Big Mike for this post:
 
(login for full post details)
  #4 (permalink)
 dnof 
san francisco, ca
 
Experience: Intermediate
Platform: NinjaTrader
 
Posts: 45 since Nov 2009
Thanks: 42 given, 27 received


Big Mike View Post
I have not used AmiBroker so can't speak to that.

But, I have used NinjaTrader and MultiCharts, and by far, 100%, x10, AAA+, MultiCharts is superior in every way when it comes to backtesting. There is always going to be a learning curve for a new sophisticated application, but I suggest downloading the 30-day trial and giving it a chance. I've been using it for nine months now exclusively for charting and testing, and could not be any happier.

Mike

Mike,

Thanks - how is the backtesting speed?? I do lots of testing of 10 year 1 mins future data, also using daily time series and NT seems really starts to bog down with this...

Started this thread
The following user says Thank You to dnof for this post:
 
(login for full post details)
  #5 (permalink)
 Big Mike 
Site Administrator
Swing Trader
Data Scientist & DevOps
Manta, Ecuador
 
Experience: Advanced
Platform: Custom solution
Trading: Futures & Crypto
 
Big Mike's Avatar
 
Posts: 50,068 since Jun 2009
Thanks: 32,534 given, 98,483 received


dnof View Post
Mike,

Thanks - how is the backtesting speed?? I do lots of testing of 10 year 1 mins future data, also using daily time series and NT seems really starts to bog down with this...

It is a zillion times faster than NT 6.5, and same speed as NT7 on tick data, I didn't try minute data. But it is very efficient in terms of memory usage, I've never had a single problem.

Mike

We're here to help -- just ask

For the best trading education, watch our webinars
Searching for trading reviews? Review this list

Follow us on Twitter, YouTube, and Facebook

Support our community as an Elite Member:
https://futures.io/elite/

Visit other sites? Please spread the word about your experience with our community!
Follow me on Twitter Visit my futures io Trade Journal
 
(login for full post details)
  #6 (permalink)
 dnof 
san francisco, ca
 
Experience: Intermediate
Platform: NinjaTrader
 
Posts: 45 since Nov 2009
Thanks: 42 given, 27 received

So I have been reading that is not possible to use Multicharts offline (i.e. it is requires a constant connection to the internet)? Is that concern true?

I am envisioning the long weekends away trying to run some quick research on a laptop (with a pre-populated database) or something similar and not able to support that??

Started this thread
 
(login for full post details)
  #7 (permalink)
 philloo 
Canada
 
Experience: Beginner
Platform: Multichart
 
Posts: 43 since Feb 2010
Thanks: 7 given, 27 received

Hi, dnof

It's not really a problem. You will not have the real time data working. You can backtest your strategies on the weekend without having realtime data feed. Hope it's more clear.

Phil

 
(login for full post details)
  #8 (permalink)
 dnof 
san francisco, ca
 
Experience: Intermediate
Platform: NinjaTrader
 
Posts: 45 since Nov 2009
Thanks: 42 given, 27 received


philloo View Post
Hi, dnof

It's not really a problem. You will not have the real time data working. You can backtest your strategies on the weekend without having realtime data feed. Hope it's more clear.

Phil

Phil,

Thanks for the reply - I think so. I think the feedback I heard was regarding DRM activation and that it needed constant connectivity to start and remain functional??

Started this thread
The following user says Thank You to dnof for this post:
 
(login for full post details)
  #9 (permalink)
lurker
New Delhi, India
 
 
Posts: 14 since Aug 2010
Thanks: 5 given, 6 received

For most traders... who like to test new ideas almost every day... nothing can beat Amibroker.

It is the MOST easiest, simplest and fastest exploration tools as long as your ideas are not overwhelmingly sophisticated (using since past 5 years, have tried both NT and Multicharts). And (again) it is way faster than anything I've seen.

The following user says Thank You to lurker for this post:
 
(login for full post details)
  #10 (permalink)
 Big Mike 
Site Administrator
Swing Trader
Data Scientist & DevOps
Manta, Ecuador
 
Experience: Advanced
Platform: Custom solution
Trading: Futures & Crypto
 
Big Mike's Avatar
 
Posts: 50,068 since Jun 2009
Thanks: 32,534 given, 98,483 received



lurker View Post
For most traders... who like to test new ideas almost every day... nothing can beat Amibroker.

It is the MOST easiest, simplest and fastest exploration tools as long as your ideas are not overwhelmingly sophisticated (using since past 5 years, have tried both NT and Multicharts). And (again) it is way faster than anything I've seen.

I'd like to see more participation from Amibroker users here on the forum. Can you post some screen shots illustrating why it is easier, simpler and faster? I've never used it, so would like to see them and see how they do things.

Mike

We're here to help -- just ask

For the best trading education, watch our webinars
Searching for trading reviews? Review this list

Follow us on Twitter, YouTube, and Facebook

Support our community as an Elite Member:
https://futures.io/elite/

Visit other sites? Please spread the word about your experience with our community!
Follow me on Twitter Visit my futures io Trade Journal
 
(login for full post details)
  #11 (permalink)
colion
Asheville, North Carolina
 
 
Posts: 24 since Sep 2010
Thanks: 1 given, 15 received


Big Mike View Post
I'd like to see more participation from Amibroker users here on the forum. Can you post some screen shots illustrating why it is easier, simpler and faster? I've never used it, so would like to see them and see how they do things.

Mike

I've used AmiBroker for about 10 years (as I recall) and in my view AmiBroker's strength lies in backtesting and ease of programming (see full description at website) even the most complex algorithms. In that regard, it beats everything that I have worked with from Metastock to Tradestation and does so significantly faster and at a very competitive price. However, relative to other programs I rate its graphics and graphic tools average or even a bit lower and do not rely on AmiBroker for all graphic needs. Mechanical system traders, I believe, find that AmiBroker more than meets their needs. However, traders who rely more on graphics might find some "holes" that need to be plugged with other programs.

As for illustrating these points I don't know how in this format but might be able to address specific questions. The best way learn about the program is by giving it a spin with a fully functional 30 day trial, as well as look in on the users Yahoo group which is open to all and is populated by many former Metastock, Tradestation, NT, etc. users.

I should mention that even though AmiBroker is a "one man shop" support is superior to anything that I have experienced with other programs (in part due to an active Yahoo group), bugs are fixed "instantly" and new features are introduced at an amazing speed.

The following 2 users say Thank You to colion for this post:
 
(login for full post details)
  #12 (permalink)
lurker
New Delhi, India
 
 
Posts: 14 since Aug 2010
Thanks: 5 given, 6 received

You can code a MA crossover system for backtesting with just 2 lines of code:

buy= cross ( ma(c, 10), ma(c, 20));
sell= cross ( ma(c, 20), ma(c, 10));

So simple for a person with minimal experience in programming!

But what I really like is its speed. I play around with lots of backtesting and optimization and Amibroker takes half the time to backtest/explore than anything else out there. I talked to a guy who is a professional for programming for hedge funds in Matlab/R/C++ and even he was pleasantly surprised by Amibroker's speed.

This is even more important for stock traders who analyze and test a lot of tickers. Amibroker can easily handle analyzing 500 symbols in real-time; Ninjatrader's market analyzer crashes when I go just beyond 40 symbols, anyways it is painfully slow.

The following 3 users say Thank You to lurker for this post:
 
(login for full post details)
  #13 (permalink)
Bills10733
Seattle, WA
 
 
Posts: 2 since Sep 2011
Thanks: 1 given, 1 received

I'm a big fan of AmiBroker. It blows Ninja away in speed, and is a fairly mature piece of software. I find the scripting language (AFL) to be pretty easy, and I'm a non-coder so that was important to me. That being said, if you are an experienced coder you can do some amazing things.

The following 2 users say Thank You to Bills10733 for this post:
 
(login for full post details)
  #14 (permalink)
Abnash
Bangalore India
 
 
Posts: 14 since May 2011
Thanks: 2 given, 9 received

For sure.. I havent seen anything that provides the flexibility of Amibroker.

To give a simple example, I use Point and Figure charts using Bulls Eye Broker and wanted to track the trades generated through Point and Figure method. With a simple script that takes user input online, I could plot the real trades that I was doing online and mix them with custom stop loss rules and then track the profitability of the trade in Amibroker on time series charts. Now thats a good way to look at point and figure charts!

And yes, you can really do a lot of innovative fun stuff.

The following 2 users say Thank You to Abnash for this post:
 
(login for full post details)
  #15 (permalink)
 TonyB 
Bay Area, CA - US
 
Experience: Beginner
Platform: TOS, TS & MC
Broker: TDA & TS
Trading: Stock, Options and now Futures (ES)
 
TonyB's Avatar
 
Posts: 516 since Dec 2010
Thanks: 227 given, 140 received

I've been a user of MCDT for about a year, and while I've been quite pleased with it, I'm glad that I stumbled across AmiBroker; thanks to this forum.

I just started a free trial, pumping EOD Yahoo! NYSE and NASDAQ data for now, and was really impressed with the back-testing. I'm impressed with the speed, the ease of doing so, and the results, meaning that I validated the results, which takes time, but I find important. In Prodigio from TDA, validation often provided mixed results, making me realize that I could not depend upon Prodigio's back-testing results to draw conclusions. I admit that this was from a year ago, so maybe it has improved... With MCDT of course I don't have this option, but hear it does very well.

I wish there was more of a AmiBroker presence here. It seems that there is a vibrant Yahoo! Groups though that I'll need to check-out, but I prefer a forum setting, like this one...

Would anyone here know if these two are possible / doable with AmiBroker:

1. To have as a lower indicator (like where MACD or RSI would reside) a historical depiction of the daily put / call ratio for the instrument, and / or the mkt as a whole.

2. Similarly, to see a visual of the number of daily mkt new highs / lows...

If anyone has such information being displayed on AmiBroker, please do share. I'd be curious as to the data source needed to pull this off too.

Thanks much.

 
(login for full post details)
  #16 (permalink)
Abnash
Bangalore India
 
 
Posts: 14 since May 2011
Thanks: 2 given, 9 received


TonyB View Post
I've been a user of MCDT for about a year, and while I've been quite pleased with it, I'm glad that I stumbled across AmiBroker; thanks to this forum.

I just started a free trial, pumping EOD Yahoo! NYSE and NASDAQ data for now, and was really impressed with the back-testing. I'm impressed with the speed, the ease of doing so, and the results, meaning that I validated the results, which takes time, but I find important. In Prodigio from TDA, validation often provided mixed results, making me realize that I could not depend upon Prodigio's back-testing results to draw conclusions. I admit that this was from a year ago, so maybe it has improved... With MCDT of course I don't have this option, but hear it does very well.

I wish there was more of a AmiBroker presence here. It seems that there is a vibrant Yahoo! Groups though that I'll need to check-out, but I prefer a forum setting, like this one...

Would anyone here know if these two are possible / doable with AmiBroker:

1. To have as a lower indicator (like where MACD or RSI would reside) a historical depiction of the daily put / call ratio for the instrument, and / or the mkt as a whole.

2. Similarly, to see a visual of the number of daily mkt new highs / lows...

If anyone has such information being displayed on AmiBroker, please do share. I'd be curious as to the data source needed to pull this off too.

Thanks much.


If the data stream provides the put and call volumes one can easily construct such an indicator. You needto ensure that your data stream provides the open interest for the puts and calls of the specific instrument. You can then consolidate the OI's of the puts and calls and plot the PCR as you want. All available as part of the standard features of Amibroker, where you can construct a composite symbol or index based on two watchlists that contains the puts and calls symbols.

Point 2 - If you want to simply plot the new highs and lows intraday, or for the market, again thats easily possible.

If you provide some detail of the latter, I can demo that to you as a script.

The following user says Thank You to Abnash for this post:
 
(login for full post details)
  #17 (permalink)
 TonyB 
Bay Area, CA - US
 
Experience: Beginner
Platform: TOS, TS & MC
Broker: TDA & TS
Trading: Stock, Options and now Futures (ES)
 
TonyB's Avatar
 
Posts: 516 since Dec 2010
Thanks: 227 given, 140 received


Abnash View Post
If the data stream provides the put and call volumes one can easily construct such an indicator. You needto ensure that your data stream provides the open interest for the puts and calls of the specific instrument. You can then consolidate the OI's of the puts and calls and plot the PCR as you want. All available as part of the standard features of Amibroker, where you can construct a composite symbol or index based on two watchlists that contains the puts and calls symbols.

Point 2 - If you want to simply plot the new highs and lows intraday, or for the market, again thats easily possible.

If you provide some detail of the latter, I can demo that to you as a script.

Abnash, thanks for the information and offer to assist. Sounds like Yahoo! data will not get the job done with respect to my put / call indicator request. I have TDA / TOS as well as OEC equity data, so maybe I can figure something-out...

Ok, new highs / lows... First, this can be either 52 week, or all-time highs / lows. EOD is what I seek. So, after the market close, how many NASDAQ or NYSE stocks are at 52 week highs and lows. As of now, for the Naz, it's 56 and 6 respectively. For the NYSE, 86 are at new highs, 0 new lows. The number of new highs has been declining, as I understand it...

I'm sure there must be better examples, but there's a chart within here, with a neat 10 day ROC:

https://www.tradersnarrative.com/another-way-to-look-at-new-52-week-highs-3865.html

Hope that makes sense. Hey, if creating a scripts proves to be time-consuming, please, don't bother. That was not my aim, to inconvenience anyone. I just want to know if AmiBroker can do do this and the put / call chart indicator as that will influence my decision if I decide to purchase. Equally important, the data needed to pull this off... If the likes of Yahoo! or Google data can do this, that would be great!

I'm guessing that OEC equity data, or that of TDA / TOS would do the trick, but there is no existing relationship with AmiBroker...

The following user says Thank You to TonyB for this post:
 
(login for full post details)
  #18 (permalink)
 ArshT 
London England
 
 
Posts: 16 since Feb 2012


TonyB View Post
Abnash, thanks for the information and offer to assist. Sounds like Yahoo! data will not get the job done with respect to my put / call indicator request. I have TDA / TOS as well as OEC equity data, so maybe I can figure something-out...

Ok, new highs / lows... First, this can be either 52 week, or all-time highs / lows. EOD is what I seek. So, after the market close, how many NASDAQ or NYSE stocks are at 52 week highs and lows. As of now, for the Naz, it's 56 and 6 respectively. For the NYSE, 86 are at new highs, 0 new lows. The number of new highs has been declining, as I understand it...

I'm sure there must be better examples, but there's a chart within here, with a neat 10 day ROC:

h t t p : / / w w w.tradersnarrative.com/another-way-to-look-at-new-52-week-highs-3865.h t m l

Hope that makes sense. Hey, if creating a scripts proves to be time-consuming, please, don't bother. That was not my aim, to inconvenience anyone. I just want to know if AmiBroker can do do this and the put / call chart indicator as that will influence my decision if I decide to purchase. Equally important, the data needed to pull this off... If the likes of Yahoo! or Google data can do this, that would be great!

I'm guessing that OEC equity data, or that of TDA / TOS would do the trick, but there is no existing relationship with AmiBroker...

Yes it can be done. It has already been done. Such AFLs can be found in the library of Amibroker.

 
(login for full post details)
  #19 (permalink)
 TonyB 
Bay Area, CA - US
 
Experience: Beginner
Platform: TOS, TS & MC
Broker: TDA & TS
Trading: Stock, Options and now Futures (ES)
 
TonyB's Avatar
 
Posts: 516 since Dec 2010
Thanks: 227 given, 140 received


ArshT View Post
Yes it can be done. It has already been done. Such AFLs can be found in the library of Amibroker.

Thank you. Great to know. I'll have to dig through that library, if I have access to it at this stage (using trial version of AB).

Would data provided by Yahoo! or Google (free sources) be adequate? I know Yahoo! keeps track of new highs and lows, for example, but don't know if that is part of the data they provide for such purposes...

 
(login for full post details)
  #20 (permalink)
 ArshT 
London England
 
 
Posts: 16 since Feb 2012


Big Mike View Post
I have not used AmiBroker so can't speak to that.

But, I have used NinjaTrader and MultiCharts, and by far, 100%, x10, AAA+, MultiCharts is superior in every way when it comes to backtesting.

Amibroker is 90% faster than MC. I don't know whether I did anything wrong (I don't think I did) but even importing historical data is slow in MC. It took MC 2 minutes to import a simple 120MB 1 minute historical data file! It took Amibroker 14 seconds importing the very same file. Then I did a simple backtest using a very simple system and it took MC 29 seconds testing on 5 minutes timeframe and MC even got stuck and did not fulfill the whole process. I don't know why. It took AB 3.5 seconds to do the same and full job. Doing the same on 1 minute time frame it took AB 15.8 seconds while MC has crashed doing the same. So AB on 1 minute time frame was around 50% faster than MC doing it on 5 minute timeframe and stopping at 75% of the job.

So overall and taking importing of data and backtest into account it took MC 149 seconds not doing the whole job and it took AB 17.5 seconds doing the full job. (149 - 17.5)/149 = "88%" faster in this test. Also Amibroker's backtester is superior to MC's in terms of complexity, well and in terms of reliability.

Does MC provide 64-bit version now and portfolio level backtesting? No matter what AB has been providing it for years.

 
(login for full post details)
  #21 (permalink)
 ArshT 
London England
 
 
Posts: 16 since Feb 2012


TonyB View Post
Thank you. Great to know. I'll have to dig through that library, if I have access to it at this stage (using trial version of AB).

Would data provided by Yahoo! or Google (free sources) be adequate? I know Yahoo! keeps track of new highs and lows, for example, but don't know if that is part of the data they provide for such purposes...

Well, Yhoo and Goog are free sources so don't fully rely on it especially in regards to getting accurate non-US data. It can provide more erroneous data than commercial sources. But as for creating new highs and lows indexes on EOD timeframe it should be enough for first tries.

 
(login for full post details)
  #22 (permalink)
 TonyB 
Bay Area, CA - US
 
Experience: Beginner
Platform: TOS, TS & MC
Broker: TDA & TS
Trading: Stock, Options and now Futures (ES)
 
TonyB's Avatar
 
Posts: 516 since Dec 2010
Thanks: 227 given, 140 received


ArshT View Post
Well, Yhoo and Goog are free sources so don't fully rely on it especially in regards to getting accurate non-US data. It can provide more erroneous data than commercial sources. But as for creating new highs and lows indexes on EOD timeframe it should be enough for first tries.

Thank you for the feedback. And, also for your earlier comments with comparisons to MC. Essentially, I'll be deciding between the two, with the emphasis being on back-testing, at least initially. Later, actual trading from the charts, which AB seems to accomplish very well.

ArshT, I currently have data from brokers TD Ameritrade / ThinkorSwim (equity, options & futures), and Open E-Cry (equity only now). Are you aware of a way to extract historical data from these providers and get it into AB, and thereafter keep it updated from these sources? I'd prefer not pay for another data source when I already have these... Thanks much.

 
(login for full post details)
  #23 (permalink)
 ArshT 
London England
 
 
Posts: 16 since Feb 2012

I have no experience with those brokers you mentioned. TOS provide DDE only, I assume. But I'm not sure. OEC provide DDE too I think.

If any of those provide API access then you can write a plugin since AB provide a free C/C++ development kit (32-bit and 64-bit). Or you hire someone doing it. Another possibility is asking the brokers to provide access to AB and linking to Amibroker's ADK.

There is also a .Net for Amibroker development kit. So you could use C# (32-bit and 64-bit), too.

 
(login for full post details)
  #24 (permalink)
 TonyB 
Bay Area, CA - US
 
Experience: Beginner
Platform: TOS, TS & MC
Broker: TDA & TS
Trading: Stock, Options and now Futures (ES)
 
TonyB's Avatar
 
Posts: 516 since Dec 2010
Thanks: 227 given, 140 received


ArshT View Post
I have no experience with those brokers you mentioned. TOS provide DDE only, I assume. But I'm not sure. OEC provide DDE too I think.

If any of those provide API access then you can write a plugin since AB provide a free C/C++ development kit (32-bit and 64-bit). Or you hire someone doing it. Another possibility is asking the brokers to provide access to AB and linking to Amibroker's ADK.

There is also a .Net for Amibroker development kit. So you could use C# (32-bit and 64-bit), too.

Wow, after some digging, I found that TD Ameritrade has an API:

https://www.tdameritrade.com/api.html

TDA is a rather large broker here in the US. I'm guessing that someone created a plug-in already for AB. Sounds like this API connection would get me historical and current data...

 
(login for full post details)
  #25 (permalink)
 NW27 
Newcastle, Australia
 
Experience: Intermediate
Platform: Multicharts 8 - Full Version
Broker: IB
Trading: SPI,FTSE100, 6E, 6A
 
Posts: 285 since Oct 2010
Thanks: 108 given, 186 received

Hi,
Im a professional programmer, using languages from assembler to pascal and C.

I moved from AB to NT and now use Multicharts.
If you are serious about creating and back testing strategies, then MC is the way to go.
As a quick example, AB doesn't know when you are in a trade. You have to create your own variable and record how many long/short contracts shares or whatever.
Also, it is like NT in that it doesn't do intra bar analysis.

Neil.

Sent from my GT-I9100T using Tapatalk

 
(login for full post details)
  #26 (permalink)
 edakat 
Traders Haven
 
Experience: Intermediate
Platform: Market Delta
Trading: Futures
 
Posts: 14 since Jun 2010
Thanks: 10 given, 1 received

Amibroker, can't handle tick data efficiently like MC or Ninja

Follow me on Twitter
 
(login for full post details)
  #27 (permalink)
 ArshT 
London England
 
 
Posts: 16 since Feb 2012


NW27 View Post
Hi,
Important a professional programmer, using languages from assembler to pascal and C.

I moved from AB to NT and now use Multicharts.
If you are serious about creating and back testing strategies, then MC is the way to go.
As a quick example, AB doesn't know when you are in a trade. You have to create your own variable and record how many long/short contracts shares or whatever.
Also, it is like NT in that it doesn't do intra bar analysis.

Neil.

Sent from my GT-I9100T using Tapatalk

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


Quoting 
Hello,

It is pure nonsense. This user has absolutely NO idea what he is talking about. AmiBroker provides many unique features NOT included in ANY software, including Multicharts and one of these features is custom backtester
h t t p:/ /w w w.amibroker.com/guide/a_custombacktest. h t m l

It allows NOT ONLY to know when you are in trade on single symbol like MC, but handles MULTIPLE positions at the same time on MULTIPLE symbols (see GetFirstOpenPos/GetNextOpenPos) on the PORTFOLIO level. Everything is customizable to the level that can not be dreamt of in other softwares. You can even design your OWN backtester - this is simply UNDOABLE in other softwares.
h t t p://w w w.amibroker.org/userkb/2008/03/16/amibroker-custom-backtester-interface-2/

AmiBroker is WAY SUPERIOR to anything that Multicharts offers in terms of functionality AND speed.

Literally everything is possible with AmiBroker and it is done with unmatched speed.

The only limitation is THE USER.

Best regards,
Tomasz Janeczko
amibroker.com


 
(login for full post details)
  #28 (permalink)
 ArshT 
London England
 
 
Posts: 16 since Feb 2012


edakat View Post
Amibroker, can't handle tick data efficiently like MC or Ninja

Another"expert". What do you mean?

 
(login for full post details)
  #29 (permalink)
 ArshT 
London England
 
 
Posts: 16 since Feb 2012


TonyB View Post
Wow, after some digging, I found that TD Ameritrade has an API:

https://www.tdameritrade.com/api.html

TDA is a rather large broker here in the US. I'm guessing that someone created a plug-in already for AB. Sounds like this API connection would get me historical and current data...

Well, as mentioned either you hire someone doing it or you make a plugin yourself. ADKs for Amibroker are available. I think some guys already made plugins but I wouldn't trust it without source code. Best possibility is to either ask at TDA or doing it yourself or going to freelancer etc demanding to provide source codes too.
AB's ADK is available for free AmiBroker DevLog AmiBroker Development Kit (ADK) for C/C++ now available to everyone
AmiBroker DevLog ADK updated with 64-bit example DLL
There is also a .Net ADK available provided by a 3rd party .NET for AmiBroker

Bye for now.

 
(login for full post details)
  #30 (permalink)
 ArshT 
London England
 
 
Posts: 16 since Feb 2012

TD Ameritrade .NET SDK TD Ameritrade .NET SDK

 
(login for full post details)
  #31 (permalink)
 TonyB 
Bay Area, CA - US
 
Experience: Beginner
Platform: TOS, TS & MC
Broker: TDA & TS
Trading: Stock, Options and now Futures (ES)
 
TonyB's Avatar
 
Posts: 516 since Dec 2010
Thanks: 227 given, 140 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?

 
(login for full post details)
  #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: 108 given, 186 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

 
(login for full post details)
  #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: 108 given, 186 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.

 
(login for full post details)
  #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


 
(login for full post details)
  #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

 
(login for full post details)
  #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: 108 given, 186 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.

 
(login for full post details)
  #37 (permalink)
 TonyB 
Bay Area, CA - US
 
Experience: Beginner
Platform: TOS, TS & MC
Broker: TDA & TS
Trading: Stock, Options and now Futures (ES)
 
TonyB's Avatar
 
Posts: 516 since Dec 2010
Thanks: 227 given, 140 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?

 
(login for full post details)
  #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: 108 given, 186 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.

The following user says Thank You to NW27 for this post:
 
(login for full post details)
  #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: 108 given, 186 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

 
(login for full post details)
  #40 (permalink)
 TonyB 
Bay Area, CA - US
 
Experience: Beginner
Platform: TOS, TS & MC
Broker: TDA & TS
Trading: Stock, Options and now Futures (ES)
 
TonyB's Avatar
 
Posts: 516 since Dec 2010
Thanks: 227 given, 140 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...

 
(login for full post details)
  #41 (permalink)
 NW27 
Newcastle, Australia
 
Experience: Intermediate
Platform: Multicharts 8 - Full Version
Broker: IB
Trading: SPI,FTSE100, 6E, 6A
 
Posts: 285 since Oct 2010
Thanks: 108 given, 186 received

Tony,

I have both of the books "Quantitative Trading Systems" and "Introduction to AmiBroker".
They go from the beginner to AB to quite more advanced concepts.
As I mentioned when I first joined this subject, I am a professional programmer (or was) and I like to put my efforts into making systems that work not learning how to get around issues/limitations of the programming language.

It will be very interesting to see what the code looks like and how easy it is to read, when ArshT comes back with the AB equivalent to the very simple EasyLanguage example I gave.

Also, he has not answered the question about Intrabar testing.
It's amazing how you can turn a profitable system on a 5min chart into an ordinary system when you use a 1min intrabar test and then into a crap system when you use true tick data.
Same system, still using a 5min bar chart but looking inside each bar.
Just in case your not sure on what people are referring to in the above, as an example, on a 5min bar, say the open was 1/3 of the way up on the bar and the close was 1/3 down from the high of the bar. What came first, the high of the bar or the low of the bar? Unless you look and test at the intrabar action you can't tell. Multicharts allows you to drill down inside the bar action and test this.
This may be why MC is some what slower than AB. If AB is only testing at 5min level and no intrabar test and MC has been set to test down to the tick level inside the 5min bar, of course it will take longer but it is exactly as per real life action.

Neil.

The following user says Thank You to NW27 for this post:
 
(login for full post details)
  #42 (permalink)
 TonyB 
Bay Area, CA - US
 
Experience: Beginner
Platform: TOS, TS & MC
Broker: TDA & TS
Trading: Stock, Options and now Futures (ES)
 
TonyB's Avatar
 
Posts: 516 since Dec 2010
Thanks: 227 given, 140 received

I too would like to see the code. That said, the MA cross over code provided earlier, I think by lurker, looked pretty nice:

buy= cross ( ma(c, 10), ma(c, 20));
sell= cross ( ma(c, 20), ma(c, 10));

If others codes are like this, I might be willing to give it a go...

I follow you on the intrabar testing alright. Googling on this topic for AB reveals some difficulties, or that it is a lot of work. That was in 2009 though. Another discussion in 2010 found intrabar questions unanswered. Would be neat to see what the situation is now...

That said, for my current purposes, this would not seem to pose a problem for me. Either way, I'm finding this very educational and helpful.

 
(login for full post details)
  #43 (permalink)
 NW27 
Newcastle, Australia
 
Experience: Intermediate
Platform: Multicharts 8 - Full Version
Broker: IB
Trading: SPI,FTSE100, 6E, 6A
 
Posts: 285 since Oct 2010
Thanks: 108 given, 186 received


TonyB View Post
I too would like to see the code. That said, the MA cross over code provided earlier, I think by lurker, looked pretty nice:

buy= cross ( ma(c, 10), ma(c, 20));
sell= cross ( ma(c, 20), ma(c, 10));

True but where is the StopLoss? Is it at recent Low's. No it is a hard fixed value from the entry in points or %. Not a TA defined support area.
How many have you bought? It's not possible to scale out of the trade. After reaching a certain profit or if the TA StopLoss was going to be to far away, go for a smaller position size. I can't easily see how you can do any of this in AB but MC is a piece of cake.

Neil.

The following 2 users say Thank You to NW27 for this post:
 
(login for full post details)
  #44 (permalink)
 TonyB 
Bay Area, CA - US
 
Experience: Beginner
Platform: TOS, TS & MC
Broker: TDA & TS
Trading: Stock, Options and now Futures (ES)
 
TonyB's Avatar
 
Posts: 516 since Dec 2010
Thanks: 227 given, 140 received


NW27 View Post
True but where is the StopLoss? Is it at recent Low's. No it is a hard fixed value from the entry in points or %. Not a TA defined support area.
How many have you bought? It's not possible to scale out of the trade. After reaching a certain profit or if the TA StopLoss was going to be to far away, go for a smaller position size. I can't easily see how you can do any of this in AB but MC is a piece of cake.

Neil.

Thanks Neil for posing those other important questions. Might you have an example for MC, so we can see what such looks like in its PL?

I see that AB has an AFL Wizard. I'm trying to find-out how helpful it is now...

 
(login for full post details)
  #45 (permalink)
 NW27 
Newcastle, Australia
 
Experience: Intermediate
Platform: Multicharts 8 - Full Version
Broker: IB
Trading: SPI,FTSE100, 6E, 6A
 
Posts: 285 since Oct 2010
Thanks: 108 given, 186 received


TonyB View Post
Thanks Neil for posing those other important questions. Might you have an example for MC, so we can see what such looks like in its PL?

Entry Code as per your AB example
 
Code
if Average(C,10) crosses over Average(C,20) then                                                                    
    Buy ( "MA2CrossLE" ) 3 contracts next bar at market ;
The exit code is all done in these few lines of code in this prior post


Buy 3, Sell 1 at a Profit target of 5 points, Sell 2 at a Profit Target of 10 points.
StopLoss set for the Low of the bar prior to the Entry.

Neil.

The following user says Thank You to NW27 for this post:
 
(login for full post details)
  #46 (permalink)
 ArshT 
London England
 
 
Posts: 16 since Feb 2012


NW27 View Post
Tony,

It will be very interesting to see what the code looks like and how easy it is to read, when ArshT comes back with the AB equivalent to the very simple EasyLanguage example I gave.

Also, he has not answered the question about Intrabar testing.
It's amazing how you can turn a profitable system on a 5min chart into an ordinary system when you use a 1min intrabar test and then into a crap system when you use true tick data.
Same system, still using a 5min bar chart but looking inside each bar.
Just in case your not sure on what people are referring to in the above, as an example, on a 5min bar, say the open was 1/3 of the way up on the bar and the close was 1/3 down from the high of the bar. What came first, the high of the bar or the low of the bar? Unless you look and test at the intrabar action you can't tell.

You can do Intrabar testing too. I.e. simply use timeframe functions and expandfirst. The LAST bar close includes the actual LAST price regardless of timeframe. It was even answered by T.J. So please stop the misinformation. And as you already mentioned to get 100% accuracy simply use tick data. You wouldn't need CBT to use those functions. I haven't use custom backtester much yet (just added some additional metrics and code for adding slippage etc) so I don't know how to do it there. I haven't explored the complete list of capabilities of AB yet. Custom backtester is an environment within AB where you can design your own backtester or just add additional stuff. Just show me a software of the group "usual suspects" where you can do that. It opens the door to 100% flexibility. Just look at the links with examples provided by Tomasz.


NW27 View Post
This may be why MC is some what slower than AB. If AB is only testing at 5min level and no intrabar test and MC has been set to test down to the tick level inside the 5min bar, of course it will take longer but it is exactly as per real life action.

Neil.

Sorry but wrong again. Both were tested with same conditions in one timeframe backed by a MC user. If time permits and I should feel like then I could do a test with both using intrabar testing.

@ Tony, if you can work with Excel you can also work with AFL. IMO, it is very simple to use and powerful (and yes AB with AFL/..../... is faster. It's widely known for being one of the fastest if not the fastest one with high stability and very few bugs). But again you aren't even forced to use AFL. And I don't think there is any software without a learning curve

But I'm not here to advertise AB. I just read TonyB's question followed by the misinformations by two users and wanted to give a reply. The first time I heard of this board was sometime last year. So my interest hasn't been enthusiastic so far (one reason, not having much time to lurk around every board on this planet :-) ).

 
(login for full post details)
  #47 (permalink)
 NW27 
Newcastle, Australia
 
Experience: Intermediate
Platform: Multicharts 8 - Full Version
Broker: IB
Trading: SPI,FTSE100, 6E, 6A
 
Posts: 285 since Oct 2010
Thanks: 108 given, 186 received

Tony and I would like to see the AB version of the small sample system with a TA stoploss and two stage profit exit.
Could you demonstrate this please.

Neil.

Sent from my GT-I9100T using Tapatalk

 
(login for full post details)
  #48 (permalink)
 TonyB 
Bay Area, CA - US
 
Experience: Beginner
Platform: TOS, TS & MC
Broker: TDA & TS
Trading: Stock, Options and now Futures (ES)
 
TonyB's Avatar
 
Posts: 516 since Dec 2010
Thanks: 227 given, 140 received


NW27 View Post
Tony and I would like to see the AB version of the small sample system with a TA stoploss and two stage profit exit.
Could you demonstrate this please.

Neil.

Sent from my GT-I9100T using Tapatalk

Would be nice to see how that looks in AB. Maybe this might help us a little? Trailing stop loss from the AB AFL library...

AmiBroker - AFL Library

 
(login for full post details)
  #49 (permalink)
 Big Mike 
Site Administrator
Swing Trader
Data Scientist & DevOps
Manta, Ecuador
 
Experience: Advanced
Platform: Custom solution
Trading: Futures & Crypto
 
Big Mike's Avatar
 
Posts: 50,068 since Jun 2009
Thanks: 32,534 given, 98,483 received


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

I'm a discretionary trader that uses basically zero indicators, don't have time to learn a new platform and no need or desire for it.

Mike

We're here to help -- just ask

For the best trading education, watch our webinars
Searching for trading reviews? Review this list

Follow us on Twitter, YouTube, and Facebook

Support our community as an Elite Member:
https://futures.io/elite/

Visit other sites? Please spread the word about your experience with our community!
Follow me on Twitter Visit my futures io Trade Journal
 
(login for full post details)
  #50 (permalink)
 TonyB 
Bay Area, CA - US
 
Experience: Beginner
Platform: TOS, TS & MC
Broker: TDA & TS
Trading: Stock, Options and now Futures (ES)
 
TonyB's Avatar
 
Posts: 516 since Dec 2010
Thanks: 227 given, 140 received


Big Mike View Post
I'm a discretionary trader that uses basically zero indicators, don't have time to learn a new platform and no need or desire for it.

Mike

Mike, thanks for the follow-up. Makes sense as AB doesn't have an emphasis on discretionary trading...

 
(login for full post details)
  #51 (permalink)
 NW27 
Newcastle, Australia
 
Experience: Intermediate
Platform: Multicharts 8 - Full Version
Broker: IB
Trading: SPI,FTSE100, 6E, 6A
 
Posts: 285 since Oct 2010
Thanks: 108 given, 186 received


TonyB View Post
Would be nice to see how that looks in AB. Maybe this might help us a little? Trailing stop loss from the AB AFL library... AmiBroker - AFL Library

Or in Multicharts

 
Code
[IntrabarOrderGeneration = false]
inputs: 
    PositionBasis( false ), 
    FloorAmt( 1 ), 
    TrailingPct( 20 ) ;                              

if PositionBasis then
    SetStopPosition
else
    SetStopShare ;

SetPercentTrailing( FloorAmt, TrailingPct ) ;

 
(login for full post details)
  #52 (permalink)
 NW27 
Newcastle, Australia
 
Experience: Intermediate
Platform: Multicharts 8 - Full Version
Broker: IB
Trading: SPI,FTSE100, 6E, 6A
 
Posts: 285 since Oct 2010
Thanks: 108 given, 186 received


ArshT View Post
You can do Intrabar testing too. I.e. simply use timeframe functions and expandfirst. The LAST bar close includes the actual LAST price regardless of timeframe.

More special programming, or in Multicharts, you could just tick a box and select minute or tick data. Also have a look at how you can use the Bid & Ask data to FULLY back test.



ArshT View Post
It was even answered by T.J.

I must be blind, I didn't see any reference in TJ's cut and pasted comment. At least I'm talking from experience. Unlike you.


ArshT View Post
So please stop the misinformation.

You've yet to show us how I'm wrong, in that within a system, I cannot tell whether I'm in a trade or not.


ArshT View Post
I haven't use custom backtester much yet (just added some additional metrics and code for adding slippage etc) so I don't know how to do it there.

Simple to add slippage in MC. How many dollars would you like??? Again no special coding required.




ArshT View Post
Just look at the links with examples provided by Tomasz.

None of those links show me how to set a specific number of contracts to Buy or Sell at individual points or whether I'm in a trade, so that I can exit the remander on a ATR trailing stop or what ever. Those links are all relating to trades that are looked at after the fact via the Backtester. Not whilst they are actually happening and price action calcs need to come into play and make decisions on getting In/Out


ArshT View Post
Sorry but wrong again. Both were tested with same conditions in one timeframe backed by a MC user. If time permits and I should feel like then I could do a test with both using intrabar testing.

I wasn't trying to prove I was right or wrong, just a suggestion. You love to say people are wrong.


ArshT View Post
@ Tony, if you can work with Excel you can also work with AFL. IMO, it is very simple to use.

Yeah right. When do I use a IF statement as opposed to a IFF statement? When do I use a global variable and when is it in the array of prices? Why do I need an array of prices?



ArshT View Post
But I'm not here to advertise AB. I just read TonyB's question followed by the misinformations by two users and wanted to give a reply.

Tony and I are still waiting for sample AB code to emulate the MC very basic system I displayed. Perhaps you have know idea. Your just very good at being rude to other people that do contribute.


Just to show I do know something about AB and it's capabilities. Here is a chart showing a System that I wrote and it is fully written in one Amibroker System file. No trying to get to special after the fact backtesting programming.
Again, I still don't know what the BackTesting, after the fact, software has to do with a live strategy.


Oh, you want the code
 
Code
/*
//System3
//=================================
// NW 0903, AB 5.23, Status: Developmental
//
// This Script is for EDUCATIONAL PURPOSES ONLY.  It is NOT a TRADABLE SYSTEM.
// ---------------------------------------------------------------------------
//
// Futures System
//
// StopLoss    1.5 ATR 10
//        Population: ASX300, 1/7/02 - 30/6/07, Number of positions, Liquidity; all assumed
//        Trades assessed on the Close overnight, entries and exits on the Open next Bar
//        Standard brokerage (0.11%, $30 min, - E-Trade) and interest on cash (5%).
// Database  :     FTSE
// Objective :    FTSE
// Settings  :     FTSE
//
//
// Set Backtest Conditions
// =======================
// Set Starting Equity
*/
EqtSttAmt = 20000 ;            // Equity Start Amount
//

// ####  Defines market hours
//##########################################################
RequestTimedRefresh( 1 );
DOW = Now( 9 );//day of the week
WeekEnd = IIf( ( DOW == 1 OR DOW == 7 ), 1, 0 );

Time = TimeNum();
MarketOpen = 100000;//08:00:00;
MarketClose = 163000;//20:00:00 or 163000
MarketON = TimeNum() >= MarketOpen AND (Now( 4 ) < MarketClose) AND NOT WeekEnd;
MarketOFF = IIf(TimeNum() >= MarketClose,0,1) ;//day's over
Hhmod = frac( MArketclose / 10000 );

//
// Population and Position sizing
// ==============================
//
// Set Number of positions (as a % of Current Equity)
//PosOpnMax =  1 ;  //Optimize("NumPos", 10, 5, 15, 1) ; 
//PositionSize = 1 / PosOpnMax ;
PositionSize = MarginDeposit = 1;    // Required for trading futures contracts
//
// Set Population Minimum Turnover (Liquidity)
LiqMinCur = 400 ;  //Optimize("LiqMin-K", 400, 300, 1000, 50) ; 
LiqSmaPed = 20 ;
LiqActAmt = MA(C * V, LiqSmaPed) / 1000 ;
LiqActSwt = LiqActAmt > LiqMinCur ;


/* First we need to enable custom backtest procedure and 
** tell AmiBroker to use current formula 
*/ 

SetCustomBacktestProc(""); 

/* Now custom-backtest procedure follows */ 

if( Status("action") == actionPortfolio ) 
{ 
    bo = GetBacktesterObject(); 

    bo.Backtest(); // run default backtest procedure 

    st = bo.GetPerformanceStats(0); // get stats for all trades 

    // Expectancy calculation (the easy way) 
    // %Win * AvgProfit - %Los * AvgLos 
    // note that because AvgLos is already negative 
    // in AmiBroker so we are adding values instead of subtracting them 
    // we could also use simpler formula NetProfit/NumberOfTrades 
    // but for the purpose of illustration we are using more complex one :-) 
    expectancy = st.GetValue("WinnersAvgProfit")*st.GetValue("WinnersPercent")/100 + 
                st.GetValue("LosersAvgLoss")*st.GetValue("LosersPercent")/100; 

    // Here we add custom metric to backtest report 
    bo.AddCustomMetric( "Expectancy ($)", expectancy ); 
} 
//
// External Functions
// ==============================
//

function Pivot ()
{
    return (High+Low+Close)/3;
};


function PivotRibbon(PivotMA)
{
    Result=0;Uptrend=0;Dntrend=0;
    FastP=Pivot();
    SlowP=MA( FastP, PivotMA ); // Usally3
    Uptrend=IIf(FastP>SlowP,True,False);
    Dntrend=IIf(FastP<SlowP,True,False);
    Result = IIf( Uptrend,1,IIf( Dntrend,-1,0));
    return Result;
};

function PivotHist(SMAPeriods,PivotPeriods)
{
    P = ParamField("Price field",-1);
//    Periods  = Param("SMA Periods", SMAPeriods, 2, 300, 1, 10 );
//    PPeriods = Param("Pivot Periods", PivotPeriods, 2, 300, 1, 10 );
    Periods  = SMAPeriods;
    PPeriods = PivotPeriods;
    i = MA(P, Periods )-MA(Pivot(),PPeriods);
    return I ;
}

// ==========================================================================================
//
// Entry Conditions
// ================
//
// Optimise variables for Entry formula
//EntSmaSht = Optimize("EntSmaSht", 5, 3, 30, 1) ; //40
//EntSmaLng = Optimize("EntSmaLng", 8, 5, 30, 1) ; //110
//EntCrsSht = Optimize("EntCrsSht", 10, 2, 16, 2) ;
//EntCrsLng = Optimize("EntCrsLng", 16, 2, 16, 2) ;

//TrendFilter     = Optimize("MA Periods", 165, 5, 200, 5) ;
TrendFilter     = 165 ;

//EntSMAPeriods     = Optimize("SMA Periods", 11, 1, 20, 1) ;
//EntPivotPeriods     = Optimize("Pivot Periods", 12, 1, 20, 1) ;
//EntRibbon             = Optimize("Ribbon MA", 3, 1, 10, 1) ;
EntSMAPeriods     = 11 ;
EntPivotPeriods     = 12 ;
EntRibbon             = 2 ;

RiskAmount=Optimize("RiskAmount",Param("RiskAmount",10),5,30,1);
//RiskAmount=15;
//
// Generate a Buy Signal (Entry)
EntSigSwt = 
    (PivotRibbon(EntRibbon)==1)
    AND ((PivotHist(EntSMAPeriods,EntPivotPeriods) > 0) OR ((PivotHist(EntSMAPeriods,EntPivotPeriods) > Ref(PivotHist(EntSMAPeriods,EntPivotPeriods),-1))))
    AND V > Ref(V,-1)
    AND C > (H+L)/2
    AND MA(Close,TrendFilter) > Ref(MA(Close,TrendFilter),-1)
    AND (TimeNum() > 100000) AND (TimeNum() < 160000)
    //AND (DateNum()>1090518)
 ;

//IIf((PivotRibbon(3)==1) AND (PivotHist() > 0), BuySigInd=1,0);

//
// Sell signals (None in this model)
// ---------------------------------
//ExtSigSwt = Close < SAR(0.02,0.2 )  ;
ExtSigSwt = Close < MA(Close,8)  ;
Plot(MA(Close,8), "ESL", colorGreen, styleLine) ;

//
// Initial Stop Loss
//------------------                //    Number of Bars for ISL ATR 
IslAtrBar = 3;//IslAtrBar = Optimize("IslATRBars", 3, 3, 10, 1) ;
//IslAtrBar = 5 ;    

//    ATR Factor 
IslAtrFac = 2.6;//IslAtrFac = Optimize("IslAtrFac", 2.6, 0.4, 3, 0.2) ;
//IslAtrFac = 2.2 ;
//
// Trailing Stop Loss
// -------------------
//    Number of Bars for TSL ATR calc 
TslAtrBar = 3; //TslAtrBar = Optimize("TslAtrBar", 6, 3, 10, 1) ;
//TslAtrBar = 5 ;
//    ATR Factor 
TslAtrFac = 2 ;//TslAtrFac = Optimize("TslATRFac", 2.6, 1.0, 3, 0.2) ;
//TslAtrFac = 2.8 ;
//
// Trade Processing Loop
// =====================
//
// Set arrays to a starting condition
Buy = 0 ;
Sell = 0 ;
BuySigInd = 0 ;
SelSigInd = 0 ;
IslPntArr = Null ;
TslPntArr = Null ;
IslBarStp = 0 ;
TslBarStp = 0 ;
IslBarGap = IslAtrFac * ATR(IslAtrBar) ;
TslBarGap = TslAtrFac * ATR(TslAtrBar) ;
TrdBarCnt = 0 ;
TrdProfit = 0 ;
TrdEntry = 0;
Position = 0 ;
Free_Trade = 0;
Initial_Stop = 0;
HalfBreakEven = 0;
FullBreakEven = 0;
LossSigInd = 0 ;
TradeEntryPrice = 0;
HalfBreakEvenReached=0;

//
//
// Trade Processing Loop proper
for( i = 1 ; i < BarCount ; i++)
{
 if(i < BarCount -1) 
  {
    // Buy processing
   if( EntSigSwt[i] AND Position[i]==0 )// AND ! TslBarStp[i])// AND EntSigSwt[i-1])// AND TrdBarCnt[i+1] = 1)
    {     
        BuySigInd[i] = 1 ;
        Position[i+1] = 1 ;  // Entered Long Position
        Buy[i+1] = 1 ; 
        BuyPrice[i+1] = O[i+1] ;
        Initial_Stop[i+1]=BuyPrice[i+1]-RiskAmount;
        Free_trade[i]=0;
        TradeEntryPrice[i+1]=BuyPrice[i+1];
        TrdProfit[i+1]=Close[i+1]-BuyPrice[i+1];
        TrdBarCnt[i+1]=1;
        Initial_Stop[i]=BuyPrice[i+1]-RiskAmount;
        IslPntArr[i +1] = Initial_Stop[i] ;     // Update the ISL Line
        HalfBreakEvenReached[i]=0;
    }

    
    // Sell processing
    if(Position[i]==1)
    {
        if(Free_Trade[i]==1)
        { // Execute Trailing Stop
              TslPntArr[i +1] = TslPntArr[i +1] ;     // Update the TSL Line
            if(ExtSigSwt[i]) 
            {
                Sell[i +1] = 1 ;
                  SellPrice[i +1] = O[i + 1] ;
                SelSigInd[i]=1;
                // Clear_Static_Variables
                Position[i]=0;
                Free_trade[i]=Null;
            };

        }
        else
        {
            if( High[i]-RiskAmount>TradeEntryPrice[i])
            { // Free Trade - Adjust to breakeven point

                if(Initial_Stop[i] < TradeEntryPrice[i]) 
                {    
                    Initial_Stop[i]  = TradeEntryPrice[i];                    
                };
                IslPntArr[i]     = Initial_Stop[i] ;     //
                TslPntArr[i]     = Close[i] ;             // Update the ISL Line
                Free_Trade[i]    = 1;                    // Move onto trailing stop
                FullBreakEven[i] = 1;                    // Display Star
            }
            else
                if( High[i]-(RiskAmount/2)>TradeEntryPrice[i] AND HalfBreakEvenReached[i]==0)
                { // 1/2 point of a breakeven trade
                    HalfBreakEven[i]=1;
                    HalfBreakEvenReached[i]=1;
                    if(Initial_Stop[i] < (TradeEntryPrice[i]-(RiskAmount/2))) 
                    {    
                        Initial_Stop[i] = TradeEntryPrice[i]-(RiskAmount/2);
                    }; 
                    IslPntArr[i] = Initial_Stop[i] ; //
                }
                else
                    if( TrdBarCnt[i]>5)
                    { // Sideways Stop
                        if(Low[i]>Initial_Stop[i])
                        {
                            Initial_Stop[i] = Low[i] ;
                            IslPntArr[i] = Initial_Stop[i] ; //
                        }
                    };

            if(Close[i]<Initial_Stop[i] AND Initial_Stop[i]>TradeEntryPrice[i]) // Above Entry but sideways
            { // Exit due to either a time stop or a breach of the Initial stop
                Sell[i] = 1 ;
                  SellPrice[i] = Initial_Stop[i] ;
                LossSigInd[i]=1;
                Position[i]=0;
            }
            if(Low[i]<Initial_Stop[i] AND Initial_Stop[i]<TradeEntryPrice[i]) // Below Entry but sideways
            { // Exit due to either a time stop or a breach of the Initial stop
                Sell[i] = 1 ;
                  SellPrice[i] = Initial_Stop[i] ;
                SidewaysSigInd[i]=1;
                Position[i]=0;
            }
            if(TrdBarCnt[i]>72)
            { // Exit due to either a time stop or a breach of the Initial stop
                Sell[i] = 1 ;
                  SellPrice[i] = Initial_Stop[i] ;
                LossSigInd[i]=1;
                Position[i]=0;
            }
        }
    }
    // Somewhere between the Entry and the exit
    if( Position[i]==1 )
    {
//        IslBarStp[i +1] = C[i] - IslBarGap[i] ;
        IslBarStp[i +1] = IslBarStp[i] ;
        IslPntArr[i +1] = IslPntArr[i] ;     // Update the ISL Line
        TslBarStp[i +1] = C[i] - TslBarGap[i] ;
        TslPntArr[i+1]  = TslPntArr[i] ;    
        TrdEntry[i+1]   = O[i +1];
        TrdProfit[i+1]  = Close[i+1]-TradeEntryPrice[i];
        TrdBarCnt[i+1]  = TrdBarCnt[i] +1;
        Position[i+1]   = Position[i];
        Free_trade[i+1] = Free_trade[i];
        Initial_Stop[i+1] = Initial_Stop[i];
        HalfBreakEvenReached[i+1]=HalfBreakEvenReached[i];
        TradeEntryPrice[i+1] = TradeEntryPrice[i];
    }
  }
}
        
    


/*
    // Sell processing
   if(Position=1 AND (ExtSigSwt[i] OR C[i] < IslBarStp[i] OR C[i] < TslBarStp[i]) AND TslBarStp[i] > 0)
   {
        SelSigInd[i] = 1 ;
        if( i < BarCount -1)
        {

            TrdBarCnt[i +1] = TrdBarCnt[i] + 1 ;
           if(MarketOFF[i]==0)
            { 
                Sell[i +1] = 1 ;
                  SellPrice[i +1] = O[i + 1] ;
            }
            else
            {
                Sell[i +1] = 1 ;
                SellPrice[i +1] = O[i + 1] ;
            }
            StaticVarSet("Position",0);
        }
    } else  // Main Trade loop
        {
//               if((TslBarStp[i] > 0) OR (IslBarStp[i] > 0) AND (i < BarCount -1))
               if(Position=1 AND (i < BarCount -1))
               {  // Keep array up to date 
                TrdBarCnt[i +1] = TrdBarCnt[i] + 1 ;
                IslBarStp[i +1] = IslBarStp[i] ;
                TrdEntry[i +1]  = TrdEntry[i] ;

                TrdProfit[i+1] = Close[i+1]-TrdEntry[I+1]; // Update Trade Profit

                if(C[i+1] < (TrdEntry[i+1]+ RiskAmount[i+1])) 
                {  // Entry Cover 
                    //if(TrdProfit[i+1] > RiskAmount[i+1]/2)  
                    //    IslBarStp[i +1] = (TrdProfit[i+1] - RiskAmount[i+1])+TrdEntry[i+1];
                      //if(TslBarStp[i +1] < IslBarStp[i +1])
                        IslBarStp[i +1] =  Max(H[i +1] - TslBarGap[i +1], IslBarStp[i]) ;
                        IslPntArr[i +1] = IslBarStp[i +1] ;     // Update the ISL Line
                }
                else
                {      // Re calc trailing stop
                      TslBarStp[i +1] = Max(C[i +1] - TslBarGap[i +1], TslBarStp[i]) ; // Should be at least C if not H
                      //if(TslBarStp[i +1] > IslBarStp[i +1]) 
                          TslPntArr[i +1] = TslBarStp[i +1] ;        // Update the TSL Line
                }
               } 
        }
*/    

//
ToolTip=StrFormat(    "Position: %g", Position);
ToolTip=StrFormat(    "Free_Trade: %g", Free_Trade);
ToolTip=StrFormat(    "TradeEntryPrice: %g", TradeEntryPrice);
ToolTip=StrFormat(    "TrdProfit: %g", TrdProfit);
ToolTip=StrFormat(    "RiskAmount: %g\n", RiskAmount);
ToolTip=StrFormat(    "Initial_Stop: %g\n", Initial_Stop);


ToolTip=StrFormat(    "IslBarStp: %g", IslBarStp);
ToolTip=StrFormat(    "IslPntArr: %g\n", IslPntArr);
ToolTip=StrFormat(    "TslBarStp: %g", TslBarStp);
ToolTip=StrFormat(    "TslPntArr: %g\n", TslPntArr);

ToolTip=StrFormat(    "X: %g", C);
ToolTip=StrFormat(    "Y: %g\n", TrdEntry+ RiskAmount);


//ApplyStop( stopTypeNBar, stopModeBars, 2 ,1);  // Time Stop
//ApplyStop(stopTypeLoss, stopModePoint, 7.5,1,False );
//AddTextColumn( string, Name, format = 1.2, textColor = colorDefault, bkgndColor = colorDefault, width = -1 ) 
//AddTextColumn( Close, "Name", format = 1.2, colorRed, colorBlue,5 ) ;

//AddTextColumn( Group_id(1), "Name" ) ;
AddColumn(Buy, "Buy2", 1);



//
// Format Simple Chart
// ===================
GraphXSpace = 5 ;
PlotShapes(BuySigInd * shapeSmallUpTriangle, colorGreen, 0, Low - ATR(5)) ;
PlotShapes(SelSigInd * shapeSmallDownTriangle, colorRed, 0, High + ATR(5)) ;
PlotShapes(Buy * shapeUpArrow, colorGreen, 0, Low - ATR(5)) ;
PlotShapes(Sell * shapeDownArrow, colorRed, 0, High + ATR(5)) ;

PlotShapes(HalfBreakEven * shapeHollowStar, colorRed, 0, High + ATR(5)) ;
PlotShapes(FullBreakEven * shapeStar, colorRed, 0, High + ATR(5)) ;

PlotShapes(LossSigInd * shapeCircle, colorRed, 0, High + ATR(5)) ;
//PlotShapes(SidewaysSigInd * shapeSquare, colorRed, 0, High + ATR(5)) ;
//GraphZOrder = 2;
//PlotShapes(LossSigInd * 53, colorRed, 0, (High + Low+Close/3)) ;



//PlotText( "Sell\n@" + C, 0, H + ATR(10), colorRed, colorYellow ); 
Offset = High + ATR(10);
PlotText( "Sell\n@" + C, 0, Offset[0], colorRed, colorYellow ); 

//
Plot( C, "Price", colorBlack, styleCandle ) ;
//ToolTip=StrFormat(    "Open: %g\nHigh:  %g\nLow:   %g\nClose:  %g (%.1f%%)\nVolume:     %g\nPivot: %g\n", O, H, L, C,NumToStr( V, 1 ));//,1,2, SelectedValue( ROC( C, 1 )),Pivot());
ToolTip=StrFormat(    "Open: %g\nHigh:  %g\nLow:   %g\nClose:  %g (%.1f%%)\nPivot:     %g\nMarketoff:%6g\nTrdBarCnt:%6g\n", O, H, L, C,0,PivotRibbon(3),MarketOff,TrdBarCnt);
ToolTip=StrFormat(    "Buy %g\nBuyPrice: %g\nTrdProfit:  %g\nTrdEntry:   %g\nClose:  %g (%.1f%%)\nPivot:     %g\nMarketoff:%6g\nTrdBarCnt:%6g\n", Buy,BuyPrice, TrdProfit, TrdEntry, C,0,PivotRibbon(3),MarketOff,TrdBarCnt);
ToolTip=StrFormat(    "EntSigSwt %g\n", EntSigSwt);

ToolTip=StrFormat(    "TrdEntry: %g\n", TrdEntry);

//
Plot(IslPntArr, "ISL", colorBlue, styleLine) ;
Plot(TslPntArr, "TSL", colorRed, styleLine) ;
//
//Plot( MA( C, EntSmaSht ), "MA-Short", colorGreen, styleDashed); 
//Plot( MA( C, EntSmaLng ), "MA-Long", colorRed, styleDashed); 
//Plot( MA( C, EntCrsSht ), "MA-Cross", colorGreen, styleLine | styleThick); 
//Plot( MA( C, EntCrsLng ), "MA-Short", colorBlue, styleLine); 
//
// System Settings  
SetOption("InitialEquity", EqtSttAmt) ;        // Set Initial Equity
//SetOption("MaxOpenPositions", PosOpnMax) ;    // Maximum number of Open Positions 
SetOption("AllowPositionShrinking", False) ;    // Allow code to manage    
//
// System is Long Only
Short=Cover=0 ;
//

// General Settings & Options
// ===================

// Set Optimizer engine
OptimizerSetEngine("cmae") ;

SetOption("ExtraColumnsLocation",1);  // Put Custom Columns at the begining of the report

// END



Plot( 5, /* defines the height of the ribbon in percent of pane width
*/"Pivot Ribbon",
IIf( PivotRibbon(EntRibbon)==1, colorGreen, IIf( PivotRibbon(EntRibbon)==-1, colorRed, 0 )), /* choose color */
styleOwnScale|styleArea|styleNoLabel, -0.5, 100 );

_SECTION_END();

_SECTION_BEGIN("EMA");
P = ParamField("Price field",-1);
Periods = Param("Periods", 15, 2, 300, 1, 10 );
Plot( EMA( P, Periods ), _DEFAULT_NAME(), ParamColor( "Color", colorCycle ), ParamStyle("Style") ); 
_SECTION_END();

_SECTION_BEGIN("EMA1");
P = ParamField("Price field",-1);
Periods = Param("Periods", 15, 2, 300, 1, 10 );
Plot( EMA( P, Periods ), _DEFAULT_NAME(), ParamColor( "Color", colorCycle ), ParamStyle("Style") ); 
_SECTION_END();

_SECTION_BEGIN("EMA2");
P = ParamField("Price field",-1);
Periods = Param("Periods", 15, 2, 300, 1, 10 );
Plot( EMA( P, Periods ), _DEFAULT_NAME(), ParamColor( "Color", colorCycle ), ParamStyle("Style") ); 
_SECTION_END();
.
.
Back to you ArshT that is always right, yet unable to prove anything himself.

Neil.

The following 2 users say Thank You to NW27 for this post:
 
(login for full post details)
  #53 (permalink)
 TonyB 
Bay Area, CA - US
 
Experience: Beginner
Platform: TOS, TS & MC
Broker: TDA & TS
Trading: Stock, Options and now Futures (ES)
 
TonyB's Avatar
 
Posts: 516 since Dec 2010
Thanks: 227 given, 140 received

NW27, it's nice that you have experience with both, and I'm sure other platforms. You are in a better position to ask such questions than someone like myself...

If indeed some of the things you point-out are short-comings in AB, at least in relation to MC, might it simply be due to AB not being initially focused on futures, like MC? If so, then maybe we can expect improvements in this area, to where things are simplified with check boxes and radial buttons, like you just showed for MC. Or, do you think that there is an inherent flaw in AFL to where such things just cannot be made this simple?

 
(login for full post details)
  #54 (permalink)
 NW27 
Newcastle, Australia
 
Experience: Intermediate
Platform: Multicharts 8 - Full Version
Broker: IB
Trading: SPI,FTSE100, 6E, 6A
 
Posts: 285 since Oct 2010
Thanks: 108 given, 186 received

Hi Tony,
None of this specifically relates to futures. Many people who trade shares, Forex etc scale out of positions or wish to easily program their strategy to move from a trade with a StopLoss to a trade with a breakeven and then maybe sell half the position when they have reached a Reward to Risk ratio of 2 and let the rest run on a trailing stop.
The chart that I showed was all automatically done with AB and shows the various stages of the trade as it moved upwards. I have the same thing demonstrated in MC at You need to zoom in somewhat so that you can see the actual labels of the stop as it moves through it's various stages.

The learning curved required to do the same thing in Multicharts was a hell of a lot less. Just the way AB handles past data as a separate array is right right pain in the ass. But that's just me. As you can see, I can make AB sing but look at the code, it was bloody hard learning the song. However, compare the MC code in the various examples I have given you, to the AB code, ie the trailing stop. In actual fact, the MC code example of the trailing stop is really one line (last one) the rest is just fluff (dressing).

Where AB does have it over MC is in the pretty chart area. Ie you can shade charts etc.
But I'm here to make money not make things look pretty.

Neil.



The following 3 users say Thank You to NW27 for this post:
 
(login for full post details)
  #55 (permalink)
 ehlaban 
Netherlands
 
Experience: Advanced
Platform: Ensign, Multicharts
Trading: SP500
 
Posts: 92 since Nov 2009
Thanks: 66 given, 57 received

Very nicely done Neil, thanks.

Shows you really know what you are talking about !

 
(login for full post details)
  #56 (permalink)
colion
Asheville, North Carolina
 
 
Posts: 24 since Sep 2010
Thanks: 1 given, 15 received


Big Mike View Post
I'm a discretionary trader that uses basically zero indicators, don't have time to learn a new platform and no need or desire for it.

Mike

Mike,

What do you mean by a "discretionary" trader. I'm also classify myself as a discretionary trader which to me means that I do not use a mechanical system but rather make decisions based on a variety of inputs provided by several programs. In the true spirit of a discretionary trader the inputs used are not fixed.

You also must use some type of input. What are the "non-indicator" things that you look at in order to make trading decisions? Perhaps volume or patterns or trendlines or cycles or ... ?

Bill

 
(login for full post details)
  #57 (permalink)
 ArshT 
London England
 
 
Posts: 16 since Feb 2012


NW27 View Post
More special programming, or in Multicharts, you could just tick a box and select minute or tick data. Also have a look at how you can use the Bid & Ask data to FULLY back test.


This just shows again how uninformed you are. Are you faking Andrew Kirillov himself? You can do and choose just the same in Amibroker if you would read the manual which you clearly haven't. Also using Bid and Ask is not a problem if you would have read the manual carefully.


NW27 View Post
I must be blind, I didn't see any reference in TJ's cut and pasted comment.

If you think you are blind I will take good care not to say anything against it. You are the expert here. lol


NW27 View Post
You've yet to show us how I'm wrong, in that within a system, I cannot tell whether I'm in a trade or not..


Your impatience is amazing. I really don't wanna see how you trade while being in that period


NW27 View Post
Simple to add slippage in MC. How many dollars would you like??? Again no special coding required.

Yeah I see that you have problems with coding, reading, researching yourself and so on


NW27 View Post
None of those links show me how to set a specific number of contracts to Buy or Sell at individual points or whether I'm in a trade, so that I can exit the remander on a ATR trailing stop or what ever.


I have thought you were a professional coder. Instead it seems you need every little detail shown to you from start to end of code. I hope you are able to write your own full name yourself.


NW27 View Post
Those links are all relating to trades that are looked at after the fact via the Backtester. Not whilst they are actually happening and price action calcs need to come into play and make decisions on getting In/Out

Again reading problems?
NW27 View Post
I wasn't trying to prove I was right or wrong, just a suggestion. You love to say people are wrong.

Which you clearly are. You stated stuff as facts that are wrong. In the same way as the posts by the other ignorant Mr. Clueless (No, not you TonyB).

NW27 View Post
Yeah right. When do I use a IF statement as opposed to a IFF statement? When do I use a global variable and when is it in the array of prices? Why do I need an array of prices?


Yeah I see that you have again problems with understanding simple things. But that's not my problem

NW27 View Post
Tony and I are still waiting for sample AB code to emulate the MC very basic system I displayed. Perhaps you have know idea. Your just very good at being rude to other people that do contribute.


Again why so impatient in one thread and even two times in one post? Are you like that while trading too? telling the truth by telling people being misinformed isn't the same as being rude.
NW27 View Post
Just to show I do know something about AB and it's capabilities. Here is a chart showing a System that I wrote and it is fully written in one Amibroker System file. No trying to get to special after the fact backtesting programming.
Again, I still don't know what the BackTesting, after the fact, software has to do with a live strategy.

This thread is not about backtesting? Do I have problems with reading and coding or does someone else have them? But please and I really beg you don't show me how you trade as well. I do not want to lose money. And again if you have problems with coding a strategy it's not one of my problems.
NW27 View Post
Oh, you want the code

No I don't. You want.


NW27 View Post
Back to you ArshT that is always right, yet unable to prove anything himself.

I never said I'm an expert. You seem to think you are although you are just an "expert". There is one thing you are a true expert in. That is in the field of misinformation. You want code? Ok just this time. And to avoid misinformtion by an "expert" like me I just add a pictured copy and paste of a reply of expert Tomasz Janezcko himself.

 
(login for full post details)
  #58 (permalink)
 ArshT 
London England
 
 
Posts: 16 since Feb 2012

Big mike does not seem to like larger pics. Or it's my ad blocker. No matter what I can't see the uploaded pic in my last post so I just uploaded to a extern pic loader that actually works. https://img220.imageshack.us/img220/5787/codeforimpatientpeople.png

 
(login for full post details)
  #59 (permalink)
 ArshT 
London England
 
 
Posts: 16 since Feb 2012


TonyB View Post
NW27, it's nice that you have experience with both, and I'm sure other platforms. You are in a better position to ask such questions than someone like myself...

If indeed some of the things you point-out are short-comings in AB, at least in relation to MC, might it simply be due to AB not being initially focused on futures, like MC? If so, then maybe we can expect improvements in this area, to where things are simplified with check boxes and radial buttons, like you just showed for MC. Or, do you think that there is an inherent flaw in AFL to where such things just cannot be made this simple?

Wrong. He's just ignorant and clueless that's all.

 
(login for full post details)
  #60 (permalink)
 ArshT 
London England
 
 
Posts: 16 since Feb 2012

And another support reply
Quoting 
Hello,

Sure feel free to post. MC is pathetically slow when it comes to portfolio backtesting, from what I know it does not allow rotational trading at all,
the "MarketPosition" variable that this guy was talking about is TS legacy and a source of problems because it is NOT compatible with portfolio backtesting.

With AmiBroker, you can change the sizes of postions based on sizes of OTHER postions on OTHER symbols (see rebalancing example),
with "MarketPosition" being limited to current (one and only one) symbol, it is simply not possible to do.

https://www.amibroker.com/kb/2006/03/06/re-balancing-open-positions/

Bottom line, the "MarketPosition" variable that the MC user is so delighted is a LIMITATION, not a good thing.

As I wrote you, nobody who paid $1500 for software will ever admit that $199 software is better even facing hard facts. People will deny all arguments
just to rationalize their wrong decision.

Best regards,
Tomasz Janeczko
amibroker.com


 
(login for full post details)
  #61 (permalink)
 ArshT 
London England
 
 
Posts: 16 since Feb 2012


TonyB View Post
Mike, thanks for the follow-up. Makes sense as AB doesn't have an emphasis on discretionary trading...

I don't think so. You decide what's your emphasis. And you decide how you wanna design that emphasis. There are examples enough

 
(login for full post details)
  #62 (permalink)
 Big Mike 
Site Administrator
Swing Trader
Data Scientist & DevOps
Manta, Ecuador
 
Experience: Advanced
Platform: Custom solution
Trading: Futures & Crypto
 
Big Mike's Avatar
 
Posts: 50,068 since Jun 2009
Thanks: 32,534 given, 98,483 received

Moderator Notice
Moderator Notice



Mike

We're here to help -- just ask

For the best trading education, watch our webinars
Searching for trading reviews? Review this list

Follow us on Twitter, YouTube, and Facebook

Support our community as an Elite Member:
https://futures.io/elite/

Visit other sites? Please spread the word about your experience with our community!
Follow me on Twitter Visit my futures io Trade Journal
 
(login for full post details)
  #63 (permalink)
 NW27 
Newcastle, Australia
 
Experience: Intermediate
Platform: Multicharts 8 - Full Version
Broker: IB
Trading: SPI,FTSE100, 6E, 6A
 
Posts: 285 since Oct 2010
Thanks: 108 given, 186 received

Hi All,

I wish to apologies for the direction this thread took after I started posting.
I was not trying to start a war between camps, just giving my two cents worth based on my experience with both programs.

I will bow out of this thread and leave it to others.

Again, sorry.

Neil.

The following user says Thank You to NW27 for this post:
 
(login for full post details)
  #64 (permalink)
 Big Mike 
Site Administrator
Swing Trader
Data Scientist & DevOps
Manta, Ecuador
 
Experience: Advanced
Platform: Custom solution
Trading: Futures & Crypto
 
Big Mike's Avatar
 
Posts: 50,068 since Jun 2009
Thanks: 32,534 given, 98,483 received

There is nothing wrong with debate and disagreeing with one another. The reason he was banned was because he was being rude in his posts, name calling, etc. That is simply uncalled for and not tolerated, and has no place here.

Mike

We're here to help -- just ask

For the best trading education, watch our webinars
Searching for trading reviews? Review this list

Follow us on Twitter, YouTube, and Facebook

Support our community as an Elite Member:
https://futures.io/elite/

Visit other sites? Please spread the word about your experience with our community!
Follow me on Twitter Visit my futures io Trade Journal
The following user says Thank You to Big Mike for this post:
 
(login for full post details)
  #65 (permalink)
 TonyB 
Bay Area, CA - US
 
Experience: Beginner
Platform: TOS, TS & MC
Broker: TDA & TS
Trading: Stock, Options and now Futures (ES)
 
TonyB's Avatar
 
Posts: 516 since Dec 2010
Thanks: 227 given, 140 received

I see that I missed a lot. Dang. Truly unfortunate that it came to this... Such a discussion really should be civil and respectful. I suppose if I was fully engaged with a platform, with much time invested into it, I'd have some passion too. But, I'd like to think that I'd conduct myself in a way that was not rude though. Oh well...

After searching on "multicharts amibroker backtesting", I found quite a few discussions on other forums. AmiBroker definitely has quite a few users, and does seem to offer a lot. A platform poll on one forum thought they were the most desirable...

i did find some commentary that was critical though, and if still true (a bit dated), that would be an issue for some... Here's one I found on the MC board:

"Amibroker does not have a true dynamic portfolio like MultiCharts does. Amibroker tests each symbol independently and then by hindsight simply deletes those trades that could not have occurred due to the capital limitations. Their program does not understand that next day there can be capital available to open a position. However, there will be no signal to open this position for it has been deleted. At the same time, a new order hasn’t been generated because the system does not know about the previous day’s deletion.

The result of what Amibroker calls backtesting is nothing more than an advanced batch-testing, which has nothing to do with portfolio trading. Neither does this model have anything to do with the reality."

From here: MultiCharts: Trading Software for Automated Trading and Backtesting &bull; View topic - Portfolio Backtesting Limitation

On a somewhat related note, I went to go download the newest version of MCDT and found that I need to join FB in order to do so? Gosh, I hope not...

 
(login for full post details)
  #66 (permalink)
amibroker
Wroclaw,PL
 
 
Posts: 5 since Feb 2012
Thanks: 0 given, 19 received

I am Tomasz Janeczko, the author of AmiBroker. I spent 17 years of my life writing every single line of code in AmiBroker.

I don't want to enter any debate here because everyone has its own preferences, so it is just up to everyone to test free trials of various softwares and make his/her mind by him/herself.

I came here just for one reason - to correct false statements that were posted in this thread.

@TonyB - I understand that you are Multicharts user and you probably have minimum knowledge about AmiBroker and that is fine.
But making judgements and copying misinformation on AmiBroker posted on MultiCharts own forum sent by MC employee is not the best idea and not fair. Mrs Marina Pashkova (MC employee) post on Multicharts forum is an example of our competitor practice of spreading simply false information. I don't know if they do this just because they don't know Amibroker, or for the purpose of making their software selling better. It is not surprising that they are not happy with our software being more capable than theirs yet 10x less expensive.

So, to the matter, AmiBroker FULLY supports true dynamic portfolio. In fact it was supporting portfolio backtesting YEARS BEFORE Multicharts did. Whats more - Multicharts COPIED some of our portfolio backtester features when we pointed out their limitations. AmiBroker DOES NOT remove any trades in hindsight. And AmiBroker has complete knowledge that next day capital can be available and will open the trade if today it can't because of no funds. This mode in AmiBroker talk is called backtestRegularRaw. See amibroker.com/guide/h_portfolio.html
for more details.

The only excuse for Mrs Marina Pashkova may be that she could have checked AmiBroker back in 2000 (12 years ago). But since 2004 (way before Multicharts existed) AmiBroker has FULL TRUE DYNAMIC PORTFOLIO backtester,
with several backtest modes in many ways superior to MC.
What is superior you may ask? AmiBroker allows you to implement scoring and ranking systems , it allows you to implement your own backtesters (custom backtester), it allows dynamic rebalancing (modifying position on symbol A based on symbol B positions), custom smart optimizers (3 of them coming with AmiBroker as open source), etc, etc.

I have no desire to convince anyone to buy AmiBroker - my software sells great and I am happy and I don't need to prove anything to anyone.

But one thing hurts - when someone (like Mrs Marina Pashkova in the mentioned thread) deliberately lies about your work.
Someone said "If you tell a lie big enough and keep repeating it, people will eventually come to believe it". It is sad that nowadays no-one checks the facts.

It is simply not fair.


Thanks for listening.

Tomasz Janeczko
amibroker.com

The following 8 users say Thank You to amibroker for this post:
 
(login for full post details)
  #67 (permalink)
 TonyB 
Bay Area, CA - US
 
Experience: Beginner
Platform: TOS, TS & MC
Broker: TDA & TS
Trading: Stock, Options and now Futures (ES)
 
TonyB's Avatar
 
Posts: 516 since Dec 2010
Thanks: 227 given, 140 received

Tomasz, welcome to the forum. I noticed a few minutes ago that "amibroker" was viewing this thread was hoping you would post. Thank you for doing so.

First, I'm sorry if you feel what I posted was inappropriate. Clearly (I hope to most, at least), it was not my intent to supply misinformation. I am a guy simply doing his best to learn all that I can about trading platforms, and these two are now receiving most of my interest... I'd like to know the pros and cons of these systems, and I value the input of others who have more experience than me in both back-testing and trading, as well as these programs in particular. Basically, people who are best able or equipped to ask the right questions and understand what is being said. An internet search found that information from the MC board and while I would have gladly replied to that discussion, I'm unable to do so as it is for MC subscribers only. I have just the free version (MCDT). So, I posted it here for feedback and hopefully to spur some constructive discussion... I hope you can appreciate my position.

With 17 years invested into AB, I truly understand your position. This is your baby and you are proud of it. From what little I've experienced and read thus far, you should be. If you haven't already done so, you might want to consider contacting that poster (Marina)...

From all that I have learned and experienced, the capability, speed, repeatability (back-test results) and price of AB, make it a legitimate contender. The two things that are holding me back at the moment are the limited broker relationships and the uncertainty of the AFL learning curve's steepness.

Toward that end, member NW27 has several posts in this thread of interest. I realize that you might have better things to do, but to have those factually addressed would be fantastic.

Tomasz, thanks again.

 
(login for full post details)
  #68 (permalink)
amibroker
Wroclaw,PL
 
 
Posts: 5 since Feb 2012
Thanks: 0 given, 19 received


NW27 View Post
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.
[...]
What is the AFL System code for AB to do this style of thing ???

Neil.

AmiBroker code for that (that is one of many possible implementations) is:

 
Code
Buy = BuySetup; 
Sell = 0; // sell is via stops
SetPositionSize( 3, spsShares ); // 3 contracts entry
ApplyStop( stopTypeLoss, stopModePoint, BuyPrice - Ref( Low, -1 ), 0 ); 
SetCustomBacktestProc("");
if( Status("action") == actionPortfolio )
{
   bo = GetBacktesterObject();
  
   bo.PreProcess(); // Initialize backtester
  
   for( bar=0; bar < BarCount; bar++)
   {
    bo.ProcessTradeSignals( bar );
  
    for( pos = bo.GetFirstOpenPos(); pos; pos = bo.GetNextOpenPos() )
    {
      Contracts = pos.Shares;
      Closeprice = pos.GetPrice( bar, "C" );

      if( Contracts == 3 AND Closeprice > pos.EntryPrice + 5 )
           bo.ScaleTrade( bar, pos.Symbol, False, Closeprice, Closeprice ); 

      if( Contracts >=2 AND Closeprice > pos.EntryPrice + 10 )
           bo.ScaleTrade( bar, pos.Symbol, False, Closeprice, 2 * Closeprice ); 
     }
    }
   bo.PostProcess(); // Finalize backtester
}
AmiBroker portfolio backtester maintains the LIST of positions (not just one variable as TS/MC), as it can open multiple positions on multiple symbols and tracks all of them. The list of open positions is accessible from the formula level via GetFirstOpenPos/GetNextOpenPos as shown in the code above. This way you get the access to the Trade object that has IsLong/IsShort methods to detect whenever you are currently long or short on given position, you can query current position value, size (number of shares/contracts), you can scale positions up/down and do everything imaginable.
AmiBroker backtester interface is object oriented and what may initially look as a little more complex stuff to write gives you infinite flexibility at the end of the day. The problem with Tradestation/MC Easylanguage is that it is "easy" only at the beginning, at some point you hit the wall of either something being not realizable or running way too slow to be usable or simply blowing up entire app because you run out of resources. Try running backtest on whole universe of US markets (8000+ symbols) or do some advanced sorting/ranking/rebalancing systems and then you will know what I am talking about. But of course there are many traders out there and different trading methodologies. For traders who trade 1 or 2 instruments only and some simple strategies Easylanguage may look good. AmiBroker serves different purpose - it is mainly advanced system development platform for quantitative system traders.

If you have any future questions/comments please contact our technical support : support at amibroker dot com because quite frankly I am very busy and I don't have time to spend on forums as I would rather spend free time with my family or improving the software that I use by myself for trading and system design.

Thank you for listening and happy trading.

Tomasz Janeczko
amibroker.com

The following 5 users say Thank You to amibroker for this post:
 
(login for full post details)
  #69 (permalink)
 MultiCharts 
Columbus, Ohio, US
 
Experience: Intermediate
Platform: MultiCharts
Broker: Multiple/Multiple
Trading: ES, EUR/USD
 
MultiCharts's Avatar
 
Posts: 168 since Oct 2010
Thanks: 74 given, 171 received

Tomasz,

I think time has come for you and I to answer users’ questions and provide information from primary sources, so that there are no myths floating about. To calm the emotions a little bit, I’d like to begin by saying that our statements several years ago were made with intention of presenting objective information, although we did allow inaccuracies and that must be admitted. I don’t know where the accusation comes from that Marina was trying to “deliberately” state false information; that is hearsay since it’s just your conjecture without any proof.

We simply took a demo of your program, got backtesting results, and published them. Later we found out that Amibroker can be used correctly only after reading the help from A to Z. We apologize for that. In the past we made two statements regarding the backtesting speed, and capabilities of portfolio backtesting. Our test results are objective and can be recreated. Another question is that we did not expect for your program to behave drastically differently after changing some obscure parameters that are not obvious to a new user.

In the first instance, we used your backtester and it was slower than MultiCharts. You explained it by saying that portfolio backtesting is by definition slower than individual backtesting, which we were not aware of. In MultiCharts the individual and portfolio backtesting work with essentially the same speed, so we didn’t know that a good program could work like you described. We are ready to conduct new objective speed tests with you to show users that, with all other things equal, the speed of our programs is comparable. I am not sure who will have the slightly better numbers, but it’s obvious that the difference will not be drastic.

Regarding portfolio backtesting. Marina based her thought process on standard working procedures, where you do two sets of calculations and then filter out trades. In this case, her statements are correct in saying that portfolio logic did not enter into the trade creation process, and only filtered out redundant ones. One result of using such logic is the increased speed, which can be seen in the link you published.

To obtain correct calculations, it’s necessary to use Raw2 method, as you mention in your article:

“In Raw2 modes all exit signals (even redundant ones) are passed to second phase of backtest just in case that you want implement strategy that skips first exit. Lets suppose that you want to exit on some condition from first phase but only in certain hours or after certain numbers of bars in trade or only when portfolio equity condition is met. Now you can do that in Raw2 modes. Note that Raw2 modes can get significantly slower when you are using custom backtester code that iterates thru signals as there can be zillions of exit signals in the lists even for symbols that never generated any entry signals, therefore it is advised to use it only when absolutely necessary. Raw2 modes are also the most memory consuming. Note also that if you run the system WITHOUT custom backtest procedure there should be no difference between Raw and Raw2 modes (other than speed & memory usage) as first matching exit signal is what is used by default.”

You also need to use custom backtesting interface that’s described here:
https://www.blueowlpress.com/Documents/amibroker-custom-backtester-interface.pdf

This interface is there for a reason. It essentially provides low-level control over the way backtesting works, forcing the programmer to do the work that the backtester should be doing. That means that all other calculation methods except for “custom” are actually batch testing with the second stage of calculations. This is what Marina discovered.
We apologize. We did not know that to test a simple strategy a trader (not a programmer) must spend such considerable time and effort.

Regarding MultiCharts’ Portfolio Backtester – it’s simple and easy to use. We only have one calculation method, which works just like real life. More info here - Understanding Portfolio Backtesting - MultiCharts

It goes from bar to bar into the future and never goes back, which is exactly what happens in real life. If we copied anything from AB, we would also have 6 confusing calculation methods like you describe: Portfolio-level back testing

Regarding comparative speed tests under identical conditions – let’s do it. I think your program will be slightly faster under the same conditions, but that difference will be negligible. The difference in speed is due to the fact that we have to maintain EasyLanguage compatibility. In your case, you are free to do what you want, so you can achieve better optimization. IN any case, with genetic optimization available, this issue is not important – the main goals are ease of use and convenience. In MultiCharts you don’t need to read the entire help file before you can begin working. That has always been our guiding principle when building our program.

MultiCharts - Raising the Trading Standard.
Please send me a private message if you have any further questions about MultiCharts
Follow me on Twitter
The following 2 users say Thank You to MultiCharts for this post:
 
(login for full post details)
  #70 (permalink)
amibroker
Wroclaw,PL
 
 
Posts: 5 since Feb 2012
Thanks: 0 given, 19 received

Oh yes, I heard that old "complexity" song already. One of your favorite and perfect excuse for ignorance. Sorry, but you are wrong again. Raw2 mode is not required. Custom backtester is also not required for realistic backtesting. The features are there because our users have different needs (usually very complex and diverging needs) and the only platform that allows implementing their ideas is AB. Raw2 in fact was added on request of *single person* (a friend of mine) for his quant research.
Realistic true portfolio level backtesting in AmiBroker is as simple as pressing Backtest button. No extra code, no extra settings. While speaking about complexity - our formulas are in majority of cases way shorter than on any other platform. Want a proof? Check the Traders' Tips section at Stocks and Commodities. AmiBroker formulas for articles are almost always the shortest.

The problem is that you do not know AmiBroker and its capabilities yet you feel free to spread information that is simply incorrect. I would appreciate if you stop. It would be better for you and me. For me simply because I have no time to waste correcting all of that. For you, because you want to be regarded as pro.

I follow live and let live approach. I have nothing against your software. Let customers download and try the software and decide by themselves.
Why don't you just let it go and accept the fact that not everyone is the same and no single platform is everybody's choice.

I am single person writing the software for myself. I decided to sell it because people asked me to make it available because they could not find anything comparable anywhere. So I did.

I don't even compete with you. I am too old and got one life to live and don't have time for your little games.

So would you please get off my back. Feel free to sing songs how MC is the next best thing since sliced bread but refrain from commenting about things you have no idea about, as with dozens of staff you have, by myself I have very little chance catching up correcting all the stuff you post here and there. Thank you.

This is over and out from me.
Remember: live and let live.

Best regards,
Tomasz Janeczko
amibroker.com

The following 6 users say Thank You to amibroker for this post:
 
(login for full post details)
  #71 (permalink)
 MultiCharts 
Columbus, Ohio, US
 
Experience: Intermediate
Platform: MultiCharts
Broker: Multiple/Multiple
Trading: ES, EUR/USD
 
MultiCharts's Avatar
 
Posts: 168 since Oct 2010
Thanks: 74 given, 171 received

Tomasz,

As @TonyB mentioned users “welcome the debate / discussion, so long as it's based upon facts and not mis-information.” That’s what we are trying to do – have a discussion with you that’s based on facts and objective information, so users get a clear picture of pros and cons of different software.

Instead, what we are hearing from you is blatant name-calling, and no constructive dialog. In a support reply posted by ArshT and signed by you, you called MC “pathetically slow when it comes to portfolio backtesting”, which is just not true. I want to reiterate that – let’s do objective tests together (or perhaps by a respected independent third-party on the forum, such as @sam028) and compare. To summarize – we are proposing objective information so no myths are created, while you say “feel free to sing songs how MC is the next best thing since sliced bread”

We are open to dialog and conversation. We ask that you behave in a respectful and courteous manner like the rest of the members on this forum, otherwise it’s very difficult to talk to you through the offensive language. If you don’t want to talk, then we will continue stating what we believe to be the correct information. If you want to ensure accuracy of what we say, please provide accurate information as per our requests.

In an excerpt in the post from YOUR help file, it says that you NEED to use Raw2 in order to do Dynamic portofolio backtesting, and not just batch testing. Yet in the latest post, you say that’s not necessary. Either your Help file is incorrect, or your latest post.

OUR QUESTION – how to we set up a true portfolio backtest in AmiBroker? Provide exact details.

We don’t regard Amibroker as a direct competitor of MultiCharts, it’s a product in a different niche in terms of potential users, product capabilities and price points. We have nothing against AmiBroker, and it has never been our intention to discredit.

A note on time savings - it seems to be a popular assertion of quality that AB is faster than MC. Speed is meaningless if you don’t know what to do, and the learning curve is much steeper in AB than MC. The time spent learning to do what you want often exceeds the time you later save when doing the calculations. More importantly, the calculations need to be accurate and reliable, and easily accessible to the user.

If you are “too old and got one life to live and don't have time for your little games”, then we can simply close this matter, because what else is there to talk about? If you, on the other hand, want us to provide accurate information about possibilities of AB, then provide us with accurate information, and let’s do some tests together.


P.S. I have a tingling suspicion that ArshT and Amibroker accounts are written by the same person, based on my linguistic perception of the logical flow arguments, sentence structure and phraseology used. This is not an accusation of any sort, just a hunch

MultiCharts - Raising the Trading Standard.
Please send me a private message if you have any further questions about MultiCharts
Follow me on Twitter
 
(login for full post details)
  #72 (permalink)
 MultiCharts 
Columbus, Ohio, US
 
Experience: Intermediate
Platform: MultiCharts
Broker: Multiple/Multiple
Trading: ES, EUR/USD
 
MultiCharts's Avatar
 
Posts: 168 since Oct 2010
Thanks: 74 given, 171 received


ConqueringLies View Post
So analogously to become a professional doctor instead of first studying carefully to know what's the best to do it's better to just do something although not knowing exactly what one is doing at all? If that is the logic behind the software why don't you rather tell then that your software is more of a playing field for kids instead of real traders? Because that's what's my personal impression of it. BTW the speed differences you were highlightning are not negligibly at all. In fact percentage wise they are immense.

I would also like to call into question the credibility of this poster, coincidentally named ConqueringLies. First, arguments presented here don't have any sort of factual basis and do not present any objective information; they are rather an emotional soup of metaphors with little to no value.

Second, what credibility does this poster have, if the join date is today, and the only two posts are located in this thread? If the person is a regular reader, why haven't they joined earlier? If this person is not a regular reader, how would he know this thread existed?

Third, why does this person begin the very first post on the forum by saying "I'm not Tomasz"? Seems like a strange introduction. And why the poignant account name - ConqueringLies...?

Just voicing my reasons for doubting the information coming from this poster, based on lack of credible history and no factual basis to presented arguments.

MultiCharts - Raising the Trading Standard.
Please send me a private message if you have any further questions about MultiCharts
Follow me on Twitter
 
(login for full post details)
  #73 (permalink)
 MultiCharts 
Columbus, Ohio, US
 
Experience: Intermediate
Platform: MultiCharts
Broker: Multiple/Multiple
Trading: ES, EUR/USD
 
MultiCharts's Avatar
 
Posts: 168 since Oct 2010
Thanks: 74 given, 171 received

I don't know what to say. I don't speak irrational. In response to our valid requests, this is what comes back . I guess there is nothing more to discuss.

In conclusion, there seems to be no constructive dialog possible to further our understanding of AmiBroker, or to conduct tests together. We would like to, but no one is offering any information. So, we will continue sharing information that we believe to be true to the best of knowledge, hoping that one one day someone may correct our inaccuracies should we accidentally allow some.

Maybe other AmiBroker users can chime in and provide relevant information, as opposed to comparing me to Sherlock?

@BigMike - are you moderating this thread? It seems to have gone a little... off course.

MultiCharts - Raising the Trading Standard.
Please send me a private message if you have any further questions about MultiCharts
Follow me on Twitter
 
(login for full post details)
  #74 (permalink)
 TonyB 
Bay Area, CA - US
 
Experience: Beginner
Platform: TOS, TS & MC
Broker: TDA & TS
Trading: Stock, Options and now Futures (ES)
 
TonyB's Avatar
 
Posts: 516 since Dec 2010
Thanks: 227 given, 140 received

Having representatives of both AB and MC is ideal here, so long as the time commitment can be made, and of course we remain cordial and on topic. It sounds like for Tomasz, this would not be desirable though. Maybe someone else from his wonderful staff, possibly Marcin? I only mention Marcin because he has been superb in our communications...

All, I have no horse in this race, so to speak. I have both (free and trial) and want as much factual information possible to make a well-informed decision. Clearly, misinformation exists (on the web and apparently here) and for someone such as myself, it's hard to make sense of it all... An objective test would be great, one performed by an uninterested 3rd party, as mentioned earlier.

 
(login for full post details)
  #75 (permalink)
 Big Mike 
Site Administrator
Swing Trader
Data Scientist & DevOps
Manta, Ecuador
 
Experience: Advanced
Platform: Custom solution
Trading: Futures & Crypto
 
Big Mike's Avatar
 
Posts: 50,068 since Jun 2009
Thanks: 32,534 given, 98,483 received

Moderator Notice
Moderator Notice


We're here to help -- just ask

For the best trading education, watch our webinars
Searching for trading reviews? Review this list

Follow us on Twitter, YouTube, and Facebook

Support our community as an Elite Member:
https://futures.io/elite/

Visit other sites? Please spread the word about your experience with our community!
Follow me on Twitter Visit my futures io Trade Journal

Closed Thread

futures io Trading Community Platforms and Indicators > Backtesting and Research: MultiCharts or AmiBroker


Last Updated on February 29, 2012


Upcoming Webinars and Events

NinjaTrader Indicator Challenge!

Ongoing

Journal Challenge w/$1,800 in prizes!

May 7

The Cold Hard Truth: Maybe I Am Not Good Enough w/Chris Gray @ Earn2Trade

Elite only
     



Copyright © 2021 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada), info@futures.io
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