Martingal-Hedging EA

MQL4 Uzman Danışmanlar

İş Gereklilikleri


Logic:

An EA that trades based on the logic from martingale and hedging strategy.


Please see attachment for better description with pictures

 

How EA prepares to begin trading:

At any given price, EA sets two opposite pending orders, with equal lot sizes (e.g = 0.1), at equal distance from the current price (this can be altered by the user, e.g, distance between pending orders = 20pips, 30pips, etc) & SL & TP are set as seen diagram.

In the illustration (diagram above) the distance between two pending from current price is set at 10pips (5pips + 5pips)

 

 

 

 

Illustrations when any of the pending orders is triggered:

 

Scenario-1

 

If price triggers buy-stop trade with (for e.g = lot size 0.1); and a TP of 10pips (& SL=30pips) (see diagram (a) below); >>>

EA Action

EA will delete the previous Sell-Stop order (of 0.1lot) and will simultaneously open NEW “Sell-Stop Pending Order” with Lot size 0.3 (ie, multiplier = 3, 3x 0.1 = 0.3) multiplier can be varied by user. (TP 10 pips, SL=30pips) at same price position that previous Sell-Stop order was deleted.

If Long Trade hits TP, >> Delete “Sell-Stop Pending Order”

 

Scenario-1 Profit Calculation:

LONG Trade from scenario-1 = $10

Deleted pending order =$ 0

Total: = $10 + $0 = $10

 

 

Scenario-2:

 

If Long position (from senerio-1) does not hit TP, and activates “Sell-Stop Pending Order” with Lot size 0.3>> (i.e Multiplier x3 of 0.1 lot of scenario-1)

 

EA Action

Open another “Buy-Stop Pending Order” (at exactly same position initial LONG position was triggered) simultaneously with Lot size (multiplier = x 3 of the previous opened position, 3x 0.3 = 0.9) and set TP 10 pips, SL = 20pips >>

If NEW Short position (i.e from activated “Sell-Stop Pending Order”) hit TP, FORCE-Close all opened position (i.e Long position from Scenario-1) and Delete all Pending orders (i.e Buy-Stop Pending Order)

 

Scenario-2 Profit Calculation:

Trade from scenario-1 = -$20

Trade from scenario-2 = $30

Deleted pending order =$ 0

Total: = -$20 + $30 + $0 = $10

 

 

 

 

 

 

Scenario-3:

 

If SHORT position from scenario-2 does not hit TP and triggers a new long position from the pending order…>>>

EA Actions

Open NEW“Long position at Lot size 0.9” (multiplier x3 of previous lot size which was 0.3 lot ie. 3 x 0.3 = 0.9 lot)

Open another “Sell-Stop Pending Order” simultaneously with Lot size 1.8 (ie. 3 x 0.9 = 1.8 lot); (10 pips below) and set TP 10 pips SL = 30 pips >>

If New LONG position (i.e from activated “Buy-Stop Pending Order” Lot size 0.9) hit TP, FORCE-Close all opened position (i.e Long position from Scenario-1 >> SHORT Position from Scenerio-2) and Delete all Pending orders (i.e NEW Sell-Stop Pending Order)

 

Scenario-3 Profit Calculation:

Trade from scenario-1 = $10

Trade from scenario-2 = -$60

Trade from scenario-3 = $90

Deleted pending order =$ 0

Total: = -$10 - $60 + $90 + $0 = $40

 

 

 

Scenario-4

 

If LONG position from activated “Buy-Stop Pending Order” does not hit TP and price triggers “Sell-Stop Pending Order” at Lot size 2.7 (multiplier = x3; ie 3 x 0.9 = 2.7),

Open another “Buy-Stop Pending Order” simultaneously with Lot size 3 x of 2.7 = 8.1 (10 pips below) and set TP 10 pips No SL >>

If New SHORT position (i.e from activated “Sell-Stop Pending Order”) hit TP, FORCE-Close all opened position (i.e Long position from Scenario-1 >> SHORT Position from Scenerio-2 >> LONG Position from Scenario-3) and Delete all Pending orders (i.e Buy-Stop Pending Order)

 

Scenario-4 Profit Calculation:

LONG Trade from scenario-1 = -$20

SHORT Trade from scenario-2 = $30

LONG Trade from scenario-3 = -$180

SHORT Trade from scenario-4 = $270

Deleted pending order =$ 0

Total: = -$20 + $30 - $140 + $270 + $0 = $140

 

Scenario-5

Keep repeating process, ie opening new positions and counter/hedging pending positions until EA activates BREAK-EVEN POSITION LOT SIZE

What is BREAK-EVEN POSITION LOT SIZE?

This is the last pending position that the EA will place with a LOT SIZE that seeks to achieve the most minimum loss (or break-even), in a case the equity balance on the account is not sufficient to keep opening more positions.

At what scenario will this BREAK-EVEN POSITION LOT SIZE be activated?

This will be determined by the user. A user may choose MAXIMUM OPENED POSITION = 3,

This implies that if Scenerio-1, Scenerio-2 does not reach TP, BREAK-EVEN POSITION LOT SIZE will be activated at Scenerio-3

 

Note:

Multiplier:           Number used to multiply previous lot-size to determine new lot size for new position to be opened

FORCE-Close:     Close all opened positions when any TP or SL of any of the opened position is reached by price.



Yanıtlandı

1
Geliştirici 1
Derecelendirme
(33)
Projeler
35
40%
Arabuluculuk
11
9% / 91%
Süresi dolmuş
4
11%
Serbest
Benzer siparişler
Im looking for an coder to code an EA: Trade management 1. opening trades according to the indicator 2. trades settings to choose from like: open all trades according to the signal open only trade 1,2,3 or 4 % per trade ( example 50/30/20 of the lot settings, with 4 trades it would be for example 50/30/10/10) 3. SL/Trailing settings: Move SL to entry after hitting TP1/TP2 or TP3 moving SL by % keep the original SL
Hi I'm looking to have 2 of my pinescript strategies converted to MQL5 and was wondering if you could first give me a quote for the more simple strategy and then for both the simple and complex strategy together. The simple strategy is a MACD crossover type thing that uses a special EMA script that filters out some ranging price action and also fractal candles for the stop loss. The second strategy is market
I want grate robot for making profits that know when to start a good trade and close a trade and must be active all time to avoid lost of money
I have developed a very strong TradingView strategy in Pine Script but unfortunately, a third-party connector is requiired and in my opinion, I want a more direct connection. I am not brilliant at coding, but I have coded the majority of the MT5 code and I would like you to make sure that the MT5 code matches my TradingView script and executes the same way as the TradingView script that I will provide if you are
Mbeje fx 50+ USD
I like to own my robot that why I want to build my own.i like to be a best to every robot ever in the life to be have more money
I need an MT5 EA that can do the following: I have to give the EA a price in advance, when the price is reached the EA has to automatically place a buy stop or sell stop order 0.5 pips below or above the price. Is this possible
Dr Pattern 30+ USD
good day i need the service of the seaso coder to help me fix my ea The Job required 1 knowledge of Mt4 and Mt5 indicator coding 2. Telegram code 3. ability to code indicator to work on multiple Time frame combine to trade 4 Ability to Join two or three indicator on same ir different time frame if you have these skill please let chart i will discuss the details of the Job inside to you The required day including
Good day, I want someone to help me create a universal news filter with on/off switch, with start and end settings, and drawdown control with magic number of EAs, etc. Thanks
Hello, I am looking for a professional programmer to optimize my existing EA integrating it with ChatGPT to analyze currencies using various methods to make the right trading decisions. i want it to be an EA that can be trusted to carry trade with the help of chat gpt and also have a very low drawdown
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. Further details will be provided to the applicants later

Proje bilgisi

Bütçe
20 - 45 USD
Geliştirici için
18 - 40.5 USD
Son teslim tarihi
from 2 to 4 gün