Hedging Grid EA

MQL4 Experten

Auftrag beendet

Ausführungszeit 7 Tage
Bewertung des Entwicklers
Good client, good business
Bewertung des Kunden
Good Job

Spezifikation

Project Overview: Hedging Grid EA
The goal is to create an MQL4 Expert Advisor that employs a hedging grid strategy. This means it will open both buy and sell trades, often simultaneously, and will add to positions at predefined intervals as the price moves.
Core Strategy:
Grid Trading: The EA places new pending orders (BUYSTOP, SELLSTOP) at a set distance from existing trades.
Hedging: It manages buy and sell trades independently, allowing them to run at the same time.
Lot Sizing: It can use a multiplier (martingale-style) or a fixed increment to increase the lot size for new grid orders.
Profit/Loss Management: It closes trades based on several conditions:
Profit target for a single direction (e.g., close all buys).
Combined profit target for both directions (hedged basket).
A hard stop-loss based on total drawdown.
Dynamic Orders: It uses trailing stops on open positions and can also "trail" its pending orders, adjusting their entry price as the market moves.
Visual Interface: The EA displays key information directly on the chart, including profits, average entry prices, and trading signals.
Part 1: EA Settings (Global extern Variables)
These are the user-configurable inputs. The programmer needs to declare these at the top of the file so they appear in the EA's settings window in MetaTrader.
Order Management:
Magic: int - A unique magic number to distinguish this EA's trades from others.
slippage: int - The maximum allowed slippage in points for order execution.
Allow_BUY, Allow_SELL: bool - Master switches to enable or disable buy and sell trading.
Open_order_on_trend: bool - A setting to control grid order placement logic (either with or against the trend).
Lot Sizing:
Order_lotsize: double - The initial lot size for the first trade in a series.
Multiply_lotsize_by: double - A multiplier for the next lot size (e.g., 1.5 for a martingale strategy).
Increase_lotsize_by: double - A fixed amount to add to the next lot size (used if the multiplier is 1.0).
Round_lotsize_to_decimals: int - The number of decimal places to round the lot size to (e.g., 2 for standard lots).
Grid & Order Spacing:
First_step: int - The distance in points from the current price to place the first pending order.
Distance_between_orders: int - The minimum distance in points between orders in the grid.
Minimum_price_distance: int - The minimum distance from the current price for subsequent pending orders.
Move_step: int - The number of points the price must move before a pending order is trailed (modified).
Stop Loss & Take Profit:
Stoploss, Takeprofit: int - The initial Stop Loss and Take Profit in points for each individual order.
Trailing_type: int - The type of trailing stop to use (0 = disabled). The programmer will need to implement the logic for different types if required.
Trailing_step: int - The step, in points, for the trailing stop.
Minimum_trailing_profit: int - The minimum profit in points an order must have before the trailing stop is activated.
Basket Closing Conditions:
Profit_for_closing_1_direction: double - The profit amount in account currency to close all trades in one direction (e.g., close all buys when their total profit reaches $50).
Profit_for_closing_2_directions: double - The profit amount to close all trades (buys and sells) when the combined profit of the hedged basket reaches this target.
Loss_for_closing: double - A negative dollar amount that triggers the closing of all trades in one direction (e.g., close all buys if their total profit reaches -$100).
Maximum_allowed_loss: double - A negative dollar amount that prevents the EA from opening new trades in a direction.
Close_loss_by_drawdown: double - A profit threshold. If the profit of either side drops below this, the EA switches to its "hedged close" logic.
Auto_calculated_profit: double - A setting to automatically calculate the profit target based on lot size and tick value.
Indicators & Timing:
Opening_1_order_on_indicators: bool - If true, the very first order will only be placed if RSI conditions are met.
Timeframe_indicator: int - The timeframe to use for the RSI calculation.
RSI_Period, Oversold_zone, Overbought_zone: int - Standard RSI settings.
Delete_Orders: bool - Enable/disable the scheduled deletion of all orders.
DeleteHour: int - The server hour (0-23) to delete all orders.
Visuals:
Font_size: int - The font size for text displayed on the chart.
Color_information: color - The color for the informational text.
Part 2: Main Program Structure (OnInit, OnDeinit, OnTick)
int OnInit(): This function runs once when the EA is first attached to a chart. Its purpose is to set up the visual display. The programmer should write code here to create all the necessary text objects (OBJ_LABEL) on the chart for displaying Balance, Equity, Profits, etc.
void OnDeinit(const int reason): This function runs once when the EA is removed from the chart. It should contain a cleanup routine to delete all chart objects created in OnInit().
void OnTick(): This is the heart of the EA, running on every new price tick. The programmer should implement this function exactly as it appears in the refactored code, with the main logic flow calling the 9 helper functions in sequence.
Part 3: Helper Function Implementation
The programmer should create each of the 9 functions called by OnTick.
HandleScheduledOrderDeletion(): Simple function. Check the Delete_Orders setting and the current server hour. If they match DeleteHour, call a function to close/delete all orders.
ProcessOpenOrders(...): This is a critical data-gathering function. It must loop through all orders, filter them by the current symbol and magic number, and then calculate all the key metrics (counts, lots, profits, price points) needed by the other functions.
UpdateAveragePriceObjects(...): This function should first delete the old "SLb" and "SLs" arrows from the chart. Then, if buy or sell orders exist, it should create new arrows (OBJ_ARROW with SYMBOL_RIGHTPRICE) at the calculated averageBuyPrice and averageSellPrice.
ApplyTrailingStops(...): Loop through all open trades. For each trade, calculate the potential new trailing stop loss price. If this new price is better than the current one (higher for buys, lower for sells) and meets the minimum profit condition, modify the order using OrderModify().
ManageProfitAndLossClosing(...): Implement the series of if statements to check the various profit and loss conditions against the targets. If a condition is met, it should call the CloseOrders() function with the correct parameter (1 for buys, -1 for sells, 0 for all).
UpdateTradingSignals(...): This function updates the chart labels ("Char.b", "Char.s") that show if trading is allowed. It uses ObjectSetText() with special Wingdings font characters to display green checkmarks or red crosses.
ManagePendingOrders(...): Implement the logic to place new grid orders. This involves calculating the lot size, determining the entry price based on distance rules and RSI, and checking if there is enough free margin before calling OrderSend().
ModifyPendingOrders(...): Implement the "trailing pending order" logic. Calculate the ideal new price for the existing pending order and compare it to its current price. If the complex shouldModify condition is met, call OrderModify() to update the order's entry price.
UpdateChartInformation(...): Update all the informational text labels on the chart (Balance, Equity, ProfitB, etc.) with the latest values calculated in ProcessOpenOrders.
Part 4: Required Utility Functions
The programmer will also need to create the functions that perform the actual trading actions and calculations.
CloseOrders(int direction): This function will loop through all orders. Based on the direction parameter (1, -1, or 0), it will use OrderClose() on the matching trades.
DeleteOrders(): Similar to CloseOrders, but it will use OrderDelete() for pending orders and OrderClose() for open market orders.
TradingHours(): A function that checks the current server time against user-defined start and end hours to determine if the EA is within its allowed trading session.
CalculateTrailingStop(...): The logic to calculate the trailing stop price. This could be as simple as Bid - Trailing_Stop_Points for a buy order.
UpdateChartLabel(...): A small helper function to make creating and updating the text objects in OnInit and UpdateChartInformation cleaner and less repetitive.

