Thursday, July 26, 2012

Trendline Trader

This EA is based on strategy discussed on babypips forum <here>

It draws 2 trendline based on high-high and low-low created by swing indicator.
The rules for creating trendlines are:
1. If new high is higher then previous high, then draw a horizontal line at new high. Else its a trendline connecting new high and previous high.
2. If new low is lower then previous low, then draw a horizontal line at new low. Else its a trendline connecting new low and previous low.

Whenever there is breakout of these trendlines, it

opens appropriate position.
Stop loss is the previous low/high (for long/short trades) minus/plus the stoploss pips parameter. Takeprofit is parametrized.

Below charts depicting the trendlines on EURUSD and GBPUSD 5M:


I tested this strategy on EURUSD 5M for June-12 month. 
Although its a net loss(b'coz I kept TP low and no breakeven), but some points worth considering:
1. Stoploss hit most for trades taken during Asian session. - so don't trades during Asian session
2. Profitable trades are more than lossing trades. - Need better SL & TP management. Need to have a breakeven logic e.g. after X pips, set SL to breakeven.
3. It opened 108 trades in one month, quite high count of trades. - so need a filter condition.
4. Many losing trades are fake breakouts. Any way to eliminate fake breakouts.??

I am thinking of applying SAR as a filter condition and also for SL and TP. Will keep you guys posted. I have submitted the code at mql4 official website. Once its published, will post the link here.


Say in the comments, how you like it or if you see any improvement worth considering. 

EDIT on 01-Aug-2012: It seems mql4 website is taking too much time to review and publish code. So I have uploaded the code here and it can be downloaded by hitting [here]. Say in comments how you like it...

No comments:

Post a Comment

Related Post