Welcome Forex EA downloads & MT4/MT5 auto-trading resources — EAs, Gold EAs, quant tools and real-world automation.
Sign In Sign Up

Weekly Open EA | Foreign Exchange EA Download- MT4/MT5 Resources

author EAcpu | 2 reads | 0 comments |
I've been asked to start my own thread, so I'd like to keep this one about an EA I develop. I don't want to start mixing different versions of EAs written by several other people. Hopefully in doing so, we'll all stay on track and work together, and I'll implement all the ideas I can into EA as long as they enhance the original system and stay true to its source. New EAs can be written for other ideas, so let's keep tracking each idea I develop.

rule:

  1. is the starting point
  2. The EA opens 3 pending long positions at 50 pips above
  3. The EA places 3 short positions below 50 pips

For each group of pending orders...

  1. First order: TP 25/SL 50
  2. Second order: TP 50/SL 50
  3. Level 3: TP None/SL 50

Long example:

  1. Trigger pending order for long position
  2. Pending short orders are up 50 points from this week's opening price
  3. If the long position reaches 50 (also closing trades 1 and 2), the third order will break even on the stop and the short position will move up another 50 pips (now 50 pips above the week's open)
  4. Every time the long trade gains another 50, the short position is increased by 50 (my default, but can be changed). The third long trade also raises its stop loss by 50 pips at a time (i.e. 100+, then locks the stop loss by 50 and so on, to the point where the short order follows).
  5. If the long trade doubles and hits the stop loss, the short trade will be triggered and the exact opposite happens.

Source code (very important):

Poll: Do I have to share my source code?

set up:
inserted code
 //+------------------------------------------------------------------+
//|Input variables|
//+------------------------------------------------------------------+
extern string TradingParameters = "-----------------------------------------------------------------------------";
extern bool BrokerHasSundayBar = true; //Some brokers (like FXDD) do not have a Sunday bar, while others (like IBFX) do not. Find out if yours has it and set it to True/False
extern int BrokerCloseHour = 19; //Set this to 1 hour before your broker actually closes, the EA will close everything for you on Friday (19 hours for IBFX, 22 hours for FXDD, etc.)
External int order distance = 50; //The distance from this week's opening price will become the distance between opposite orders after triggering extern bool MoveOpposites = true; //If false, short and long positions remain higher or lower than the previous week's closing price 50/OrderDistance pointsextern string Order01Parameters = "--------------------------------------------------------------------------------";
External double Order01LotSize = 0.01; //Order lot size (if = 0, no order will be placed)
External integer Order01TP = 25; // Take profit (if = 0, do not place)
external int Order01BE = 0; //When is an order set to breakeven?
External int Order01TrailStopTrigger = 0; //When will the trailing stop be triggered?
extern int Order01TrailStopAmount = 0; //How many points to track?

extern string Order02Parameters = "--------------------------------------------------------------------------------";
External double Order02LotSize = 0.01; //Order lot size (if = 0, no order will be placed)
External integer Order02TP = 50; // Take profit (do not place if = 0)
external int Order02BE = 0; //When is an order set to breakeven?
External int Order02TrailStopTrigger = 0; //When will the trailing stop be triggered?
extern int Order02TrailStopAmount = 0; //How many points to track?

extern string Order03Parameters = "--------------------------------------------------------------------------------";
External double Order03LotSize = 0.01; //Order lot size (if = 0, no order will be placed)
External integer Order03TP = 1000; // Take profit (do not place if = 0)
External integer Order03BE = 50; //When is the order set to breakeven?
External int Order03TrailStopTrigger = 0; //When will the trailing stop be triggered?
extern int Order03TrailStopAmount = 0; //How many points to track?

extern string Order04Parameters = "--------------------------------------------------------------------------------";
External double Order04LotSize = 0.00; //Order lot size (if = 0, no order will be placed)
External int Order04TP = 0; //Take profit (do not place if = 0)
external int Order04BE = 0; //When is an order set to breakeven?
External int Order04TrailStopTrigger = 0; //When will the trailing stop be triggered?
extern int Order04TrailStopAmount = 0; //How many points to track?

extern string Order05Parameters = "--------------------------------------------------------------------------------";
External double Order05LotSize = 0.00; //Order lot size (if = 0, no order will be placed)
External int Order05TP = 0; //Take profit (do not place if = 0)
external int Order05BE = 0; //When is an order set to breakeven?
External int Order05TrailStopTrigger = 0; //When will the trailing stop be triggered?
extern int Order05TrailStopAmount = 0; //How many points to track?

extern string EmailParameters = "-----------------------------------------------------------------";
extern bool EmailNewOrdersPlaced = false; //Send email whenever an order is placed (even limit and stop orders)
extern bool EmailProfitLossSummary = false; //Send profit/loss summary whenever order quantity changes (not counting pending orders)

extern string MiscParameters = "------------------------------------------------------------------------";
extern bool DisplayProfitLoss = true; //Display transaction history?
extern int order slippage = 3; //How many points can the order change?
External int EAMagicNumber = 20080622; //Used to determine the order placed by the EA
Revision Notes:
inserted code
//+------------------------------------------------------------------+
//|Revision Notes|
//+------------------------------------------------------------------+
/*

Version 1.0b:

   * Merged together v1.0a version where the EA determines your broker and uses the correct number of bars.
   * Fixed a bug related to closing and reopening EA/MT4 where SL would be set to empty.
   * You need to remove/delete the original EA as it contains errors and the new EA will not overwrite it as the name is different. Any charts with old EAs need to be updated with new EAs. From now on this should no longer be a problem as the name will no longer change.

Version 1.0c:

   * Fixed bug where breakeven would be updated even if stop loss was set higher/lower to ensure profit. Now, as expected...if the pending short trades (entries) are greater than the breakeven of the long trades, then the long order stop is moved up to secure more pips and vice versa.
   * The EA now uses this week's opening price instead of the previous week's closing price.
   * Added MoveInfinite variable which if set to True will override Move01 - Move04. The order is adjusted every time the price changes by the order distance.
   * The EA now closes open and pending orders on Sundays as long as the EA is running.

Version 1.0d:

   * Redesigned the way to place/maintain orders * Removed MoveInfinite and Move01 to Move04

Version 1.0e:

   * Fixed bug in order calculation version 1.0f (68 downloads):

   * Reworked the way to place/maintain orders (again...)
   * Replaced stop loss setting with order distance * Added broker closing time version 1.0g (95 downloads):

   * Added DisplayProfitLoss (display profit/loss on chart comments?)
   * Send an email when a new order is placed * Send an email when the total order count changes (not counting pending orders)

Version 2.0:

   * Fixed bug in profit display midpoint calculation * Fixed email display text issue * Modified key areas to work with real accounts * Live version available Pending additions/changes:

   * EA's email status * Order modified, closed, deleted, etc.? (We don’t know yet how far we can go)

*/
string Version = "WeeklyOpen AutoTrader v2.0";

  1. The system should be activated when markets open on Sunday.
  2. This should work on a daily chart.
  3. I don't guarantee any results, especially if you decide to change the default settings or run it in another time frame. The EA looks back by bars, so if it's not on the daily chart you'll get the wrong price.
  4. The EA might work (make trades) if opened within a week, but not as I expected and the results are not guaranteed. It actually starts on Sunday and runs until close on Friday.
  5. It is extremely important to have MT4 running all week with the charts open and the EA attached. No EA can complete its mission unless everything is running. That's why you need an EA to trade for you.
  6. The EA can only be run on a demo account. If successful I will release a live version.
  7. I will try to post at least weekly updated results.

Currently supported brokers:

  1. Just you specify whether your broker has Sunday bars ( Broker Sunday Bar = ).

Here are some of my other topics that may be of interest to you...

"The Pip Nailer" (EA - MTaboneWeb)
AshFX Daily (EA - MTaboneWeb)
DailyHighLow (EA - MtaboneWeb)
GrabMyOrders (EA - MTaboneWeb)
TossUp (EA - MTaboneWeb)
Open EA every week

Special thanks to everyone who has supported and continues to support this EA.

settings1.gifsettings2.gifsettings3.gifTesterGraph.gif
settings1.gifsettings2.gifsettings3.gifTesterGraph.gif
settings1.gifsettings2.gifsettings3.gifTesterGraph.gif
settings1.gifsettings2.gifsettings3.gifTesterGraph.gif
settings1.gifsettings2.gifsettings3.gifTesterGraph.gif
settings1.gifsettings2.gifsettings3.gifTesterGraph.gif

📦 Summary of post attachments (11)

Below are all the files (11) shared in the reply.

Verification code Refresh