Hi,
Please check out the advanced NewsTrader EA which uses the DailyFX Economic Calendar. This EA can be backtested and optimized if the input parameter LoadFromFile = true. In this case files from the attached DailyFX History.zip should be unpacked and placed in ../tester/files directory. Also you should set proper value for the TimeZone parameter(UseAutoTimeZone = false) and the parameter ReadFromFile should be true.
Code://---- input parameters
input string ExpertName = "NewsTrader_v6.2 600+";
input int Magic = 6060; //Magic Number
input int Slippage = 3; //Slippage in pips
input string calInputs = "===== Calendar settings: =====";
input string CalendarDirectory = "FX News"; //Calendar Directory
input string CalendarName = "Investing.com";//Calendar Name
input int DownloadPause = 120; //Pause Between Downloads (sec)
input bool UseAutoTimeZone = true; //Auto TimeZone Detection
input int TimeZone = 3; //Manual TimeZone
input bool ReadFromFile = false; //Read Calendar From File: false-from site,true-from file
input bool PrintInLog = false; //Print in Log: false-off,true-on
input bool DisplayLines = true; //Display Lines Option: false-off,true-on
input bool DisplayText = false; //Display Text Option: false-off,true-on
input bool DisplayEvents = false; //Display Events Option: false-off,true-on
input int LineStyle = 3; //Line Style
input int MaxEventLength = 27; //News Max Length(in symbols)
input string timeInputs = "===== Timing settings: =====";
input bool OpenOnClose = false; //Open On Bar Close
input int TimeFrame = 0; //TimeFrame
input double TimeGap = 2; //Time Gap between News(Bar Close) Time and Order Open Time in min
input double OrderDuration = 15; //Order Duratiton Time in min
input double ProcessTime = 1; //Order Processing Time in min
input int SessionEndHour = 23; //Session End Time
input int FridayEndHour = 22; //Session End Time in Friday
input string ordInputs = "===== Order settings: =====";
input int OrdersNum = 2; //Number of pending orders from one side
input int HiPrice = 0; //Buy Price
input int LoPrice = 0; //Sell Price
input int PriceShift = 0; //Price Shift
input double PendOrdGap = 15; //Gap for Pending Orders from current price in pips
input double OrdersStep = 10; //Step between orders in pips
input bool DeleteOpposite = true; //Opposite Orders delete
input bool TrailOpposite = true; //Opposite Orders trailing
input bool CloseOnNewEvent = true; //Close Orders On New Event
input double InitialStop = 30; //Initial Stop in pips
input double TakeProfit = 100; //Take Profit in pips
input double TrailingStop = 15; //Trailing Stop in pips
input double TrailingStep = 0; //Trailing Stop Step in pips
input double BreakEven = 0; //Breakeven in pips
input double PipsLock = 0; //Lock in pips
input bool ECN_Mode = false; //ECN Mode
input bool Straddle_Mode = true; //Straddle Mode
input bool DisplayLevels = true; //Display Levels for ECN Mode
input bool ShowComments = true; //Show Comments: false-off,true-on(use only for Live Trading and Visual Testing)
input bool ShowCalendar = true; //Show Calendar
input bool SaveHTMFormat = false; //Save HTM Format
input string countryFilter = "===== Country Filter(None-off, color-on): =====";
input color EUR = clrPink; //Euro Zone(EUR)
input color USD = clrDodgerBlue; //US(USD)
input color JPY = clrOrange; //Japan(JPY)
input color GBP = clrRed; //UK(GBP)
input color CHF = clrMagenta; //Switzerland(CHF)
input color AUD = clrGreen; //Australia(AUD)
input color CAD = clrTomato; //Canada(CAD)
input color NZD = clrGray; //New Zealand(NZD)
input color CNY = clrOrange; //China(CNY)
input string impFilter = "===== Importance Filter: =====";
input string NewsImportance = "L,M,H"; //News Importance Filter ("" - all)
input string mmInputs = "===== Money Management settings: =====";
input int MM_Mode = 0; //MM Mode: 0-off,1-by free Margin
input double Lots = 0.1; //Lot size
input double RiskFactor = 0; //Risk Factor(in decimals) for MM formula
input double MaxLots = 0; //Max Lot Size
Attachment 12669
UPDATES:
2014.12.29 - fixed and updated version v5.91 added.
2015.01.06 - fixed version v5.92 uploaded.
2015.04.10 - updated version v5.93 uploaded. Since this version you can trade using the ForexFactory Calendar.
Just enter correct names for CalendarDirectory = "ForexFactoryNews", CalendarName = ""(empty field) and
ReadFromFile = true. Please set UseAutoTimeZone = false and the proper Manual TimeZone parameter for your broker's time. Also you should apply the ForexFactoryNews indicator to the chart.
2015.05.01 - updated version v5.94 uploaded. Since this version you can trade on the closed bar after the News Event.
2015.05.18 - fixed version v5.95 600+ uploaded because of changing the DailyFX Calendar html format.
2015.06.09 - fixed version v5.96 600+ uploaded.
2016.01.26 - fixed version v5.98 600+ uploaded because of changing the DailyFX Calendar html format.
2016.03.07 - fixed version v5.99 600+ uploaded.
2016.06.27 - fixed version v6.0 600+ uploaded because of changing the DailyFX Calendar html format.
2017.06.28 - version v6.1 600+: The Investing.com calendar is used instead of the DailyFX calendar.
2017.07.03 - fixed version v6.2 600+ uploaded.
2017.08.23 - fixed version v6.3 600+ uploaded.
2017.09.14 - fixed version v6.4 600+ uploaded.
Regards,
Igor