Sunday, December 19, 2010

Tipster Trendlines for MT4

I use Amibroker and IB to trade, I place trades right off the charts.  Over the years I've developed AFL code (that's Amibroker language) to allow me to trade off the charts. Now that I'm also using MT4 for some of my trading, I was looking for something similar but haven't found it. So I've begun to code my own. Here are some of the EA's I've considered using on the MT4 platform, but just don't suit me;
  • TrendMeLeaveMe (TMLM)
  • iDRAW
  • Graphic Expert Advisor: AutoGraf
  • EASY
The AFL code for Tipster Trendlines is for sale up at the top right of the blog.  The code for MT4 is free.
 
Here is an overview of the Expert Advisor (EA) called Tipster Trendlines;

  • The EA draws the lines automatically, place the 3 lines for the trade, press F7, select Order type, set Live to true.  Review other options for EA and close the EA Properties. Adjust lines as required, EA will update prices.   
  • When trade is closed, EA locks out. Press F7 and reset, then delete all objects or one of the trendlines.
  • Turn EA OFF before closing a trade or deleteing an order manually.
  • When order is closed by the EA, a screenshot is saved in experts/files"
  • Set up email in the MT4 Options, to receive updates of EA actions 
  • When an order is placed or live trade, it doesnt matter what Ordertype is set to in EA properties 
  • OK to use for multiple charts. To trade same symbol on two charts, use different MagicNumbers.
Here's an overview video



Go here for latest post

Saturday, November 6, 2010

Developing an Auto Trading System

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, September 15, 2010

BOJ Intervention

What happens when a countries bank intervenes on the currency market? This happens...


107 pips in 10 minutes USDJPY
218 pips in 3 hours USDJPY

USDJPY 1 Minute Chart

I was lucky on this one, real lucky. I had an order in on two different pairs and got in right at the bottom of the move.


For this trade, I waited for price to breakout of the down sloping trendline, then placed an order to buy when it returned to the same line. The little arrows on the chart is the pending buy limit order changing with each new bar. Timing is everything? I think it was just luck this time.



This trade was planned days before the event. I watched price approach the trendline and thought about cancelling the order as a move this fast was sure to run out of energy. I quickly looked at the forex calendar for news releases and there was none. Then I checked headlines, BOJ intervention confirmed. I left it to enter and was rewarded.

The red lines on the chart are my stops that were moved up to trail price action. I had to call it a night so I moved it closer. Nice!.

Final result:
EURJPY 229 pips captured
USDJPY 66 pips captured

It doesn't really matter WHY at the moment, trade what you see. This morning I found out WHY. BOJ stuffed 17 billion into the currency market, and really the only currency that moved were the JPY crosses.

Did anyone else make any pips? Let's hear your story.

Friday, August 27, 2010

Tipster Trendlines for MT4

I've written Tipster Trendlines for MT4 that attempts to model the original version for Amibroker. MT4 doesn't allow many of the features I've implemented in Amibroker but it's a lot less coding too, so that offsets the pain of coding. For example, it is very difficult to place buttons on the chart, so I tried using hot keys, and that didn't work.


I had a hot key to re-draw the lines and enable the lines for trading but that impacted every open chart. So I've adapted a different approach. You can follow my progress on Forex Factory forum, and here.

Some different features are available though;
Close of trade triggers a screenshot and saves it to your hard disk.
Sloping trendlines can be used, the prices are updated with each new bar. This means you can trade breakouts of sloped lines, or touches (stop and limit orders).

If you know how to program MT4, I welcome your comments here or on the forum.


... and I've been using Tipster Trendlines for MT4, the results of my trades are shown on the right side of the blog.

USDJPY

In the coming weeks I'm going to be following the forex pair USDJPY from a purely technical perspective. It has been said that the government may step in to balance the currency as it approaches the low it set in April 1995. Below is the chart I've marked up with trendlines and the 1995 support zone.


I will be trading two different timeframes, the daily (with the weekly as reference) and the 4 hour. The four hour will attempt to capture small moves. The daily, I'll be looking to enter in the blue zone on a retracement. I'll be using my IB account for the longer term trades and MT4 with my forex broker for the smaller moves.

Saturday, August 14, 2010

Tipster Trendlines FAQ

Just in case you weren't aware, there is a FAQ on Tipster Trendlines.

Here's the link

Tipster Trendlines FAQ

Sunday, June 27, 2010

Metatrader Forex Data and back testing

I finally found a source for free forex data that is complete, and FREE!

Here is the link to the file - Metatrader Free Forex Data

And the recommended set-up to back test your EA on MT4, follow this link

Set up for back test

There are other helpfull articles on that website also. I took a look at the two systems they are offering for sale and they don't fit my style. I like smooth equity curves. One of the systems has a 30% win rate, I like small gains with high win rates.

Tuesday, April 27, 2010

Tipster Trendlines 3a now available

The AFL code that allows you to trade right from the Amibroker chart is


now available.


Click the image below to read about it, watch a video, and order.

I recommend you read the Tipster Trendlines FAQ before your order.

Friday, April 2, 2010

Tipster Trendlines 3

