///// INSTRUCTIONS for the "DAILY PATTERN MODEL RESEARCH" EA ///// Platform: MT5. Here are the instructions. Step 1: PREVIOUS DAYS' INTRADAY ACTIVITY We will use INTRADAY bars NOT Daily bars. I want the EA to run and scan if the chosen "DAILY PATTERN" occured in the previous days. I will choose ONE option below and the EA must check for that one only. I want to test one option at a time to simplify. We are not scanning and searching for all patterns, just the ONE that I would select from the list below. If that one occured we will proceed to Step 2. 1. ID 2. ID/NR4 3. NR7 4. 2*-day overlap (70%*) 5. Market traded from high to low 2* or more consecutive days (value of 1 is minimum but it can be more) 6. Market traded from low to high 2* or more consecutive days (value of 1 is minimum but it can be more) Terminology: AD1 - ID: This is an Inside day. Inside day's high is lower than the previous day's high and Inside day's low is higher than the previous day's low. AD2 - ID/NR4: This is an Inside day + The narrowest day of the last 4 days. The narrowest day means that the day 4 (last day out of those 4 in the sample) has the smallest trading range between its daily high and low compared to those others. AD3 - NR7: This is the narrowest trading day out of the 7 days. AD4 - 2*-day overlap (70%*): These are the last 2 days and their trading range (the difference between its daily high and low) overlaps at least for 70% (price overlap). I intend to test this for up to 5 days overlap, not more (in case this would slow down the code). AD5 and AD6 - If the daily high was made first and the daily low second, the market traded from high to low that day. If the daily low was made first and the daily high was made last, the market traded from low to high that day. So if the chosen pattern occured, proceed to Step 2. Step 2: TODAY'S INTRADAY ACTIVITY ENTERING TRADES: Market established the first 60min* of trading after the Open. Let's call this the "Opening range". Opening range could be 15min, 30min, 60min or 120min time frame, no other. "Open time" needs a format such as hh:mm and it is 08:00 by default. We will also set a "Close time" which is 22:00* by default. If the market trades outside of this Opening range, the trade is entered at market in the direction of the breakout. "Stop loss" is immediately set 2* ticks beyond the other end of the Opening range. Example: Opening range is set to 30min* and Open is at 8:00*. Once the candle closes at 8:29:59 we have the first 30 minutes of trading done and we have our Opening range. If the high is broken we enter a buy trade (stop loss is set below the Opening range), if the low is broken we enter a sell trade (stop loss is set above the Opening range high). "Size" is 1* contract by default. However, a trade is allowed to be entered only in the "Allowed entry time after Opening range" period which is 120min* by default. So in the example above, if the Opening range is finished at 8:30, we have 120min time window that allows a trade to be entered, that is until 10:30. After that, a trade cannot be entered. If the market doesn't break out of the Opening range, there is no entry. IMPORTANT: Here I want the option in the settings to be enabled/disabled and it is: If the whole Opening range is WITHIN yesterday's trading range (so below yesterday's high and above yesterday's low), DO NOT take a trade. Let's call this a "Entry filter" setting. Please use these names as presented in between " " so that I can recognise them in the settings. EXITING TRADES: I want to test different exits. oNE at a time. There are some GENERAL exit rules that apply to all exit options and they are as described below. Let's call an entry day - Day 1 and a day after the entry day - Day 2, etc. General rule no. 1: If a trade is still opened and none of the exit rules that are mentioned below were triggered, exit the trade at the Close of Day 2*. General rule no. 2: In case a trade is still opened and there is a price Gap beyond (!) stop loss (same day or any day after the entry), exit the losing trade immediately as the price becomes available. This is for a losing trade only. Stocks will have gaps and also forex and futures will have weekend gaps. Below are the EXIT TYPES to choose from (please include all exit names in the settings so that I will recognise them easier): EXIT 1 "CLOSE" : Exit at the Close of Day 1. No matter if profit or loss (the stop loss wasn't yet hit obviously). Apply General rules accordingly. EXIT 2 "RISK REWARD" : Exit in risk reward 1:2 (risk 1 reward 2*). Risk is the size of stop loss. If that size is 20 pips, cover profit at 40 pips reward. If risk reward is set to 1:3, cover at 60 pips reward. Minimum and default value is risk reward 1:1 but the setting has no limits on the reward number on the upside. This Exit style can go multiple days obviously until one of the orders is hit, either stop loss or profit target. Apply General rules accordingly. EXIT 3 "HIGHLOW PENETRATION" : If the trade shows a loss at the Close of Day 1, exit it. If not, hold it. Then, for a long trade, once the market trades above the high of Day 1, exit the trade. For a short trade, once the market trades below the low of Day 1, exit the trade. Initial stop loss for long and short trades is still in tact of course in case it is hit. Apply General rules accordingly. EXIT 4 "TRAILING STOP" : Exit a trade once a "Trailing stop" is hit. Trailing stop is a 2* day high/low. For longs the trailing stop is a lowest low od the last 2 days (closed days - not including current day when trailing). For shorts the trailing stop is a highest high of the last 2 days (closed days - not including current day when trailing). The trailing stop triggers on Day 2 and it cannot widen the Initial stop loss. Apply General rules accordingly. NOTES: All * signs shall have modifyable settings.