Experts: Simplest Hedging EA ever - page 3

 
BarrowBoy:
LEHayes:

This technique leaves me to believe that if you do not close the negative trade, you will never see a profit in a true hedge.

Thats true :)

Next I am going to attempt to find a way to decide when to cut the loss on the losing trade so that the profiting trade can prevail.
Thats the really tricky bit :{
Thing is, are we really hedging here - I call this cover trading as there is only one commodity involved...

Hi Barrowboy/LEH,

Agree with both of you. It is not a true hedge; I was quite surprised that it turned out that statistically, both trades will win often enough to provide long-term profit... if you're lucky :)

M
 
monuogbe:
Hi Forexnet,

You could change the MAGIC from a constant to an external variable by changing this code:

#define MAGIC  1234
#define IDENT  "mo_bidir_v0_1"
 
extern double  lots           = 1;
extern double  stop_loss      = 80;   // (8 pips) optimise 50-2000
extern double  take_profit    = 750;  // (75 pips) optimise 50-2000
to:
#define IDENT  "mo_bidir_v0_1"
 
extern double  MAGIC          = 1234
extern double  lots           = 1;
extern double  stop_loss      = 80;   // (8 pips) optimise 50-2000
extern double  take_profit    = 750;  // (75 pips) optimise 50-2000
You would then be able to go into the "Expert Properties" and change the MAGIC number on each chart you are working with.

Regards,

Monu

hi monu,

After days of testing i finally able to write a hedging EA strategy base on EUR/USD and USD/CHF. I manage to get very good result on my demo account using manual entry.

I need someone that can help me code it into EA. pls email me the EA. thanks

Regards
Hans

 
91058020:
monuogbe:
Hi Forexnet,

You could change the MAGIC from a constant to an external variable by changing this code:

#define MAGIC  1234
#define IDENT  "mo_bidir_v0_1"
 
extern double  lots           = 1;
extern double  stop_loss      = 80;   // (8 pips) optimise 50-2000
extern double  take_profit    = 750;  // (75 pips) optimise 50-2000
to:
#define IDENT  "mo_bidir_v0_1"
 
extern double  MAGIC          = 1234
extern double  lots           = 1;
extern double  stop_loss      = 80;   // (8 pips) optimise 50-2000
extern double  take_profit    = 750;  // (75 pips) optimise 50-2000
You would then be able to go into the "Expert Properties" and change the MAGIC number on each chart you are working with.

Regards,

Monu

hi monu,

After days of testing i finally able to write a hedging EA strategy base on EUR/USD and USD/CHF. I manage to get very good result on my demo account using manual entry.

I need someone that can help me code it into EA. pls email me the EA. thanks

Regards
Hans

 
The supercomputer FXDD Demo is plugged into tore this robot into pieces with a rack-stretcher and sold it for scrap metal on the other side of town and charged me for towing. It's a lot faster and easier to just press New order Buy and Sell. ~J
 
Wow this is simple! Thanks for the contribution though, this one has potential to grow imo. 
 
is it possible to add trailing stop?
 

Most US brokers will net two positions that are opened simultaneously.

It would be much appreciated to see this EA modified to have the orders be stop/limits that are set to execute at a specific distance from the current market price rather than market orders...

Can anyone advise?

 

Would anyone know how to change the market orders to stop orders that are executed at a specific distance from the market price?

The US brokers usually will net a buy/sell placed simultaneously...

 

hey, just testing this ea, backtest is ok, but on live chart it just doesnt trade (live trading and other options are alright, another ea works on chart) it looks like it works (smile in corner) but it doesnt open trades..

terminal and ea log showing no errors.. can anyone prove does it work on live chart?

 
jgray110:
The supercomputer FXDD Demo is plugged into tore this robot into pieces with a rack-stretcher and sold it for scrap metal on the other side of town and charged me for towing.

+1

Best comment, jgray110.

Reason: