NewYork Open Reversal with LPM
- Experts
- Versione: 2.13
- Attivazioni: 5
A fully automated Expert Advisor that trades the false breakout of the overnight range during the first hour of the New York session. It waits for price to sweep the range high or low, confirms that the move has turned, enters on the pullback with two limit orders, then manages every trade for you: fixed risk, partial profit, EMA trailing stop, time limits and a Friday close-out.
This is the full live-trading edition. It runs on demo and live accounts. (The free edition runs in the Strategy Tester only.)
The idea
Between midnight and the New York open, price builds a range. Around the open, the market very often pushes beyond that range, takes the stops sitting there, and then reverses. The EA trades that reversal. It does not guess tops and bottoms: it needs a breakout, a confirmed turn back, and a pullback before it enters.
How a trade is built
1. The range (00:00 - 10:00 New York time). The EA records the session high and low.
2. Signal 1 - the breakout (10:00 - 11:00 NY). When price breaks above the range high or below the range low, the EA marks it and keeps tracking the new extreme while price pushes further. The extreme (highest high or lowest low of the sweep) becomes the stop-loss level.
3. Signal 2 - the reversal. When price moves back 23.6% of the move from the extreme toward the range, the reversal is confirmed.
4. Entry. Two limit orders are placed at the 15% and 18% retracement levels. Stop loss sits at the extreme. Take profit sits at the 70% level.
5. One setup per day. After a setup is taken or skipped, the EA waits for the next New York day.
Trade management
- Risk-based lot size. Each of the two orders risks a fixed percent of balance (default 0.5% each).
- Partial close + EMA trailing. When price reaches the 0.62 retracement level, 75% of the position is closed and the stop on the rest moves to break-even. The remaining runner is then trailed behind a 20 EMA (M5) with a 15 pip offset. The stop only ever tightens and never goes back past break-even. The runner keeps the 70% take profit by default (switchable).
- Each trade is handled on its own. Both limit orders are managed independently with their own partial and trail.
- Time limits. No new orders after 11:00 NY. Unfilled limit orders are cancelled at 13:00 NY.
- Friday protection. On Fridays the take profit is closer (50% level) and all positions and pending orders are closed at 14:00 NY, so nothing is held over the weekend.
Filters
- Liquidity redzone filter. The EA checks for nearby liquidity beyond the extreme: previous day, week and month highs and lows. If one sits inside the redzone, risk is automatically halved for that setup.
- Slow-retrace filter. If the reversal takes longer than 25 minutes after the breakout, the setup is skipped. A slow turn means price kept pushing before reversing, which is the weaker kind of reversal.
- Midnight open (NY 00:00). Added as a seventh liquidity level. Its position in the retracement range is logged for every setup. An optional risk filter can halve the risk based on that position (off by default).
- Liquidity rating. After the reversal signal, the EA counts how many of the seven levels price reaches within 45 minutes and logs the score. This is for information and statistics; it does not change trading unless you enable the midnight filter.
Automatic New York time
The EA converts broker/PC time to New York time itself and follows US daylight saving automatically, so the 10:00 - 11:00 window stays correct all year. You only need to enter your PC/VPS UTC offset.
Restart safe
If the terminal or VPS restarts mid-day, the EA rebuilds the day's state (range, extreme, direction, midnight open, existing orders and positions) and carries on without placing duplicate orders.
Detailed logs
Every signal, filter decision, order, fill, partial, trail move and exit is written to the Experts log with New York time and clear tags such as [SIGNAL], [ORDER], [FILL], [PARTIAL], [TRAIL], [EXIT], [BLOCKED], so you can always see why the EA did or did not trade.
Input parameters
| Parameter | Default | Description |
|---|---|---|
| InpTradeSymbol | blank | Symbol to trade. Blank = chart symbol. |
| RiskPercentPerTrade | 0.5 | Percent of balance risked on each of the two orders. |
| FibTrigger | 0.236 | Pullback level that confirms the reversal (Signal 2). |
| FibRedzone | 0.25 | How far beyond the extreme to look for liquidity levels. |
| FibEntry1 / FibEntry2 | 0.15 / 0.18 | Entry levels of the two limit orders. |
| FibSL | 0.0 | Stop loss level (0 = exactly at the extreme). |
| FibTP | 0.7 | Take profit level. |
| UserUTCOffsetHours | 3.0 | Important. Current UTC offset of the PC/VPS running the EA, including daylight saving (Kenya = 3, London winter = 0). |
| TesterServerClock | NY + 7 | Strategy Tester only: how the broker's server clock behaves. |
| TesterServerUTCOffsetHours | 2.0 | Strategy Tester only: used when the clock mode is Fixed. |
| EnforcePlacementDeadline / PlacementDeadlineNY | true / 11:00 | Blocks new orders after this NY time. |
| CancelUnfilledAtTime / CancelUnfilledTimeNY | true / 13:00 | Cancels unfilled limit orders at this NY time. |
| SkipSlowRetrace / MaxMinutesSignal1To2 | true / 25 | Skips the setup if the reversal comes too long after the breakout. |
| MidNearExtremeFib / MidTPStartFib | 0.25 / 0.40 | Zone boundaries for the midnight-open position. |
| MidRiskFilter | Off | Optional: halve risk based on the midnight-open zone. |
| RatingWindowMinutes | 45 | Window after Signal 2 in which a touched level scores a point. |
| UsePartialAndTrail | true | Turns the partial close + EMA trailing on or off. |
| PartialTriggerFib | 0.62 | Retracement level that triggers the partial close. |
| PartialClosePercent | 75 | Percent of the position closed at the trigger. |
| TrailEMATimeframe / TrailEMAPeriod | M5 / 20 | EMA used to trail the runner. |
| TrailOffsetPips | 15 | Distance of the trailing stop from the EMA. |
| RunnerKeepTP | true | true = runner keeps the take profit; false = trail only. |
| UseFridayTP / FridayFibTP | true / 0.5 | Closer take profit on Fridays. |
| UseFridayClose / FridayCloseTimeNY | true / 14:00 | Closes everything on Friday at this NY time. |
Recommendations
- Any chart timeframe works; the EA uses its own New York time logic.
- Use a hedging account, because the EA opens two separate positions.
- Run it on a VPS or a PC that stays on during the New York morning.
- Set UserUTCOffsetHours correctly. If it is wrong, the session times will be wrong.
- Test in the Strategy Tester with "Every tick based on real ticks" before going live.
- Start with the default risk (0.5% per order) and adjust to your own tolerance.
Trading involves risk. Past results do not guarantee future results.
