Entry buy and sell x minutes before the news, then we add orders against the trend waiting for a retracement.
We use martingale as money management. We close the orders once the profit target is reached.
Code:extern double multiplier=2.0; // martingale multiplier, set 1 to disable martingaleCode:extern string profitmanagement="Profit Management"; extern double targetpercent=0.1; // percent of the account balance as profit target extern int resetlevel=5; // percent target = 0 if long or short orders >= 5Code:extern string ordersmanagement="Order Management"; extern int pipsteps=20; // 0=disabled extern double pipstepsfactor=1.2; // factor to multiply pipsteps after each order extern double direction=1; // 1=trend counter, 2=trend followYou can set the impact factor if wanted. And change the direction if you desire to follow the trend.Code:extern string entrylogics="Entry Logics"; extern int minutesdeploy=60; // minutes before the news to generate first orders extern int minutesbuffer=20; // minutes around the deploy to enter orders extern bool impacthigh=true; // consider impact high extern bool impactmedium=false; // consider impact medium extern bool impactlow=false; // consider impact low
Forward mode :
You need the FFCAL.mq4 version attached. Put it in the indicators folder.
Backtesting :
This EA is one of the rare code that allows backtesting with news (used here as signals). I have rewritten the respective function.
Put XLOutput.CSV (attached) in the tester/files folder. You can create and update this csv file yourself with News v303 (FFCAL.exe > only check date, time, currency, and impact; set the output only events between); it will be sent to expert/files.
Download : Martingala News EA (available in the Elite section).






