This is a small example of using news trading strategy. There are few strategies. I wrote about four different strategies to play news. This simple EA includes one and the most interesting of these strategies in my opinion.
I didn't include the method to get news बेकाउसे , and I didn't want to write about it ones more. Here you get a simple implementation of making orders results from one of the strategies I wrote on my blog.
Here is description of the strategy:
Strategy no 3
It’s my favorite strategy. Before the news publication we place two orders: one buy stop and one sell stop. Both for example 5 pisp TP and 5 pips SL. We place buy stop above current price let’s say 20 pips above, and sell stop 20 pips under current price. Now we wait for the data. When the market shots in some way it is big probability to hit one of our TP. Even if it returns after all it can his the second TP. The profit can bee small but not very risky. Be careful with your SL’s and TP’s to be not too big cause it is better to earn small than to lose big money.
Here is sample code:
//-------------------------------------------------------------------
if(orderOpenDate == currentDate)
{
//we place 2 orders: buy stop and sell stop
if(ticket < 1)
{
orderAsk = Ask - bias * Point;
orderBid = Bid - bias * Point;
ticket=OrderSend(Symbol(),OP_SELLSTOP,lot,orderBid,1,orderAsk+Point*sl,orderBid-tp*Point,"NewsTrader",2,0,Red);
}
if(ticket2 < 1)
{
orderAsk = Ask + bias * Point;
orderBid = Bid + bias * Point;
ticket2=OrderSend(Symbol(),OP_BUYSTOP,lot,orderAsk,1,orderBid-Point*sl,orderAsk+tp*Point,"NewsTrader",2,0,Green);
}
}
//---------------------------------------------------
This EA comprises only 20 lines of code, and does all its trading in two lines! if there is a simpler EA out there I would love to see it!
The EA doesn't use any indicators. Instead, it simply and blindly opens two opposing positions at the beginning of the first new bar it comes across. It waits until both positions have closed by hitting their stop-losses or take-profit levels, and then opens the next pair of positions.
After optimisation manually select the best result where the stop-loss is lower than take-profit level, in which case each pair of trades will have one of the following outcomes.
- Both positions win (hurrah!)
- One wins and one loses (in which case the winner covers the losses of the loser)
- Both lose (oh no!)
It is OK to optimise the EA using "Open prices only", because it only trades at the opening of a new bar.
In my experiments, EURGBP 5M provides the best results, although positive results are also available from EURUSD, GBPUSD, EURCHF and probably others.
Please feel free to improve the code to your heart's content!
Symbol | EURGBP (Euro vs Great Britain Pound ) | ||||
Period | 5 Minutes (M5) 2009.10.01 00:00 - 2010.01.31 23:55 (2009.10.01 - 2010.02.01) | ||||
Model | Every tick (the most precise method based on all available least timeframes) | ||||
Parameters | lots=1; stop_loss=76; take_profit=750; | ||||
Bars in test | 25154 | Ticks modelled | 3758809 | Modelling quality | 90.00% |
Mismatched charts errors | 0 | ||||
Initial deposit | 10000.00 | ||||
Total net profit | 7842.50 | Gross profit | 27413.50 | Gross loss | -19571.00 |
Profit factor | 1.40 | Expected payoff | 76.89 | ||
Absolute drawdown | 792.50 | Maximal drawdown | 3539.00 (23.17%) | Relative drawdown | 23.17% (3539.00) |
Total trades | 102 | Short positions (won %) | 51 (56.86%) | Long positions (won %) | 51 (19.61%) |
Profit trades (% of total) | 39 (38.24%) | Loss trades (% of total) | 63 (61.76%) | ||
Largest | profit trade | 727.00 | loss trade | -750.00 | |
Average | profit trade | 702.91 | loss trade | -310.65 | |
Maximum | consecutive wins (profit in money) | 1 (727.00) | consecutive losses (loss in money) | 7 (-2543.50) | |
Maximal | consecutive profit (count of wins) | 727.00 (1) | consecutive loss (count of losses) | -2543.50 (7) | |
Average | consecutive wins | 1 | consecutive losses |