Dateien:

Bewerbungen

1
Entwickler 1
Bewertung
(258)
Projekte
323
30%
Schlichtung
34
26% / 65%
Frist nicht eingehalten
10
3%
Arbeitet
2
Entwickler 2
Bewertung
(107)
Projekte
175
25%
Schlichtung
23
13% / 78%
Frist nicht eingehalten
16
9%
Frei
3
Entwickler 3
Bewertung
(15)
Projekte
19
16%
Schlichtung
5
40% / 40%
Frist nicht eingehalten
0
Frei
4
Entwickler 4
Bewertung
(510)
Projekte
977
74%
Schlichtung
27
19% / 67%
Frist nicht eingehalten
100
10%
Frei
Veröffentlicht: 1 Artikel, 6 Beispiele
5
Entwickler 5
Bewertung
(98)
Projekte
137
52%
Schlichtung
5
40% / 60%
Frist nicht eingehalten
0
Frei
6
Entwickler 6
Bewertung
Projekte
0
0%
Schlichtung
0
Frist nicht eingehalten
0
Frei
7
Entwickler 7
Bewertung
(68)
Projekte
126
40%
Schlichtung
18
44% / 56%
Frist nicht eingehalten
33
26%
Arbeitet
8
Entwickler 8
Bewertung
(47)
Projekte
67
37%
Schlichtung
5
40% / 40%
Frist nicht eingehalten
1
1%
Frei
9
Entwickler 9
Bewertung
(365)
Projekte
507
40%
Schlichtung
159
17% / 74%
Frist nicht eingehalten
99
20%
Beschäftigt
10
Entwickler 10
Bewertung
(317)
Projekte
564
35%
Schlichtung
81
31% / 44%
Frist nicht eingehalten
204
36%
Frei
11
Entwickler 11
Bewertung
(25)
Projekte
31
13%
Schlichtung
13
0% / 77%
Frist nicht eingehalten
9
29%
Frei
12
Entwickler 12
Bewertung
(16)
Projekte
35
23%
Schlichtung
4
0% / 50%
Frist nicht eingehalten
2
6%
Arbeitet
13
Entwickler 13
Bewertung
(12)
Projekte
13
23%
Schlichtung
7
0% / 71%
Frist nicht eingehalten
3
23%
Arbeitet
14
Entwickler 14
Bewertung
(574)
Projekte
945
47%
Schlichtung
309
58% / 27%
Frist nicht eingehalten
125
13%
Frei
15
Entwickler 15
Bewertung
(77)
Projekte
244
74%
Schlichtung
7
100% / 0%
Frist nicht eingehalten
1
0%
Frei
Veröffentlicht: 1 Artikel
16
Entwickler 16
Bewertung
(58)
Projekte
90
43%
Schlichtung
4
0% / 100%
Frist nicht eingehalten
3
3%
Arbeitet
17
Entwickler 17
Bewertung
(13)
Projekte
13
38%
Schlichtung
1
0% / 100%
Frist nicht eingehalten
1
8%
Frei
18
Entwickler 18
Bewertung
(1)
Projekte
1
0%
Schlichtung
0
Frist nicht eingehalten
0
Frei
19
Entwickler 19
Bewertung
(43)
Projekte
66
12%
Schlichtung
12
58% / 42%
Frist nicht eingehalten
1
2%
Frei
20
Entwickler 20
Bewertung
(8)
Projekte
7
0%
Schlichtung
3
0% / 100%
Frist nicht eingehalten
2
29%
Frei
21
Entwickler 21
Bewertung
(271)
Projekte
553
50%
Schlichtung
57
40% / 37%
Frist nicht eingehalten
227
41%
Arbeitet
22
Entwickler 22
Bewertung
(1)
Projekte
2
0%
Schlichtung
2
0% / 50%
Frist nicht eingehalten
0
Frei
23
Entwickler 23
Bewertung
(9)
Projekte
13
0%
Schlichtung
23
0% / 78%
Frist nicht eingehalten
4
31%
Frei
24
Entwickler 24
Bewertung
(48)
Projekte
56
34%
Schlichtung
15
27% / 60%
Frist nicht eingehalten
1
2%
Arbeitet
25
Entwickler 25
Bewertung
(2)
Projekte
2
0%
Schlichtung
0
Frist nicht eingehalten
0
Frei
Ähnliche Aufträge
//+------------------------------------------------------------------+ //| Simple XAUUSD EA | //+------------------------------------------------------------------+ input double LotSize = 0.01; input int StopLoss = 500; // in points input int TakeProfit = 1000; // in points input int MAPeriod = 20; int maHandle; int OnInit() { maHandle = iMA(_Symbol, PERIOD_H1, MAPeriod, 0, MODE_SMA
Hello, I need a Python-based MT5 forex trading bot developed. The bot should connect to MetaTrader 5, execute trades based on a predefined strategy, and support standard risk management features such as stop loss, take profit, and position sizing. Requirements: MT5 integration using Python Automated trade execution based on provided strategy rules Configurable risk management settings Support for major forex pairs
Hi, I'm Barak, founder of FX Trade Africa, a trading automation company based in Africa. I'm looking for a serious EA developer for a long-term business partnership — not a one-time paid job. IMPORTANT: This is not a paid order. I am looking for a long-term partner who believes in the model and wants to build something serious together. Compensation will be based on profit sharing from funded accounts — details
### ** Main EA File** - `InstitutionalTrendPullbackScalper.mq5` **Core Features Implemented:** **Multi-Timeframe Analysis** - M15 trend filter (EMA20 > EMA50 for uptrends) - M5 entry signals with 5-condition confirmation - Independent indicator sets for both symbols **Advanced Entry Logic** - RSI reversal detection (crosses thresholds) - Price pullback zone validation - Bullish/bearish candle close confirmation -
I need developer who Can perfectly build me a layout of Ninjatrader 8 (NT8) to look and feel the same on SierraCharts? I currently use NT8 but I want to start using SierraCharts because its more robust than NT8, but I don't want to have to worry about programming SierraCharts. How much would this cost? Thank you
Automate my trading 100 - 300 USD
i want a trading bot that take trade auto and make 5% profit daily and stop with in 24 hours not more then that at least the bot give me more then 2% not less then that like a ai agent if it make any loss that agent have to take care of it i need only 5 % profit
I am looking for an EA for MT5 which is stable for long period. should make minimum 20% per month and DD should be less than 10% first send me your backtest reports for last 5 years with real ticks. budget is negotiable based on the quality of the EA. source code should be delivered at the end. Please dont apply without sending backtest report as mentioned above, in other case offers would be rejected
I do not have any startegy, and I want you to create one with your experience, you will provide me EA along with source code. you may use Grid or any logic, but the EA should keep generating profit during Newyourk and Asian session
I am looking for an experienced MQL5 developer to build a professional-grade Expert Advisor (EA) for MetaTrader 5. The strategy is based on liquidity sweeps, market structure (Break of Structure), and institutional concepts (order blocks), specifically optimized for XAUUSD (Gold). This is not a basic bot. I need a structured, optimized, and reliable system suitable for live trading after testing
I need an Ai trading bot for Binance and BTC on MT5 that also uses order flow data. It should also make use of TSI- Temporal indicator sampling and also it should make use of fundamental analysis in the process of signal generation

Projektdetails

Budget
100 - 150 USD
Ausführungsfristen
bis 7 Tag(e)