The new version will be available soon. Click the image to read about all the new features. You can place your order today and I'll send the code to you on the release date.

Sunday, March 28, 2010

EUR USD TRADE

Last week I caught a big move and rode it for a nice profit. It was the breakdown of EURUSD below 1.3450 area (support area on the daily chart and also going back to May 2009). Now its getting back to that area (revisiting, support becomes resistance) and I'm considering shorting again. The only thing that looks odd is the speed at which it has re-visited the area. It doesn't look so odd on smaller time frames. With proper risk management and appropriate stop placement this is worth a go since the reward (profit area) is quite far away when looking at the daily chart, 1.2900 area. Here's the chart... as I see it.



Here's the hourly picture. Watch out for early Sunday fake outs, including gap plays.

Market Scan NASDAQ and other US markets

Here's the same scan from the previous post applied to my US stocks database. I don't typically play US stocks.
Check out the stocks with the NR7, their in pull back mode, I buy on STOP. I look at the intraday 15 minute chart where I have the 5 day MA plotted. The 5 day MA has to be flattening out, then I buy the break out for a swing trade, using a bracket order.
My tool for placing order is Tipster Trendlines. It is an Amibroker AFL for the chart that allows me to draw horizontal lines on the chart and hit the order button, sending the bracket order to TWS (Interactive Brokers trading platform). If your interested in it, the link is at the top of the blog.

Saturday, March 27, 2010

Market Scan - TSX

Here is an example of a scan I'll do when I'm looking for a swing trade on the TSX. The output window is shown below, along with a few stocks that i would consider entering on STOP orders, all are long entries.
The coloumns I generally look at in the output window are;

  • AlphaLong when the market is in an uptrend
  • NR7 - scans for narrow range bars in the last 7 bars
  • Stochastics - below 40 - this just ensure I filter out stocks that have moved already

Behind the scenes in the scan I'm looking at the 5, 20, and 50 SMA, with a price cut off and volume cut off (55 day average volume more than 200K)

On the chart, the arrows are coloured, the legend is at the top of the chart. Notice the NR7 arrows....

I use Tipster Trendlines AFL code for Amibroker to place my trades. It's a great tool to place the trade right from the Amibroker chart. Interactive Brokers is who I use.







Saturday, March 13, 2010

Tipster Trendlines - Version 3 beta

The new code is in beta testing.

The goal of the new code is to never have to see TWS again!

New features include;

  • Ability to easily see if your in a position or not
  • One order button instead of a seperate Long and Short button
  • Shows if an order is placed and not filled
  • Ability to modify the order after it's placed, from the chart
  • If you place an order and re-boot, the chart can still be used to modify the bracket if the order is still open (great for swing trading)
  • Turn bracket on or off so you can use any combination of the order with a stop or target
  • Colours have been modified to make it easier on the eyes
  • Price plot is set to your default so you are free to change it from the preferences menu

Anyone that has previously purchased earlier versions will be sent the code via email once it is ready.

Saturday, February 13, 2010

Bracket Trader Stats

Here is a handy tool if you use Bracket Trader (BT). This excel file will extract information from your BT log files to give you trading stats. Take a look at thew different stats it tracks.

Bracket Trader Spreadsheet

The instructions are good, so no need for me to explain how to use it.

Sunday, January 17, 2010

A free e-book

... after reading the title of this post you're probably thinking that I made an e-boook and I'm giving it away for free. Not. Maybe one day. I want to give you another hint on finding books.

Earlier I wrote about finding free e-books using Google "
Free ebook for everyone - how to find free books online". Go to that post and read the instructions, and become familiar with Googles advanced search.

A while back I read this post by RiskAddict
"Example Trading System" and went to the link he provided to download the e-book. It wouldn't let me get the book, something about maximum limit reached. So I went up to the Google tool bar and typed in "book" and selected "search site" from the Google drop down menu. From there I browsed through the hits and selected the PDF.

Here is the link that Google spit out, download the PDF while it's still there -
How to develop a futures trading system ebook

10 tips from the website with the book;

  1. Do not feel compelled to always have a trade on or to trade everyday. Capital preservation is the key to successful trading and sometimes that just means waiting when the odds are not in your favour. Throughout all my years of investing I've found that the big money was never made in the buying or the selling. The big money was made in the waiting." Jesse Livermore
  2. Develop your own proven trading system - accept that losing trades will be part of that system.
  3. Do not let
fear and greed influence your trading decisions.
  • Trading is a business, be strategic and logical.
  • Learn something new everyday that will help to maintain or increase your edge.
  • Keep a trading journal and review why your actual trades vary from your trading plan.
  • Do not fight the market, it's easier to run with the wind than against it.
  • Always trade with a stop loss and never move that stop further away or remove it completely. Do not allow a day trade to become a long term investment.
  • Become an expert, know your market inside out. Be it options, futures or an individual stock - you should strive to become the World authority in it!
  • The market will rarely do what it 'should' be doing. Instead focus on what it is doing.
  • 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.

    Disclaimer

    The information presented on this site is for educational and entertainment purposes only. This site contains no suggestions or instructions that you must follow, do your own research and due diligence before committing your cash to the markets. Your on your own.