So I made a system a while back for MT4, based on support and resistance. I backtested it and studied it to learn the strenghts and weakness. I've been demo testing it for about 4 months with good results, its not the grail but it trades without causing platform errors and long term produces some gains.
On MTI Live, it was running on Anotherbriandemo, you can see it in the comments of the published statement on the MTI site. It's now running on my real account. I've adjusted the published statement start date of the Anotherbrian MTI Live account to be the same time I started using it. I also use two other trading strategies on this account. ForexMorningTrade and dicretionary trading based on Sam Seiden.
FMT - I use this as more of a scalper with small lot size - this is like a real account test - I didnt back test it. I watch it the day it trades to see if I should close it or not.
Sam Seiden - I usually use a 1 or 4 hour chart for this. This strategy requires patience. In order to help me with that, I found having a robot running kills most of the urge to trade, so I can wait as long as it takes.
So, time will tell.
See the right side bar for performance or visit these links
Demo MTI Account
Live MTI Account
For the longest time I've been breakeven or losing slowly. For the past severla months I've been working on EA's and watching them, and trading myself. I think I found what works for me, as overtrading is a problem. Let's see what happens!! Join the MTI competition for some fun.... it's outlined in the post below.
UPDATE (July3, 2011): The MTI Live website doesn't seem to show things as they really are unless you include ALL history. I haven't figure it out yet (how to correctly show stats from a certain day forward).
The Tipster SR EA is LIVE. It's one of the 3 EA's running on my live account.
Wednesday, June 29, 2011
Tipster SR
Friday, April 29, 2011
Calling All Robots v2
This is a re-post. The first competition had some technical issues with the rules I set up so I stopped it and created another one. Join in!!
If you use MT4 (or MT5) and trade forex I invite you to join this free contest. The winner gets bragging rights.
I use MTi to track my performance of both live and demo account. My demo account is running a robot and MTi allows me to see the trade stats. They recently added a new feature called "Competitions". I've started a new competition and I invite you to participate. It's called "Calling All Robots"
To enter you need MT4, and an account with MTi. It's easy to sign up. Once you've signed up you download this and install, it installs automatically. You disable the FTP feature in MT4 options as this new file will upload all the trades to MTi. It's pretty slick.
The competition is scheduled to run from Fri, 27 May 2011 14:08 GMT to Wed, 1 Jan 2020 16:00 GMT
Basically, forever!
Rules The competition is open to both live and demo accounts.
- All accounts must be in USD.
- The maximum size of any individual order is 5.00 lots. Competitors will be disqualified if they place an order larger than this during the competition.
- The maximum volume traded during the competition is 10.00 lots. Competitors will be disqualified if the total volume on trades during the competition is larger than this.
- Competitors must not make deposits or withdrawals during the competition.
- Performance is measured from the first equity figure published by your trading software after the competition starts to the last equity figure published before the competition ends.
- Competitors must publish from the same broker account throughout the competition.
AnotherBrian is my real account.
AnotherBriandemo runs a robots, or robots, on test. Most robots are of my own making.
I also have started another competition, "Perpetual Trading", its for real accounts only and runs for a long, long time.
Saturday, November 6, 2010
Developing an Auto Trading System
http://www.adaptrade.com/BreakoutFutures/Newsletters/Newsletter0305.htm
If you've embarked on developing a trading system with auto execution, you have no doubt discovered that it's not that easy to find something that offers consistent profits. You have all kinds of idea but not sure how to test them all, thinking it could take forever plus a day to find the right one. Well there is something called Rapid Prototyping that can help you out. There's a great article written about this and some AFL to go along with it. Here's the info and links to get you started.
Article with a great explanation
Original AFL - You may have to fix line breaks to make this code work
// Rapid Prototyping Method for Trading System Development
// Idea from "The Breakout Bulletin March 2005" by Mike Bryant
// AFL coding by mmike
SetTradeDelays(1,1,1,1);
Cond1 = C-Ref(C,-1);
Cond2 = C-Ref(C,-2);
Cond3 = C-Ref(C,-5);
Cond4 = C-Ref(C,-10);
Cond5 = C-MA(C,5);
Cond6 = C-MA(C,25);
Cond7 = C-MA(C,45);
w1 = Optimize("w1",1,-1,1,1);
w2 = Optimize("w2",-1,-1,1,1);
w3 = Optimize("w3",-1,-1,1,1);
w4 = Optimize("w4",1,-1,1,1);
w5 = Optimize("w5",0,-1,1,1);
w6 = Optimize("w6",0,-1,1,1);
w7 = Optimize("w7",0,-1,1,1);
Buy = w1*Cond1>=0 AND w2*Cond2>=0 AND w3*Cond3>=0 AND w4*Cond4>=0 AND
w5*Cond5>=0 AND w6*Cond6>=0 AND w7*Cond7>=0;
Sell = w1*Cond1<=0 AND w2*Cond2<=0 AND w3*Cond3<=0 AND w4*Cond4<=0 AND
w5*Cond5<=0 AND w6*Cond6<=0 AND w7*Cond7<=0;
Short = Sell;
Cover = Buy;
AFL Code modified by me trying out a TTM system
// Rapid Prototyping Method for Trading System Development
// Idea from "The Breakout Bulletin March 2005" by Mike Bryant
// AFL coding by mmike
SetTradeDelays(1,1,1,1);
Plot( C, "Close", colorBlue, styleNoTitle
styleBar
styleThick );
/* Original test system
Cond1 = C-Ref(C,-1);
Cond2 = C-Ref(C,-2);
Cond3 = C-Ref(C,-5);
Cond4 = C-Ref(C,-10);
Cond5 = C-MA(C,5);
Cond6 = C-MA(C,25);
Cond7 = C-MA(C,45);
*/
// TTM and MA
HaClose = (O+H+L+C)/4;
HaOpen = AMA( Ref( HaClose, -1 ), 0.5 );
HaHigh = Max( H, Max( HaClose, HaOpen ) );
HaLow = Min( L, Min( HaClose, HaOpen ) );
barcolor = IIf(HaClose >= HaOpen, colorBlue, colorRed);
//Plot( C, "Close", BarColor , styleNoTitle
styleBar
styleThick);
TTM = IIf(HaClose >= HaOpen, 1, 0);
Cond1 = TTM;
Cond2 = Ref(TTM,-2);
Cond3 = Ref(TTM,-3);
Cond4 = Ref(TTM,-4);
Cond5 = C>MA(C,5);
Cond6 = C>MA(C,50);
Cond7 = C>MA(C,200);
w1 = Optimize("w1",1,-1,1,1);
w2 = Optimize("w2",-1,-1,1,1);
w3 = Optimize("w3",-1,-1,1,1);
w4 = Optimize("w4",1,-1,1,1);
w5 = Optimize("w5",0,-1,1,1);
w6 = Optimize("w6",0,-1,1,1);
w7 = Optimize("w7",0,-1,1,1);
w1 = -1;
w2 = -1;
w3 = 0;
w4 = -1;
w5 = 1;
w6 = -1;
w7 = -1;
Buy = w1*Cond1>=0 AND w2*Cond2>=0 AND w3*Cond3>=0 AND w4*Cond4>=0 AND
w5*Cond5>=0 AND w6*Cond6>=0 AND w7*Cond7>=0;
Sell = w1*Cond1<=0 AND w2*Cond2<=0 AND w3*Cond3<=0 AND w4*Cond4<=0 AND
w5*Cond5<=0 AND w6*Cond6<=0 AND w7*Cond7<=0;
Short = Sell;
Cover = Buy;
Wednesday, January 13, 2010
Playback to Bracket Trader
There are two ways to backtest that I know of using Amibroker;
Use the backtester
use the playback feature
Backtester - This requires some coding, coding that isn't required when trading live with Amibroker, Bracket Trader, and TWS. You have to watch out for a whole basket of different issues that can creep into the test. It remains a valuable tool.
Playback simulation - This is a great tool for practicing discretionary trading. It's also a great tool for testing your Bracket trader (BT) interface / system. If it would just work! I searched high and low and the net for some information on how to do this, or code that I could simply drop into Ami that would "make it happen". The good news is that I've finally got it to work, and surprisingly it wasn't to difficult to code, but getting the bug out was an issue.
Ive used it to test several days of 1 minute HSI system with BT to get the stats from it. The last thing I just completed tonight was exiting positions near the close. Still a few issues to work out with that. Still, the most difficult part is finding a system that generates a profit, I'm looking for a winning ratio of 40% or better.
Is anyone else using Amibroker playback in this fashion?
I was contemplating doing a video on this and posting the code. Not sure I want to spend the time to do it though.
Wednesday, July 29, 2009
Auto Trading UPDATE
I have been using Bracket Trader lately. Great little program. I also just changed computers and noticed it doesn't run very well. I had to turn off my real time virus scanner. I'll have to figure out what files are running and add them to exceptions for the scanner.
The AFL I'm working on actually combines several systems that can be turn on and off with the params window. The time of day to allow trades can also be adjusted.
I send an email alert to me handheld so I'll be able to log on and check that the stops and targets have been placed, then just let it go. It's running on the TWS simulated account right now, making play $$.
Wednesday, June 17, 2009
Bracket Trader
Bracket Trader (BT) communicate directly with TWS. You can trade right from BT, or have an external app send signals to BT.
I've installed Bracket Trader and tried it with my IB simulated account. So far, so good. I like this set-up because I only have to generate signals and sent them to a text file. BT looks at the text file for orders and executes. BT has some nice features, trailing stops, multiple targets, etc. It's worth looking at. The main reason I like it is I don't have to code the scale out or order management part of the trade.
I'm setting Amibroker up to send LMT orders. If they don't trigger within a few bars then I cancel the order.
Has anyone else played with this application? I would like to hear about your experience. Once I get this working I'll post some AFL code to interface to BT, and I hope you will participate.
Sunday, October 26, 2008
Tipster Trendlines - things to come
The "free" version is no longer available. Go to the Tipster Trendlines 2.1 post for additional information.
Here is a short video showing you what I'm working on next for the Tipster Trendlines code. The code is not yet 100%, when it is, I'll post it. If you have any comments on what is being planned for the next version, leave a comment.
The new version will feature drop down menu's and trigger buttons right on the chart.
Enjoy!
Wednesday, August 20, 2008
Monday, August 18, 2008
Another example of trading with trendlines
I thought I would take the "potential" set-up Brian Shannon spoke of in his video today to show the "Trading with Trendlines" code I have written for Amibroker, interfaced with Interactive Brokers TWS platform. Both the set-up video by Alphatrends and my own video are below.
Alphatrends
Trading with Trendlines
Friday, August 8, 2008
Trading with Amibroker
Update can be found here:
http://blog.tipster.ca/p/tipster-trendlines-3.html
Thursday, July 3, 2008
How's your autotrading system? - Response
Post 1
When you cut your losses and let your profits run, it tends to produce about a 35% accuracy (i.e. win rate). The problem seems to be sitting while the losses accumulate. If you're doing lots of trades on one-minute data, maybe it isn't so hard. Does your software run unattended?I have a preference for higher-frequency trading because it seems to produce a smoother equity curve. I am also a bit impatient, and I have difficulty watching my systems lose money. The computer trades better than I do in that regard.I get my ideas from pretty much anywhere, including some unlikely places (e.g. elitetrader.com). My main criteria for choosing an idea to develop is how well it would fit with my needs and lifestyle. I have been at this long enough to know how important that it. I want as smooth an equity curve as I can get, and I want the most reliable system that will generate a minimum return. I reject ideas because they trade too often or not often enough, or because they have drawdowns that are too deep or too long. I also develop trading ideas as a form of -- don't know what to call it -- entertainment, I guess. It's a treasure hunt.I write almost all of my own software using Delphi/Pascal. I like to test everything I do, but I have developed and run system that I cannot test beforehand. Christian Gross also talked about that with regard to algo trading. That can be scarey.[rwk]
Post 2:
This is going to be a very long-winded response, but I think itmight be helpful. So, before I even get into how I come up withtrading strategies, I think it will be helpful to give a little bit ofmy painful history, just for context.....Let me start by saying that I'm (by trade) a full-time softwareengineer and have been for about 18 years. I've tried to trade/investfor about 10 years with very little long-term success. If I wouldhave kept my money under a mattress for the majority of those years,I'd be better off today. But, I don't think I'd be better off 10years from now.....All of my trading endeavors/techniques were based on more-or-lesssubjective opinions and the latest book from Borders or Barnes andNoble. So, after trying to trade/invest half-heartedly for severalyears and then loosing my $#*&^*&@&# about 5 years ago, I took a breakfor about 1 year and then started treating investing/trading moreseriously. I read many books (all of which I'm sure you've heard of)and really just took the time to understand the let some of the basicssink in (namely-RISK MANAGEMENT). After I learned how to properlydeal with risk management and position sizing, I still tried to trade(by hand) and mostly broke even (or lost a little money).So, about 2 years ago, I think I finally got serious enough aboutnot loosing money that I decided to try to "objectify" a few tradingstyles (based on one or two recurring intra-day market patterns that Ihad my eye on). My stategy ideas were a result (I think) of my ownfailures, reading books, reading blogs and understanding what I likedand didn't like (I like speed). By the way, none of the books that Iever read from any bookstore have helped me with trading techniques. To be honest, I have found them all 100% useless. Now, with thatsaid, I have read some very good trading books, but they were onpsychology.I started doing this (by hand) in my IB SIMULATION tradingaccount. By the way, the decision to finally "objectify" my tradingtechnique was as a result of reading "Trading in the Zone" (by MarkDouglas). If I would have read this book early on in my "halfhearted" trading career, I probably would have stopped reading halfway through as it would have been boring to me. But, after being aperpetual looser and beating my head against the wall for so manyyears, I think I became a better listener. I guess I was at a pointwhere much of what the author had to say actually mattered to me andmade sense.As I embarked on trying to objectify my trading style, I quicklyrealized that putting numbers & reasons to everything I did was adaunting task and there wasn't a chance in hell that I could do it byhand. Hence, why I started to consider automating my tradingtechnique. This process was a HUGE "eye opener" for me as I quicklystarted realizing just how darned hard it was to objectify ABSOLUTLEYEVERYTHING that I did (including setup determination, individualposition/stop management, entire portfolio management, etc, etc, etc).I also had to work around all of IB's crappy API and market datalimitations. Everyone on this forum knows what I'm talking aboutthere......It also quickly became apparent that my trading methodologystill sucked. In fact, I completely changed my trading methodologyabout 3 times over the course of the last 2 years, until finallysettling in on something that seemed to work. It was in writing,tweaking and simulation trading my system that enabled me to finallyhone in on a successful methodology. I kept tweaking and working overthe course several months with my Simulation Account until I startedto see a positive expectancy emerge.Once I started seeing positive expectancy for a for months, Istarted trading with real money (only $27,000---very near the $25,000pattern day trading limit). Not much to my surprise, I saw myexpectancy drop when I went to real money, but it still remainedpositive. Moving from a simulation account to a real money account isjust a different beast--all together. Strangely enough, the thingthat has hurt me the most has been psychology (and commissions). Slippage hasn't really hurt me very much moving to a real moneyaccount (at least not yet at this small account level). Commissionshas hurt me, because I simulation traded with a $100,000 account andas such, the commissions were less of a percentage hit per trade. Many of my trades are "odd lot" trades below 100 shares.As far as psychology is concerned, I find myself thinking that Iknow better at various parts of the day and I prematurely close outpositions. I've also had several instances where I've introduced a"money loosing" bug the night before or have changed stuff thatadversely affects my expectancy and I don't find out what it was untila week or so later. I now document (in a journal) every single changethat I make to my system and I back up my code base every night, incase I need to revert. I also document how the system did that dayand various problems or fixes that I need to work on in the near future.My system trades only stocks and I've been running it now (withreal money) for only 3 months. It's placed 1,330 trades (822 long and508 short). It's going to make IB rich with commissions. I've paidthem $2,938.93 in three months and I've only made $3,165 (11.7% inthree months) and my overall expectancy is only .08. Because I'm aday-trader and I sometimes can carry up to 40 positions on a givenday, my risk size is very, very small. I keep it to a max of .135% ofequity on every trade (or approximately $40 bucks per trade rightnow). I'm a bit bummed about my expectancy, but I've tweaked andhoned just about everything during these 3 months and as such, Ibelieve things are going much better now than they did in the beginning.As far as back-testing, I don't actually have a piece of softwarethat backtests my strategy yet. I've written back test software forprevious END-OF-DAY strategies, but not for my current intra-daystrategy. I'm actually collecting all of the data that I need tobacktest. It's just a matter of finishing my backtesting software. Just collecting the darned data was a pain in the rear, because mysystem uses 5 second bars and tick data to make its decisions and itmay look at anywhere from 500 to 1,000 stocks per day. So, justwriting decent software to collect and store this volume of data was abeast. I only collect 5 second bars on TRADES, BIDs and ASKs. Idon't actually grab the tick data from anywhere like opentick.com forbacktesting.As far as a suitable result, I'm not really sure. Perhapssomeone else can chime in on this. I think 11.7% in three months (inthis shitty stock market and with this small account size) is prettydarned good. Going forward, I think I'll do much better than this,now that I've perfected just about everything that I can perfect. Ican't wait for a nice bull market, as my system seems to do betterwhen the market mood is positive and not negative. I also plan ondumping more money into this after another 3 months of positiveresults and once I break through my previous equity high of +17%. Jason
Post 3
I dream of indicators, non-standard correlation, and edge detection.I love indicators.Take the CCI, smooth it with an SMA and then take a KAMA of that. Whenthis KAMA pivots (reverses) beyond a CCI threshold of 30-50, look forprice confirmation (shorter time frame [15 min] price reversal), thenenter three positions, 1 at market, 1 at limit +- 10% of 5 period ATRand 1 at limit +- 20% 5 period ATR. If you don't get hit on the limitswithin 3 periods, close them. Close positions scaled out after certain%'s. Leave one in until a trailing stop knocks it out. Run this on 45minute data, and 90 minute data.To me it's indicators that drive strategy development. If I canenvision new indicators, or recombinant indicators, like thatdescribed above, I can build up a version of the strategy and see howthe price action and indicator action play out. If it looks promisingI keep it around as a potential rule. I've got dozens and dozens ofthem, all dreamed up and waiting for me to code them up.But as rwk mentioned - I dream and build them mostly forentertainment; confirmation that I can see a market pattern and buildan indicator to trap it.Backtesting strategies is first and foremost for me. It's how I canconfirm an indicator is doing its job. I trade FX only and data is nota problem, unless I want 10 years of 5 minute data...Matching strategies/indicators up with instruments is important I'vefound. A curr pair that doesn't behave well with strategy A may workjust fine in strategy B. EURCAD/USDCAD for some reason - just don't dowell for me. Just like metals and softs don't behave in a similar wayto make you think you could trade them with the same strategy. Sostrategy/indicator : instrument pairing is one way I like tocustomize.Non-standard correlation is something I came up with that allows me tocompare say gold with a home built AUD index. Or lumber and copper andthe home builders. Dump them all into a single chart and see if youcan get leading/trailing correlation events out of them. Of course thetrouble is decoupling price so that they can all fit in the samechart...Then there's edge detection. This is a popular concept but one youshould test for. It allows you to separate your entries from yourexits and position and risk management. Testing for strategy edgeallows you to understand that your personal trading edge may notstrategy based but perhaps money mgmt based or risk aversion based. Doyou make money because your strategy picks excellent entries? Orbecause you've got a great exit technique? For instance you could waitfor a certain volatility level to be reached and then you could entera spread position (long AND short). Use a chandelier exit for both.One will get closed out pretty quick but the other will tend to run awhile - hopefully long enough to clear your commish and make you some$. It's all in your exit. But you should know what type edge you haveso you don't screw it up and try switching it or changing it.To me the shear breadth of potential with regards to all the marketsand trade lengths and trading styles and just so much data to be mined- all of this boils down to endless possibilities, of which I spendmost nights dreaming about. Yeah, I know, I'm an odd duck. MM
Thursday, June 12, 2008
How's your autotrading system?
Here are the questions
1. Is your system fully automated or partially automated
2. If fully automated, how often do you check on your system?
3. If partially automated, what component is partially automated?
4. How many different strategies are in use at any one time
5. How long have you been auto trading for?
6. In your opinion, is your system complicated or based on simple techniques?
9. Is your system(s) consistently profitable?
10. A few brief words on the strategies utilized (without giving away any secrets of course)
11. Other than actual buy/sell signals and formulating a winning system, what were two of the toughest problems you faced while trying to implement auto trading?
If your interested in participating, email me your comments, my contact information is at the top of the blog under "What this Blog is all about". Alternatively, you could just as easily post a comment.
Monday, October 15, 2007
Caution taken while Auto Trading
One of the first things that I considered while formulating the basis for my automatic trading platform was risk. How would I place an order and not have to worry about my Internet connection or computer causing problems. I figured that I would let TWS do the risk management.
Using bracket order, I can send my orders to TWS and then on to IB's system. While my "system" is running here at home, the bracket order is continuously updated to move the stops and profit target. I don't really like trailing stops, so I don''t use them... for now. The worse that can happen under this scenario is that I get taken out of a trade. The second worst is that my profit target gets hit while price is moving up and the target has not been adjusted upwards.
I haven't been able to go a full day yet without some sort of bug or problem with the code, so I think this approach has paid off. It's only a paper trading account for now, but one day, I hope to have the auto trading working allot better.
Please participate n my poll on the left side of the blog page.