Welcome to "WORBOT", the Weekly Opening Range BreakOut BOT !
Khalid asked me to code this robot for him a few weeks ago.
After 2 weeks of forward-testing, we have now reached the point where the bot seems to be ready for publishing.
Attached to Post #2 is version 1.0.
This version and any new version will also be attached to post #2 of the thread.
WARNING: It is still experimental, and may still have some bugs, so:
!!! PLEASE DO NOT USE THIS ROBOT ON LIVE ACCOUNTS YET !!!
This is a single-pair trader;
If you are planing to trade WORBOT on 28 pairs (or more), then you'll have to open 28(or more) charts, and load WORBOT on each of them;
You can load WORBOT on any timeframe, although M15 is recommended for "visual comfort"...
Make sure you have enough H1 history loaded in your platform to get accurate average WOR values.
Although the week is already started at the time of this post, no hurry:
you still have a few hours to load and start WORBOT on your demo charts before it starts looking for placing trades...
The EA displays the "Weekly Opening Range" (WOR) as a light blue box when it is completed, or purple box when the Opening Range period is not yet completed;
Once the WOR period is completed, the WOR box turns light blue, and the Long and Short trading zones are displayed as light green boxes above and below the WOR box.
WORBOT will also display the past weeks WOR boxes and corresponding Long and Short trading zones.
The "comment zone" displays live information showing various inputs and calculated parameters.
WORBOT can be backtested, with the restriction that Empty4 backtester will only load a small amount of H1 history data, typically 10 weeks or so only.
This will have the side effect of giving inaccurate average WOR box sizes in the backtester, potentially modifying the trade allowed/not allowed condition on some backtested weeks.
I encourage you to experiment with various WOR box durations (WeeklyOpeningBoxDuration input), the default being 7-hours boxes.
You can try with 24-hours boxes to let the whole Monday pass to build a "Monday Range box" before WORBOT starts placing trades.
Or even 48 hours if you want to wait for any potential "direction of the week" to be established.
Many inputs can be customized and produce very different outcomes.
You are welcome to post your findings on the thread.
------------------------------
Quick review of the EA inputs:
------------------------------
WeeklyOpeningBoxDuration = 7; duration in hours of the weekly opening "box"
HoursBeforeEndOfWeekToCloseTrades = 9; close trades X hours before the trading week closes; 9 hours before the markets close is Friday 3PM EST;
AvgWeeklyOpeningRangeNumWeeks = 52; number of past weeks to determine the Average Weekly Opening Range;
if the available H1 history data contains less than 52 weeks, the EA will use whatever is available;
MaxAvgWeeklyOpeningRangeFactor = 1.25; factor of the Average Weekly Opening Range to determine the max acceptable range to allow trading;
MinBoxSizeInPips = 0; min tradable box size; when box is smaller than that, you should at least reduce your usual lot-size if you decide to trade it;
EntryBufferPips = 3.0; adds an extra buffer to the WOR for Buy/Sell entry levels
---- Position Sizing Inputs ----
RiskPerCent = 0; % of AccountBalance for the given SL; 0 will use fixed Lots below;
MinBuyLots = 0.0; Fixed minimum Lotsize for BUYs; when 0, will use the MINLOT for the symbol; Not used when RiskPerCent is not 0;
MinSellLots = 0.0; Fixed minimum Lotsize for SELLs; when 0, will use the MINLOT for the symbol; Not used when RiskPerCent is not 0;
---- SL/TP management: ----
The computed SL is considered our '1R' value (Initial Risk);
All other SL/TP management parameters are in multiples of this '1R' ("R-multiples"), in other words: multiples of the SL;
SLFactor = 1.0; SL is defined as a factor of the WOR box size;
if SLFactor >= 10, it will be considered as FIXED PIPs rather than a factor of the WOR box;
Reward_Risk_ratio = 1.5; R:R ratio: the TP will be set as R:R * 1R (= R:R * SL);
MoveToBEAfter_Rmult = 1.0; move to BE+ when profit reaches this R multiple (factor of SL);
BEProfit_in_Rmult = 0.0; lock-in this amount of R-multiple when MoveToBEAfter_Rmult is hit;
TrailingStart_at_Rmult = 0.5; R-multiples to start trailing the StopLoss;
TrailingStop_in_Rmult = 0.5; R-multiples to trail the StopLoss; if 0 then no trailing stop
TrailingStopStep_in_Rmult = 0.1; trailing SL jumping step in R-multiples
---- Trades per week limits:
MaxTradesAllowedPerSession = 2; max number of trades per week, whatever direction; 0 means no limit on trades;
AllowThirdTrade = false; option to allow a 3rd trade when both Buy and Sell trades were losses;
MaxLossesAllowedPerSession = 2; max number of losses per week, whatever direction; 0 means no limit on losses
MaxWinsAllowedPerSession = 2; max number of wins per week, whatever direction; 0 means no limit on wins
---- Misc stuff:
TradeComment="Weekly Opening Range Breakout EA";
SlippagePips = 3.0;
MaxSpreadPips = 4.0; spread limitation: the EA won't send trades if spread is higher than this value;
brokerIsECN = false; set this to TRUE if your broker requires to send trades with no SL and TP; the order will be modified in order to apply the TP and SL;
Regards to all;
Squalou