Hedging EA with manual Support & Resistance Levels TP

İş tamamlandı

Tamamlanma süresi: 9 gün
Müşteri tarafından geri bildirim
Mr. Mudit is exceptional with MQL4, delivering exactly what I envisioned. His understanding of requirements and precise coding skills make him a brilliant asset for any project. Highly recommended!
Geliştirici tarafından geri bildirim
He provided detailed and clear requirements and was patient to clarify any questions. It was a pleasure to work with him.

İş Gereklilikleri

Here is the explanation of EA.

Overview of the Strategy

The main strategy will be hedging trades of similar lot sizes on EUR/USD (or any other pair).

The idea is to start with two trades, Buy and Sell of 0.1 lots each.

The positive trade will close at profit upon reaching Support or Resistance Line defined by horizontal lines (objects) manually (Blue line for resistance and red line for support). If there is no Support or Resistance lines on the chart then TP will hit at a certain X distance set in parameters. At the same time, upon closure of profit trade, a pending stop order will open at the gap of X pips for hedging.

If price reverse, EA will keep deleting the pending order and opening a new one to grab more profit and reducing the hedge distance.

When a profit trade will close, 80% of the profit will be used to offset losing trade by partially closing it. I will explain in details in below lines with example.

This will keep repeating until the price will reverse to the original losing trade and will close it at the breakeven and also delete the pending order and start a new cycle with Buy and Sell trades.

Timeframe:

Timeframe will not matter.

Currency Pair/Instrument:

EA can trade any pair but mainly it will be EUR/USD.

Entry Conditions

There will be no entry condition for the first orders. As soon as the EA will start, it will place two orders of same lot which will be set in parameters.

Let say if setting is 0.1 lot then buy 0.1 and sell 0.1 will open. To keep track of trade levels, let’s assume price of EURUSD is 1.0100 at the moment.

If TP Distance is set at 50 pips (and there are no SR lines on the chart), when once price will go down 50 pips then sell trade will close at 50 pips profit and a new sell stop will open 30 pips below at 1.0020.

If price will reverse and go up and distance of pending order (sell stop) and price is 40 pips then EA will delete sell stop order and will open a new one with 30 pips gap from the current price.

If sell stop hits then both trades will be hedged again.

Let’s assume here that sell stop hit at 1.0080 so now initial buy 0.1 lot trade was open at 0.0100 and sell 0.1 at 0.0080 and there is 20 pips loss in floating. We already closed here one initial sell trade at level 1.0050 with 50 pips profit. So net 30 pips profit we already bagged here.

Exit Conditions

Trades will always be fully hedged. There will be no stop loss.

Exit Signal: We will wait until one of the trades will reach 50 pips profit. So, in above example, two trades are fully hedged. Buy 0.1 at 1.0100 and sell 0.1 at price 1.0080.

Then price moved 70 pips above at 1.0150. Here the buy 0.1 will close in full at 50 pips profit and will also partially close sell trade offsetting this profit and keeping 20% margin. So here our profit is 50$ so we will keep 20% that is 10$ and rest 40$ we will use to offset losing trade. So, EA needs to partially close the sell trade of partial lot which is equal to -40$.

Money Management

Lot Size: Lot sized will remain fixed as set in the parameters. There will be no increase in lot size. If required, I will increase manually from the parameter setting.

Risk Management: Maximum number of trades will be 2 at a time including pending order. Maximum DD level will be 50% after that EA will fully hedge the open trades and will stop working and I will manually take control of that.

Additional Features

Trading Time: It will work 24x7 hours.

Trade Filters: No need to avoid news. Slippage control will be there of 1 pip and there will be a spread filter. EA should not open trade when spread is more than 1 pip.

Partial Closure: (Very important: please make sure the formula works exactly same)

Whenever a trade will hit TP (except the very first trade of every cycle) on SR level or after X distance, it will close in full. EA will calculate the earned profit and will retain only X% amount (retain amount) and will close the open losing trade equal to X% of remaining profit. For example, if the profit of Buy trade is 50$ and retain percentage is 20% and losing Sell trade is floating at -100$ then EA will close partial 0.04 lots equal to -40$.

Now, pending buy stop order of 0.06 lots will open equal to remaining lot size of losing trade. Pending order will always open with similar lot size of active opposite trade size volume.

There is exception only for first trade TP of every new cycle. There will be no partial closure of losing trade with first trade of every new cycle.

Some rules;

All distance calculation should be in Pips and not in points.

Pending orders will always be STOP orders only. There will be no LIMIT orders.

Always two trades maximum and two trades minimum (Including Pending Orders). There cannot be less or more than two trades at a time. If two trades already on the chart (including pending buy stop, sell stop order) then third trade will never open.

