Helping with a code of a Hedge EA

 

Can someone help me with a code?

I have download a Hedge EA from this site named: OverHedgeV2.mq4. The EA works very well only I have 1 code in it, I'm not so happy with. 

That is the hedge code of doubles. Now, with each hedge, the EA doubles the lotsides. Example: each trade, after the start trade, double. So first trade 0.10, second trade 0.20, third trade 0.40 etc. 

But I want a hedge to double with the start lotsides. Example: if the first trade starts with lotsides 0.01 then each hedge has to get the lotsides 0.02.

I do not manage to come up with an MT4 code.

Does anyone know what code I should change and what the code is?

of course, good suggestions for the total ea are always welcome

 
edbeleg:

Can someone help me with a code?

I have download a Hedge EA from this site named: OverHedgeV2.mq4. The EA works very well only I have 1 code in it, I'm not so happy with. 

That is the hedge code of doubles. Now, with each hedge, the EA doubles the lotsides. Example: each trade, after the start trade, double. So first trade 0.10, second trade 0.20, third trade 0.40 etc. 

But I want a hedge to double with the start lotsides. Example: if the first trade starts with lotsides 0.01 then each hedge has to get the lotsides 0.02.

I do not manage to come up with an MT4 code.

Does anyone know what code I should change and what the code is?

of course, good suggestions for the total ea are always welcome

Hi !

First let me welcome you in the great hedge brainstorming family ! So as you can guess the author didn't make the lot size double to seem funky, it's justified so : 

  1. Buy 0.01 ---> -100 pts 'til stoploss
  2. Sell 0.02 from -50 to -100 = 50*2 = 100

Here's the classic scheme : 

If you don't want to increase the lotsize, you'll have to assume it otherwise. 

Here's start the brainstorming. Good luck dude ! 



 
Icham Aidibe:

Hi !

First let me welcome you in the great hedge brainstorming family ! So as you can guess the author didn't make the lot size double to seem funky, it's justified so : 

  1. Buy 0.01 ---> -100 pts 'til stoploss
  2. Sell 0.02 from -50 to -100 = 50*2 = 100

Here's the classic scheme : 

If you don't want to increase the lotsize, you'll have to assume it otherwise. 

Here's start the brainstorming. Good luck dude ! 



Tnx for your help.

I am working on creating a hedge EA that follows the following rules.

1

This EA applies the most rules only must be tightened up in areas.

I think hedging is the best way to have an EA run automatically. After all, you can not predict the market just respond to it.

What do you think about my ideas about hedging?

 
edbeleg:

Tnx for your help.

I am working on creating a hedge EA that follows the following rules.

This EA applies the most rules only must be tightened up in areas.

I think hedging is the best way to have an EA run automatically. After all, you can not predict the market just respond to it.

What do you think about my ideas about hedging?

Logically if you don't recover using only lot size, you'll have to recover considering points, but ... with a smaller canal ? [+100;-100]

  • Buy 0.01 TP +100 - SL -100 
  • H1 : Sell @ -50/0.02 until TP (-50*2=+100) & SL +50 (>0:2*50=100 + <0:2*50 = -200(sell)) + first one 50*1 = -150
Can you detail please ? 


 
Icham Aidibe:

Logically if you don't recover using only lot size, you'll have to recover considering points, but ... with a smaller canal ? [+100;-100]

  • Buy 0.01 TP +100 - SL -100 
  • H1 : Sell @ -50/0.02 until TP (-50*2=+100) & SL +50 (>0:2*50=100 + <0:2*50 = -200(sell)) + first one 50*1 = -150
Can you detail please ? 


this is primarily a theoretical model. I do not use a stop-loss here because the hedge is used for this. The ea hedge each time until the TP is hit and everything is closed at once.

Now the ea should look at the total basket of everything trades to close at a positive tp.

It does not matter which way the trade goes. Or the trade hits the tp and closes with a profit, or the trade is hedged and a new tp is created in the opposite direction.

Now my question is, can this construction?

 
edbeleg:

Tnx for your help.

I am working on creating a hedge EA that follows the following rules.

This EA applies the most rules only must be tightened up in areas.

I think hedging is the best way to have an EA run automatically. After all, you can not predict the market just respond to it.

What do you think about my ideas about hedging?

i have edit old ea to works just like your rule..

but it dificult to make profit.

since the more hedge position occur we should raise the TP to make profit.

here i sent you the ea. hopeyou can make me understand how to make it profitable.

to close all OP i use SL. so when it reach TP it will also reach SL and close all

i set TP 15 and distance 10 for now

all we do is playing this TP & Distance


waiting for your good advise

<ex4 file removed>
 
Please attach mq4 files only.
 
Keith Watford:
Please attach mq4 files only.

ok sorry my mistake 

thanks moderator

 

sir, need a hedging tools for mt5. please provide me
 
Sony Saha #:
sir, need a hedging tools for mt5. please provide me
Such recommendations are not allowed in this forum, you should make your own search in the Market and Codebase or post your requirements as a job in the Freelance section.
 
edbeleg #: What do you think about my ideas about hedging?

Martingale is not a strategy. It's a betting system.

Hedging, grid trading, same as Martingale.
          Martingale, Hedging and Grid : MHG - General - MQL5 programming forum (2016)

Martingale, guaranteed to blow your account eventually. If your strategy is not profitable without, it is definitely not profitable with.
          Martingale vs. Non Martingale (Simplified RoR vs Profit and the Illusions) - MQL5 programming forum (2015)

Why it won't work:
          Calculate Loss from Lot Pips - MQL5 programming forum (2017)
          THIS Trading Strategy is a LIE... I took 100,000 TRADES with the Martingale Strategy - YouTube (2020)

Reason: