I am looking for an EA in MQL5 that trades both sides of a range breakout and places a hedge order. Fairly straightforward!
Here is a specification:
Trading Strategy Specification: Range Breakout
Platform: Metatrader 5, Forex brokers
Default Chart: EURUSD, 5m chart
Quick overview
The strategy looks for an established range in the morning session and then trades breakouts above or below that range, by opening either a long trade above the range or a short trade below the range. Take-profit and stop-loss targets are immediately set. If one order has been hit, the other order is immediately terminated. If a trade ends in stop-loss, a hedge trade is opened immediately afterwards
Description of Algorithm
Input Parameters
| Name | data type | default value |
| starttime | time | 7:00am UTC+1 |
| endtime | time | 9:00am UTC+1 |
| minimumrange | number | 10 pips |
| maximumrange | number | 150 pips |
| entrybuffer | number | 5% |
| exitbuffer | number | 2% |
| riskrewardratio | number | 2 |
| tradevolume | number | 0.05 lots |
| hedgerangedivider | number | 3 |
| hedgevolumemultiplier | number | 4 |
| endtime | time | 8:00pm UTC+1 |
Step 1: Establish range in the morning session
Record the highest and the lowest encountered price in the time interval between start time and end time in two variables and calculate the resulting range. Also apply a minimum and maximum range.
High = highest price encountered in interal between starttime and endtime
Low = lowest price encountered in interval between starttime and endtime
Range = High - Low
if Range is higher than maximum range, then set Range = maximumrange
if Range is lower than minimum range, then set Range = minimumrange
Step 2: Trade Entries
Calculate the entry prices by using the range, and a buffer. Set the orders immediately after the time interval of step 1 is over. First, calculate price levels:
bufferrangeentry = range * (1+entrybuffer)
bufferrangeexit = range * (1+exitbuffer)
rangedivider = range / riskrewardratio
Place two pending stop orders with the following parameters:
1) Short Order
Direction: short
Entry Price: Low - bufferrangeentry
stop loss: High + bufferrangeexit
take profit: Entry - rangedivider
2) Long Order:
Direction: long
Entry: High + bufferrangeentry
Set stop loss: Low - bufferrangeexit
Set take profit: Entry + rangedivider
If one of the orders is hit, delete the other open order.
Step 3: Hedge Orders
If a stop loss has been hit, on the first opened position, we try to re-coup our losses with a hedge. Therefore a hedge order is placed at the stop-loss of the first opened order. Calculate the range of the hedge:
hedgerange = Range / hedgerangedivider
Place Long Hedge Order if 1st opened position was a short:
Direction: Long
Entry: 1st order stop loss price, immediately after
Stop loss: 1st order entry price
Take Profit: entry + hedgerange
OR
Place Short Hedge Order if 1st opened position was a long:
Direction: Short
Entry: 1st order stop loss price
Set Stop loss: 1st order entry price
set Take Profit: entry - hedgerange
Step 4: Close at market price at a time at the end of the day
Close all orders and positions at the given time in the endtime parameter
Benzer siparişler
1. Goal I want a MetaTrader 5 Expert Advisor that trades a simple Supertrend trend‑following idea, but with professional‑grade risk management and filters. It should be robust enough for real money on instruments like XAUUSD and GBP pairs, using small, consistent risk per trade rather than martingale or grid. 2. Strategy Logic Indicators (I will supply the .mq5 files if needed): Supertrend (ATR‑based), with
Hi developers, I need someone to help me create a simple EA with my indicators and trading plan... I will give you all parameters and you help me create... 2 moving averages, one candle pattern
Please a need a very good expert for this jou I want to create 2 robot one a trade manager Perfect — here’s a clean, professional order description you can post directly to an EA freelancer (MQL5). I’ve written it so it’s clear, serious, and attractive to skilled developers 👌 MQL5 Trade Manager EA – Development Request I am looking for an experienced MQL5 developer to build a robust Trade Manager Expert Advisor for
The Ai robot must help me with forex and I don't have money soon can the Ai robot give me some money and I will pay it back if the Ai robot does a good job making me rich
Project Title: MT5 Algo Trading EA (Single Strategy + License Panel + Ownership + Manual Trade) --- Project Description I am looking for an experienced MT5 (MQL5) developer to create a clean, stable and professional Algo Trading EA for my company and future clients. This is a long-term business project, not a one-time personal EA. --- 1. Strategy Requirements - Only 1 single trading strategy - No martingale - No grid
I am looking for an experienced StrategyQuant X (SQX) developer to build a reusable trading template , not a single strategy. ⚠️ Please do NOT apply unless you actively use StrategyQuant X and have access to it. This project cannot be completed without SQX. 1. Session and Time Filters Trading restricted to fixed GMT sessions per index Sessions must convert correctly to broker server time and remain correct through
Is there someone who coded the PipJuice indicator? Here is the link: https://www.pipjuice.io/ Unfortunately, I don‘t have access to the indicator or the code. If someone have it please send me some screenshots
Strategy Development: Suggest a high-probability trading strategy based on Technical Analysis (using indicators like RSI, MACD, or Price Action). Risk Management: Explain how to calculate position sizing so I don't lose more than 1-2% of my capital per trade. Market Analysis: Teach me how to identify Support and Resistance levels and how to spot a trend reversal. Psychology: Give me 5 golden rules to maintain
A Grid EA with a hedge that open trades on a percentage based on whats is opened on the other side, closes losing trades with current profits made and utilizes a grid trading strategy combined with hedging technique to mitigate risk and potentially lock in profits. It involves placing buy and sell orders at predetermined price intervals, forming a grid. When a trade within the grid moves against the initial
MQL5 Expert Advisor Development (MT5) I need a professional MQL5 developer to create a custom Expert Advisor (EA) for MetaTrader 5 with high accuracy, low drawdown, and fast execution . 🔹 Strategy Requirements: Timeframe: Scalping-friendly (M1 / M5) Indicators Used: EMA 9 EMA 12 EMA 21 VWAP (as a trend filter) RSI (for trade confirmation) 🔹 Trade Logic: Buy and Sell entries based on EMA crossover + VWAP direction