When a trade reaches TP (SR line or X pips), the EA fully closes the profitable trade.

If the trade is not the first TP of the cycle, the EA should offset the losing trade by partially closing it with 80% of the profit, keeping 20%.

After closing the profitable trade, a pending order (Buy Stop or Sell Stop) is opened 30 pips from the current price with remaining lot size of open trade.

Pending Orders: Deleting and Re-opening

A pending order is always opened 30 pips away from the current price.

If the pending order's distance reaches 40 pips (due to price movement), the EA will delete the existing pending order and open a new one at 30 pips from the current price because trailing is not possible.

Pending order lot size will be same as already active opened order.

Upon closure of Buy profit trade, only Buy Stop order will open at X distance.

Upon closure of Sell profit trade, only Sell Stop order will open at X distance.

 

Breakeven Rule:

If the price moves in favor of the losing trade and reaches breakeven, the EA will close the losing trade at breakeven, delete pending order, and restart with two new trades.

Exception to the Rule:

The first time the EA reaches TP, it should not partially close the losing trade.

Whenever the EA starts a new cycle, the first TP should also not partially close the losing trade.

 

Backtesting with SR lines:

All the rules should work in backtesting including SR lines. During backtest, if we insert SR lines ignoring the colors, EA should consider this as SR levels. The line above the price will be resistance level and below the current price will be support level. If there are less or more than 2 lines on the chart then EA should ignore lines and calculate X pips distance TP.

 

Parameters with default values:

Lot Size (in pips): 0.1

TP Distance (in pips): 50 (this will only work when there is no SR line on the chart)

Pending Order Distance (in pips): 30

Re-open pending order (in pips): 40

Slippage (in pips): 1

Profit Retention %: 20

Magic Number: 55544

 

Example 1 with all default parameters;

 

Price of EURUSD at 1.0100

EA opens Buy 0.1 and sell 0.1.

 

Price 1.0150

EA closes buy with 50 pips profit.

EA opens Buy stop at 1.0180

No partial close of losing trade here because its first TP of the cycle.

 

Price 1.0180
EA opens Buy 0.1

 

Price 1.0230

EA closes buy with 50 pips profit.

EA opens Buy stop at 1.0260

 

Price 1.0190

EA deletes Buy stop

EA opens Buy stop at 1.0220

 

Price 1.0180

EA deletes Buy stop

EA opens Buy stop at 1.0210

 

Price 1.0170

EA deletes Buy stop

EA opens Buy stop at 1.0200

 

Price 1.0160

EA deletes Buy stop

EA opens Buy stop at 1.0190

 

Price 1.0150

EA deletes Buy stop

EA opens Buy stop at 1.0180

 

Price 1.0140

EA deletes Buy stop

EA opens Buy stop at 1.0170

 

Price 1.0130

EA deletes Buy stop

EA opens Buy stop at 1.0160

 

Price 1.0120

EA deletes Buy stop

EA opens Buy stop at 1.0150

 

Price 1.0110

EA deletes Buy stop

EA opens Buy stop at 1.0140

 

Price 1.0100

EA closes sell at breakeven

EA Deletes Buy Stop.

 

Cycle closed so a new cycle will start with Buy and Sell trades.

 

Example 2 [ Partial Closure ]

 

Price of EURUSD at 1.0100

EA opens Buy 0.1 and sell 0.1.

 

Price 1.0150

EA closes buy with 50 pips profit.

EA opens Buy stop at 1.0180

No partial closure here because its first TP of the cycle.

 

Price 1.0180
EA opens Buy 0.1

 

Price 1.0050

EA closes Sell with 50 pips profit.

EA will calculate 80% of this profit and will close losing trade partially.

EA partially closes Buy 0.03 at loss -40$

EA opens Sell stop 0.07 lots at 1.0020

 

Price 1.0020

EA opens sell 0.07

 

Price 1.0230

EA closes Buy 0.07 at 50 pips profit ($35)

EA will calculate 80% of this profit ($28) and will close losing trade partially.

EA partially closes Sell 0.01 at loss -21$

EA opens Buy stop 0.06 lots at 1.0260

This will continue until the losing trade close at breakeven and pending order will be deleted.


Yanıtlandı

1
Geliştirici 1
Derecelendirme
(21)
Projeler
20
10%
Arabuluculuk
2
50% / 50%
Süresi dolmuş
0
Çalışıyor
2
Geliştirici 2
Derecelendirme
(27)
Projeler
34
15%
Arabuluculuk
6
33% / 50%
Süresi dolmuş
5
15%
Çalışıyor
3
Geliştirici 3
Derecelendirme
(7)
Projeler
9
0%
Arabuluculuk
1
0% / 100%
Süresi dolmuş
0
Serbest
4
Geliştirici 4
Derecelendirme
(29)
Projeler
35
14%
Arabuluculuk
5
40% / 60%
Süresi dolmuş
5
14%
Serbest
5
Geliştirici 5
Derecelendirme
(2)
Projeler
5
0%
Arabuluculuk
2
0% / 0%
Süresi dolmuş
1
20%
Çalışıyor
6
Geliştirici 6
Derecelendirme
(63)
Projeler
194
73%
Arabuluculuk
4
100% / 0%
Süresi dolmuş
1
1%
Serbest
Benzer siparişler
Hello, I am looking for a professional programmer to create a trading expert on the MT4 platform, integrating it with ChatGPT to analyze currencies using various methods to make the right trading decisions. Predictive Analysis: Forecasting Market Trends: ChatGPT can use historical market data to create predictions about future price movements. Thanks to artificial intelligence, the system can be trained to learn from
This robot open trades everyday when you press start hope you enjoy your trading journey and become a profitable trader, this is the creative algo trading system. My ea works normal during the week not weekends
Hi, I have been working on this EA robot for days, but been busy with other things to complete. I am looking for a skilled coder who can modify an existing Expert Advisor (EA) for immediate profitable trading in all forex pairs. The finalization of the EA can then be completed within the next 1 or 2days after back testing. The source code will be shared only after the applicant demonstrates their capability to
TIME FRAME: 15 MIN LOT SIZE: 0.01 CANDLE START TIME: 2:00 CANDLE END TIME: 2:14 ENTRY BUFFER: 1 SL BUFFER: 1 TARGET $: 10 MARTINGALE % : 200 (All the above data should be adjustable) Details: 1. We have to mention candle start time and end time (ie: 4.00 to 4.59). If the candle breaks the high of the given time it should go for buy. If it breaks the low of the given time it should go for sell. 2
# Projeto do Robô de Trading "MeuRobot" ## Introdução O "MeuRobot" é um sistema automatizado de negociação desenvolvido para operar no mercado financeiro utilizando o indicador Parabolic SAR. Este robô foi projetado para facilitar a tomada de decisões de compra e venda, maximizar lucros e fornecer informações em tempo real ao operador. ## Objetivo O objetivo principal do "MeuRobot" é automatizar o processo de
Personnal programmer 30 - 31 USD
Hey there! I’m looking for a talented NinjaTrader programmer to partner with on some exciting projects. If you have a knack for NinjaScript and a passion for trading tech, let’s team up! What You Can Expect: A friendly collaboration on diverse projects Fair pay—50/50 split on all earnings An opportunity to dive deep into innovative trading strategies What I’m Hoping You Bring: Experience with NinjaTrader and
MT5 中运行的 EA 的主要任务 : 1 EA 将同时选择两对货币进行交易,包括 AUDUSD 、 EURUSD 、 GBPUSD 、 NZDUSD 、 USDCAD 、 USDCHF 、 USDJPY 、 AUDJPY 、 EURAUD 、 EURJPY 、 GBPJPY 、 GBPNZD 和 GBPCHF ,默认设置 GBPUSD 、 EURAUD 。 2 蜡烛图 的时间 区间 包括 15M 、 30M 、 1H 、 2H 、 4H 或 1D 。对于两对货币中的 每一对而言, 将同时密切观察两个 时间区间图。 也就是说,两对 货币 同时 打开 四个窗口,每对默认设置 15M 和 4H 。 如果 您 不肯定如何 为同一货币对打开两个窗口,请不要考虑接受这项工作 。 3 将使用自主开发的指标 CMA 结合 CCI 预测走势。 在某些特殊情况下 ,将使用 马丁格尔策略进行操作。因此,如果您已经拥有基于 Martingale
Required to develop expert advisory which will work on any pair including crypto , forex, gold, silver, oil, simple stragy which will work on RSI,GRID, take profit, grid distance, start and stop button, only buy and only sell, filter for time frame Like 5m to 4 hr. stop loss and take profit .Detail will be shared once you except order
I would like to create an EA based on the Shved Supply and Demand indicator. you can find the Shved Supply and Demand v1.7 indicator in the following link https://www.mql5.com/en/code/29395 NB: Checks the trading robot must pass before publication in the Market ( https://www.mql5.com/en/articles/2555 ) MQ5 file to be provided
Hi Guys, I am looking to someone that can generate an indicator for MT4 as explained below. Basically I would need that the indicator point out the price that will close my position in stop out/margin call. The indicator should pick automatically the level of trade out for the broker (which can be different from a broker to another broker) It should write (ideally on the bottom on the left) the following information

Proje bilgisi

Bütçe
50+ USD
Geliştirici için
45 USD
Son teslim tarihi
from 1 to 2 gün